[Pkg-ocaml-maint-commits] [SCM] dh-ocaml packaging branch, master, updated. debian/0.5.0-17-gfce4e39

Sylvain Le Gall gildor at debian.org
Tue Jul 21 14:42:42 UTC 2009


The following commit has been merged in the master branch:
commit cca9d12cb4d71eabbfc724833ef0150fd2e309f9
Author: Sylvain Le Gall <gildor at debian.org>
Date:   Mon Jul 20 14:24:10 2009 +0200

    Allow to avoid defining some unit in ocaml-md5sums.

diff --git a/ocaml-md5sums/ocaml-md5sums b/ocaml-md5sums/ocaml-md5sums
index 77af9a9..3286ea4 100755
--- a/ocaml-md5sums/ocaml-md5sums
+++ b/ocaml-md5sums/ocaml-md5sums
@@ -27,7 +27,8 @@ sub new
   my ($class, 
       $dev, 
       $runtime, 
-      $version) = @_;
+      $version,
+      @nodefined) = @_;
 
   my $self = ();
   $self->{dev} = defined $dev ? $dev : "-";
@@ -37,6 +38,8 @@ sub new
   $self->{imported} = ();
   $self->{depends} = ();
   $self->{file} = ();
+  $self->{nodefined} = ();
+  $self->{nodefined}{$_} = 1 foreach @nodefined;
 
   bless $self, $class;
   return $self;
@@ -46,9 +49,16 @@ sub add_unit
 {
   my ($self, $symbol_table, $unit_name, $md5) = @_;
   my $key = "$md5+$unit_name";
-  main::debug "Adding unit $unit_name to $symbol_table" 
-    unless exists $self->{$symbol_table}{$key};
-  $self->{$symbol_table}{$key} = "none";
+  if ($symbol_table eq "defined" && exists $self->{nodefined}{$unit_name})
+  {
+    main::info "Not defining unit $unit_name";
+  }
+  else
+  {
+    main::debug "Adding unit $unit_name to $symbol_table" 
+      unless exists $self->{$symbol_table}{$key};
+    $self->{$symbol_table}{$key} = "none";
+  };
 };
 
 sub get_unit
@@ -374,6 +384,7 @@ my $load_info_fn;
 my $print_version;
 my $dump_provides;
 my @md5sums_dirs=("/var/lib/ocaml/md5sums");
+my @nodefined = ();
 
 sub process_not_option
 {
@@ -402,6 +413,7 @@ GetOptions(
   "load-info=s"     => \$load_info_fn,
   "dump-provides=s" => \$dump_provides,
   "md5sums-dir=s"   => \@md5sums_dirs,
+  "nodefined=s"     => \@nodefined,
   "my-version"      => \$print_version,
   "v+"              => \$verbose,
   "<>"              => \&process_not_option,
@@ -424,7 +436,8 @@ if ($action eq "compute" || $action eq "dep" || $action eq "check")
     OCamlMD5Sums::File->new 
       ($package_dev, 
        $package_runtime,
-       $package_version);
+       $package_version,
+       @nodefined);
   $md5sums->read_dump($load_info_fn) if defined($load_info_fn);
   foreach (get_objects(defined($load_info_fn)))
   {

-- 
dh-ocaml packaging



More information about the Pkg-ocaml-maint-commits mailing list