Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Generally handle trailing slashes in symlinks and unburden-home-dir.list

  • Loading branch information...
commit 97821570982f6b87df947fd87c5406d3658089df 1 parent e866bfe
Axel Beckert authored May 18, 2012

Showing 1 changed file with 6 additions and 3 deletions. Show diff stats Hide diff stats

  1. 9  bin/unburden-home-dir
9  bin/unburden-home-dir
@@ -255,9 +255,12 @@ sub fix_dangling_links {
255 255
     my ($type, $itemexpanded, $target) = @_;
256 256
     my $link = readlink($itemexpanded);
257 257
 
258  
-    # Accept symlinks without trailing slash
259  
-    if ( $type eq 'd' or $type eq 'D' ) {
260  
-	$link .= '/' if ((!($link =~ /\/$/)) and -d $link);
  258
+    # Accept existing symlinks or unburden-home-dir.list entries for
  259
+    # directories with or without trailing slash
  260
+    if ($type eq 'd' or $type eq 'D') {
  261
+	$link =~ s{/$}{};
  262
+	$itemexpanded =~ s{/$}{};
  263
+	$target =~ s{/$}{};
261 264
     }
262 265
 
263 266
     # Check if link target is wanted target

0 notes on commit 9782157

Please sign in to comment.
Something went wrong with that request. Please try again.