]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_makeshlibs
r388: * Ok, I tihnk we have a db3 fix that will really work now.
[debhelper.git] / dh_makeshlibs
index 237602b4984cd9998f1cc65864afaf5d1314ecd6..6c708e8676c0ae936d4208623d91d17f152938a2 100755 (executable)
@@ -8,12 +8,19 @@ init();
 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
        $TMP=tmpdir($PACKAGE);
 
+       my %seen;
+
        doit("rm", "-f", "$TMP/DEBIAN/shlibs");
 
-       open (FIND, "find $TMP -type f -name '*.so.*' |");
+       open (FIND, "find $TMP -xtype f -name '*.so.*' |");
        while (<FIND>) {
                chomp;
-               ($library, $major)=m#.*/(.*)\.so\.(\d*)\.?#;
+               # The second evil regexp is for db3, whose author should
+               # be shot.
+               if (m#.*/(.*)\.so\.(\d*)\.?# || m#.*/(.*)-(\S+)\.so$#) {
+                       $library = $1;
+                       $major = $2;
+               }
                if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') {
                        $major=$dh{M_PARAMS};
                }
@@ -32,15 +39,20 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
                                $deps="$PACKAGE (>= $dh{VERSION})";
                        }
                }
-               if (defined($library) && defined($major) && defined($deps) && 
+               if (defined($library) && defined($major) && defined($deps) &&
                    $library ne '' && $major ne '' && $deps ne '') {
-                       complex_doit("echo '$library $major $deps' >>$TMP/DEBIAN/shlibs");
+                       # Prevent duplicate lines from entering the file.
+                       my $line="$library $major $deps";
+                       if (! $seen{$line}) {
+                               $seen{$line}=1;
+                               complex_doit("echo '$line' >>$TMP/DEBIAN/shlibs");
+                       }
                }
        }
        close FIND;
 
        if (-e "$TMP/DEBIAN/shlibs") {
                doit("chmod",644,"$TMP/DEBIAN/shlibs");
-               doit("chown","root.root","$TMP/DEBIAN/shlibs");
+               doit("chown","0.0","$TMP/DEBIAN/shlibs");
        }
 }