Create directories in /usr/local/lib with proper permissions in
authorJulien Cristau <julien.cristau@ens-lyon.org>
Sat, 16 Apr 2005 12:27:54 +0000 (12:27 +0000)
committerJulien Cristau <julien.cristau@ens-lyon.org>
Sat, 16 Apr 2005 12:27:54 +0000 (12:27 +0000)
ocaml-base-nox's postinst, and remove them if empty in prerm
(Closes: #270925)

debian/changelog
debian/ocaml-base-nox.postinst
debian/ocaml-base-nox.prerm [new file with mode: 0644]

index f37a4783dffc7b633894650fb32af406e9c189a3..dd393b7631c7fbf55c6e3d7131e6e03bd6bd6049 100644 (file)
@@ -1,3 +1,11 @@
+ocaml (3.08.3-3+SVN) UNRELEASED; urgency=low
+
+  * Create directories in /usr/local/lib with proper permissions in
+    ocaml-base-nox's postinst, and remove them if empty in prerm
+    (Closes: #270925)
+
+ -- Julien Cristau <julien.cristau@ens-lyon.org>  Sat, 16 Apr 2005 14:22:32 +0200
+
 ocaml (3.08.3-3) unstable; urgency=medium
 
   * Missed the include symlink in 3.08 -> 3.08.3 migration.
index 344bd67b4ea79d6c781a47ab0444c26703faece8..78cc945abe0e27922d1421aa36c734ce20019a6a 100644 (file)
@@ -1,9 +1,26 @@
 #!/bin/sh
-mkdir -p /usr/local/lib/ocaml/3.08.3/stublibs || true
+if [ ! -e /usr/local/lib/ocaml ]; then
+    if mkdir /usr/local/lib/ocaml 2>/dev/null; then
+       chown root:staff /usr/local/lib/ocaml
+       chmod 2775 /usr/local/lib/ocaml
+    fi
+fi
+if [ ! -e /usr/local/lib/ocaml/3.08.3 ]; then
+    if mkdir /usr/local/lib/ocaml/3.08.3 2>/dev/null; then
+       chown root:staff /usr/local/lib/ocaml/3.08.3
+       chmod 2775 /usr/local/lib/ocaml/3.08.3
+    fi
+fi
+if [ ! -e /usr/local/lib/ocaml/3.08.3/stublibs ]; then
+    if mkdir /usr/local/lib/ocaml/3.08.3/stublibs 2>/dev/null; then
+       chown root:staff /usr/local/lib/ocaml/3.08.3/stublibs
+       chmod 2775 /usr/local/lib/ocaml/3.08.3/stublibs
+    fi
+fi
 
 for i in /usr/lib/ocaml/3.06 /etc/ocaml /var/lib/ocaml; do     \
        if [ -e $i/ld.conf ]; then                              \
-               echo "Removing leftover $i.ld.conf";            \
+               echo "Removing leftover $i/ld.conf";            \
                rm -f $i/ld.conf;                               \
                rmdir --ignore-fail-on-non-empty $i;            \
        fi;                                                     \
diff --git a/debian/ocaml-base-nox.prerm b/debian/ocaml-base-nox.prerm
new file mode 100644 (file)
index 0000000..6f497c2
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+rmdir /usr/local/lib/ocaml/3.08.3/stublibs 2>/dev/null || true
+rmdir /usr/local/lib/ocaml/3.08.3 2>/dev/null || true
+rmdir /usr/local/lib/ocaml 2>/dev/null || true