]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_link
r2020: * dh_link: Skip self-links. Closes: #438572
[debhelper.git] / dh_link
diff --git a/dh_link b/dh_link
index f7a910a5a473cc483b9ce705174f08689092e47a..84e6ba359bef31bebec1746f2ba61cd2020f8f79 100755 (executable)
--- a/dh_link
+++ b/dh_link
@@ -166,6 +166,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 
                $src=~s:^/::;
                $dest=~s:^/::;
+               
+               if ($src eq $dest) {
+                       warning("skipping link from $src to self");
+                       next;
+               }
 
                # Make sure the directory the link will be in exists.
                my $basedir=dirname("$tmp/$dest");
@@ -182,7 +187,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        # Figure out how much of a path $src and $dest
                        # share in common.
                        my $x;
-                       for ($x=0; $x<@src_dirs && $src_dirs[$x] eq $dest_dirs[$x]; $x++) {}
+                       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) {