]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_link
r1539: fix tag name
[debhelper.git] / dh_link
diff --git a/dh_link b/dh_link
index cc1b49545a23d25c3a40d6823e4b3a4a3d72cf11..1f6299aa932feaf4a73eef334ea55f06b14f237e 100755 (executable)
--- a/dh_link
+++ b/dh_link
@@ -3,7 +3,7 @@
 # Generate symlinks in debian packages, reading debian/links. The
 # file contains pairs of files and symlinks.
 
-BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+BEGIN { push @INC, "debian", "/usr/share/debhelper" }
 use Dh_Lib;
 init();
 
@@ -35,6 +35,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
                $dest=pop @links;
                $src=pop @links;
 
+               # Relivatize src and dest.
+               $src=~s:^/::;
+               $dest=~s:^/::;
+
                # Make sure the directory the link will be in exists.
                $basedir=Dh_Lib::dirname("$TMP/$dest");
                if (! -e $basedir) {
@@ -50,7 +54,6 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
                        # Figure out how much of a path $src and $dest
                        # share in common.
                        for ($x=0; $x<$#src_dirs && $src_dirs[$x] eq $dest_dirs[$x]; $x++) {}
-
                        # Build up the new src.
                        $src="";
                        for (1..$#dest_dirs - $x) {
@@ -61,6 +64,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
                        }
                        $src=~s:/$::;
                }
+               else {
+                       # Make sure it's properly absolute.
+                       $src="/$src";
+               }
                
                doit("ln","-sf",$src,"$TMP/$dest");
        }