[Pkg-ocaml-maint-commits] r1423 - trunk/packages/ocamlnet/trunk/debian

Stefano Zacchiroli zack@costa.debian.org
Fri, 01 Jul 2005 15:49:52 +0000


Author: zack
Date: 2005-07-01 15:49:51 +0000 (Fri, 01 Jul 2005)
New Revision: 1423

Modified:
   trunk/packages/ocamlnet/trunk/debian/changelog
   trunk/packages/ocamlnet/trunk/debian/libocamlnet-ocaml-dev.preinst
Log:
added preinst script to get dir of old diversions


Modified: trunk/packages/ocamlnet/trunk/debian/changelog
===================================================================
--- trunk/packages/ocamlnet/trunk/debian/changelog	2005-06-28 22:29:18 UTC (rev 1422)
+++ trunk/packages/ocamlnet/trunk/debian/changelog	2005-07-01 15:49:51 UTC (rev 1423)
@@ -1,3 +1,10 @@
+ocamlnet (1.0-2) unstable; urgency=low
+
+  * libocamlnet-ocaml-dev.preinst
+    - get rid of old diversions of cgi/META
+
+ -- Stefano Zacchiroli <zack@debian.org>  Fri,  1 Jul 2005 17:40:01 +0200
+
 ocamlnet (1.0-1) unstable; urgency=medium
 
   * New upstream release

Modified: trunk/packages/ocamlnet/trunk/debian/libocamlnet-ocaml-dev.preinst
===================================================================
--- trunk/packages/ocamlnet/trunk/debian/libocamlnet-ocaml-dev.preinst	2005-06-28 22:29:18 UTC (rev 1422)
+++ trunk/packages/ocamlnet/trunk/debian/libocamlnet-ocaml-dev.preinst	2005-07-01 15:49:51 UTC (rev 1423)
@@ -1,4 +1,17 @@
 #!/bin/sh
+
+DIRS=`find /usr/lib/ocaml -maxdepth 1 -type d 2> /dev/null` &&
+for dir in "$DIRS"; do
+  dir=`echo $dir | sed 's:/$::'`
+  if [ "$dir" != "`ocamlc -where`" ]; then
+    if [ -f "$dir/cgi/META.real" ]; then
+      dpkg-divert --remove "$dir/cgi/META"
+      rm -f "$dir/cgi/META"
+      rmdir -p "$dir/cgi" &> /dev/null
+    fi
+  fi
+done
+
 if [ install = "$1" -o upgrade = "$1" ]; then
    dpkg-divert --package libocamlnet-ocaml-dev \
       --add --rename --divert \
@@ -6,3 +19,4 @@
 fi
 
 #DEBHELPER#
+