[Pkg-mono-svn-commits] rev 1006 - mono/trunk/debian

Eduard Bloch blade@haydn.debian.org
Mon, 14 Jun 2004 16:21:22 -0600


Author: blade
Date: 2004-06-14 16:21:19 -0600 (Mon, 14 Jun 2004)
New Revision: 1006

Modified:
   mono/trunk/debian/changelog
   mono/trunk/debian/dh_netdeps
Log:
Cheat code in dh_netdebs - dupes removal after shlib:Depends
consideration and sort order beautification


Modified: mono/trunk/debian/changelog
===================================================================
--- mono/trunk/debian/changelog	2004-06-14 21:28:26 UTC (rev 1005)
+++ mono/trunk/debian/changelog	2004-06-14 22:21:19 UTC (rev 1006)
@@ -2,9 +2,11 @@
 
   * (NOT RELEASED YET) New upstream release
   * Eduard Bloch
-    + setting virtual ".shlibs" via provides, currently libmono-0.95
+    + setting virtual ".shlibs" for libmono via provides, currently
+      libmono-0.95
     + dh_makenetlibs and dh_netdeps tools to manage assembly dependencies in
       the Perl/Python way
+    + Moved Pablo's dh_installxsp script to mono-utils to mono-utils
     + mono-common.preinst now moves /usr/lib/mono directory (if exists) to
       /usr/share/dotnet
     + moved the check for mono-vs.-mint priority to debian/rules

Modified: mono/trunk/debian/dh_netdeps
===================================================================
--- mono/trunk/debian/dh_netdeps	2004-06-14 21:28:26 UTC (rev 1005)
+++ mono/trunk/debian/dh_netdeps	2004-06-14 22:21:19 UTC (rev 1006)
@@ -31,6 +31,17 @@
 
 If you use this program, your package should build-depend on mono-utils.
 
+=head1 OPTIONS
+
+=over 4
+
+=item B<-d>
+
+Attempt to predict and avoid dupes that may appear if you package
+both, native shared libraries and DLL assemblies in one package.
+The list of possibly duplicating candidates is expected to be in the
+variable shlib:Depends from debian/package.substvars.
+
 =cut
 
 init();
@@ -164,14 +175,40 @@
 
     my %depkgsFiltered;
     for (@depkgs) {
-        for ( split ( /,\s+/, $_ ) ) {
-            $depkgsFiltered{$_} = 1;
+       for ( split ( /\s*,\s*/, $_ ) ) {
+          $depkgsFiltered{$_} = 1;
+       }
+    }
+    # now filter the dupes coming from shlibs
+    if ( defined( $dh{D_FLAG} ) ) {
+        open( $fh, "<debian/$package.substvars" ) 
+        || warning(
+           "Could not read debian/$package.substvars"
+        );
+        while (<$fh>) {
+            if (/^shlibs:Depends=(.*)\n?/) {
+                for ( split ( /\s*,\s*/, $1 ) ) {
+                    delete $depkgsFiltered{$_};
+                }
+            }
         }
     }
 
     addsubstvar( $package, "net:Depends",
         "mono-jit (>= $mono_version) | mono-mint (>= $mono_version)"
-        . join ( ", ", "", sort ( keys %depkgsFiltered ) ) );
+        . join ( ", ", "", sort {
+           # beautify the sort order... oh, it sucks
+           my $apkg;
+           $a=~/^\S+/;
+           $apkg=$&;
+           $b=~/^\S+/;
+           if($apkg eq $&) {
+              print STDERR "test, $apkg $&\n";
+              return -1 if( ($a=~/>=/) && ($b=~/<</));
+              return 1 if( ($b=~/>=/) && ($a=~/<</));
+           }
+           $a cmp $b;
+        } ( keys %depkgsFiltered ) ) );
 }
 
 =head1 SEE ALSO