various ocaml-md5sums related fixes
authorStefano Zacchiroli <zack@debian.org>
Fri, 12 Aug 2005 08:48:16 +0000 (08:48 +0000)
committerStefano Zacchiroli <zack@debian.org>
Fri, 12 Aug 2005 08:48:16 +0000 (08:48 +0000)
debian/changelog
debian/control
debian/ocaml-compiler-libs.postrm
debian/ocaml-nox.postrm
debian/ocaml.postrm
debian/patches/ocaml-md5sums.dpatch

index adf55364b395bdbfac7037a6f129ec39d46c4bff..d58c11a11b7c1471909b998227f2e1a38e7f9b91 100644 (file)
@@ -4,7 +4,18 @@ ocaml (3.08.3-7) UNRELEASED; urgency=low
   * debian/patches/byterun_interp_ia64_fix.dpatch
     - Removed spurious ia64 cast which broke builds with gcc 4.0
 
- -- Sven Luther <luther@debian.org>  Tue,  9 Aug 2005 20:06:13 +0200
+  Changes by Stefano Zacchiroli:
+  * debian/control
+    - added versioned dep from ocaml-compiler-libs to ocaml-base-nox to
+      ensure ocaml-md5sums exists at postinst invocation time
+  * debian/{ocaml-compiler-libs,ocaml-nox,ocaml}.postrm
+    - invoke ocaml-md5sums update only if it is available, if not
+      md5sums database will be updated next time ocaml-base-nox will be
+      installed (Closes: Bug#322210)
+  * debian/patches/ocaml-md5sums
+    - avoid failure on update if /var/lib/ocaml/md5sums does not exists
+
+ -- Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>  Fri, 12 Aug 2005 10:47:30 +0200
 
 ocaml (3.08.3-6) unstable; urgency=low
 
index f0d387f462eabaca39e50fb361a5ddbe8b8aa772..cc24b6fc221d856be98e61d4e685d8e73bec6dc9 100644 (file)
@@ -138,7 +138,7 @@ Description: Ocaml interpreter and standard libraries
 Package: ocaml-compiler-libs
 Architecture: any
 Provides: ocaml-compiler-libs-3.08.3
-Depends: ocaml-nox-3.08.3
+Depends: ocaml-nox-3.08.3, ocaml-base-nox (>= 3.08.3-6)
 Description: Ocaml interpreter and standard libraries
  Objective Caml is an implementation of the ML language, based on
  the Caml Light dialect extended with a complete class-based object system
index 80fcec69d63023a61903dd4f34836d2e2c3efd9a..0fb414e4c18aa56c77884f83e7f18c2a093dc716 100644 (file)
@@ -1,7 +1,9 @@
 #!/bin/sh -e
 
 if [ "$1" = "remove" ]; then
-  ocaml-md5sums update
+  if [ -x /usr/bin/ocaml-md5sums ]; then
+    /usr/bin/ocaml-md5sums update
+  fi
 fi
 
 #DEBHELPER#
index 3fec175a814dfa4065c53f2e1315db0d6e712243..6b337769e3d62dcd773ec244deeca4441abcc95f 100644 (file)
@@ -3,7 +3,9 @@
 rm -f /usr/include/caml
 
 if [ "$1" = "remove" ]; then
-  ocaml-md5sums update
+  if [ -x /usr/bin/ocaml-md5sums ]; then
+    /usr/bin/ocaml-md5sums update
+  fi
 fi
 
 #DEBHELPER#
index 80fcec69d63023a61903dd4f34836d2e2c3efd9a..0fb414e4c18aa56c77884f83e7f18c2a093dc716 100644 (file)
@@ -1,7 +1,9 @@
 #!/bin/sh -e
 
 if [ "$1" = "remove" ]; then
-  ocaml-md5sums update
+  if [ -x /usr/bin/ocaml-md5sums ]; then
+    /usr/bin/ocaml-md5sums update
+  fi
 fi
 
 #DEBHELPER#
index 90c02a1c292eb7aa1288f52a695095327d5e402b..637f7055028013ce40cd9fecd9429bafc26cb191 100755 (executable)
@@ -5,9 +5,9 @@
 ## DP: No description.
 
 @DPATCH@
-diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/configure /tmp/dpep-work.c7Vvzd/trunk/ocaml-md5sums/configure
+diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/configure /tmp/dpep-work.YsUxwk/trunk/ocaml-md5sums/configure
 --- ./ocaml-md5sums/configure  1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/dpep-work.c7Vvzd/trunk/ocaml-md5sums/configure        2005-07-31 11:02:49.000000000 +0200
++++ /tmp/dpep-work.YsUxwk/trunk/ocaml-md5sums/configure        2005-08-12 10:19:10.000000000 +0200
 @@ -0,0 +1,12 @@
 +#!/bin/sh
 +DEFAULT="/var/lib/ocaml/3.08.3/md5sums"
@@ -21,9 +21,9 @@ diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/configure /tmp/dpep-wor
 +echo -n "Creating ocaml-md5sums.ml ... "
 +sed "s:@MD5SUMS_DIR@:$MD5SUMS_DIR:" < ocaml-md5sums.ml.in > ocaml-md5sums.ml
 +echo "done."
-diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/feeding.sh /tmp/dpep-work.c7Vvzd/trunk/ocaml-md5sums/feeding.sh
+diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/feeding.sh /tmp/dpep-work.YsUxwk/trunk/ocaml-md5sums/feeding.sh
 --- ./ocaml-md5sums/feeding.sh 1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/dpep-work.c7Vvzd/trunk/ocaml-md5sums/feeding.sh       2005-07-31 11:03:53.000000000 +0200
++++ /tmp/dpep-work.YsUxwk/trunk/ocaml-md5sums/feeding.sh       2005-08-12 10:19:10.000000000 +0200
 @@ -0,0 +1,40 @@
 +#!/bin/sh
 +# Copyright (C) 2005, Stefano Zacchiroli <zack@debian.org>
@@ -65,9 +65,9 @@ diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/feeding.sh /tmp/dpep-wo
 +    ;;
 +esac
 +
-diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/Makefile /tmp/dpep-work.c7Vvzd/trunk/ocaml-md5sums/Makefile
+diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/Makefile /tmp/dpep-work.YsUxwk/trunk/ocaml-md5sums/Makefile
 --- ./ocaml-md5sums/Makefile   1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/dpep-work.c7Vvzd/trunk/ocaml-md5sums/Makefile 2005-07-31 11:02:49.000000000 +0200
++++ /tmp/dpep-work.YsUxwk/trunk/ocaml-md5sums/Makefile 2005-08-12 10:19:10.000000000 +0200
 @@ -0,0 +1,30 @@
 +
 +DESTDIR = /usr/local/bin
@@ -99,17 +99,17 @@ diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/Makefile /tmp/dpep-work
 +clean:
 +      rm -f ocaml-md5sums ocaml-md5sums.opt *.cm[aiox] *.cmxa *.[ao]
 +
-diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/ocaml-md5sums.ml.in /tmp/dpep-work.c7Vvzd/trunk/ocaml-md5sums/ocaml-md5sums.ml.in
+diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/ocaml-md5sums.ml.in /tmp/dpep-work.YsUxwk/trunk/ocaml-md5sums/ocaml-md5sums.ml.in
 --- ./ocaml-md5sums/ocaml-md5sums.ml.in        1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/dpep-work.c7Vvzd/trunk/ocaml-md5sums/ocaml-md5sums.ml.in      2005-07-31 11:02:49.000000000 +0200
-@@ -0,0 +1,310 @@
++++ /tmp/dpep-work.YsUxwk/trunk/ocaml-md5sums/ocaml-md5sums.ml.in      2005-08-12 10:28:16.000000000 +0200
+@@ -0,0 +1,314 @@
 +(*
 + * ocaml-md5sums - use and maintain debian registry of ocaml md5sums
 + *
 + * Copyright (C) 2005, Stefano Zacchiroli <zack@debian.org>
 + *
 + * Created:        Wed, 06 Apr 2005 16:55:39 +0200 zack
-+ * Last-Modified:  Sun, 31 Jul 2005 00:48:15 +0200 zack
++ * Last-Modified:  Fri, 12 Aug 2005 10:28:10 +0200 zack
 + *
 + * This is free software, you can redistribute it and/or modify it under the
 + * terms of the GNU General Public License version 2 as published by the Free
@@ -210,6 +210,8 @@ diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/ocaml-md5sums.ml.in /tm
 +  List.rev !lines
 +
 +let is_empty fname = (Unix.stat fname).Unix.st_size = 0
++let is_regular fname = (Unix.stat fname).Unix.st_kind = Unix.S_REG
++let is_dir fname = (Unix.stat fname).Unix.st_kind = Unix.S_DIR
 +
 +(** {2 Auxiliary functions} *)
 +
@@ -361,28 +363,30 @@ diff -urNad --exclude=CVS --exclude=.svn ./ocaml-md5sums/ocaml-md5sums.ml.in /tm
 +  info (sprintf "updating registry %s using info from %s/"
 +    registry_file md5sums_dir);
 +  let keys = Hashtbl.create 1024 in (* history of seen registry keys *)
-+  let dir = Unix.opendir md5sums_dir in
-+  let registry = open_out registry_file in
-+  try
-+    while true do
-+      let fname = sprintf "%s/%s" md5sums_dir (Unix.readdir dir) in
-+      if (Str.string_match md5sums_ext_RE fname 0)
-+        && ((Unix.stat fname).Unix.st_kind = Unix.S_REG)
-+      then
-+        iter_registry
-+          (fun ~md5sum ~unit_name ~dev_dep ~runtime_dep ~dep_version ->
-+             if Hashtbl.mem keys (unit_name, md5sum) then
-+               error (sprintf "duplicate entry %s %s in registry" unit_name
-+                          md5sum);
-+             Hashtbl.replace keys (unit_name, md5sum) ();
-+             pp_entry registry ~md5sum ~unit_name ~dev_dep ~runtime_dep
-+               ~dep_version)
-+          fname
-+    done
-+  with End_of_file ->
-+    Unix.closedir dir;
-+    close_out registry;
-+    if is_empty registry_file then Sys.remove registry_file
++  if Sys.file_exists md5sums_dir && is_dir md5sums_dir then begin
++    let dir = Unix.opendir md5sums_dir in
++    let registry = open_out registry_file in
++    try
++      while true do
++        let fname = sprintf "%s/%s" md5sums_dir (Unix.readdir dir) in
++        if (Str.string_match md5sums_ext_RE fname 0) && is_regular fname then
++          iter_registry
++            (fun ~md5sum ~unit_name ~dev_dep ~runtime_dep ~dep_version ->
++               if Hashtbl.mem keys (unit_name, md5sum) then
++                 error (sprintf "duplicate entry %s %s in registry" unit_name
++                            md5sum);
++               Hashtbl.replace keys (unit_name, md5sum) ();
++               pp_entry registry ~md5sum ~unit_name ~dev_dep ~runtime_dep
++                 ~dep_version)
++            fname
++      done
++    with End_of_file ->
++      Unix.closedir dir;
++      close_out registry;
++      if is_empty registry_file then Sys.remove registry_file
++  end else
++    warning (sprintf "%s/ does not exist or is not a directory, not updating"
++      md5sums_dir)
 +
 +(** {2 Main} *)
 +