From 69cba0fdcf854e9ea567654c0b38e91b21226c88 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Oct 2007 00:18:21 -0400 Subject: [PATCH 1/1] allow .mrconfig to be a symlink abs_path would canonicalise the symlink and mr would try to from the directory of the file it pointed to, avoid that counterintive behavior --- mr | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mr b/mr index aa15728..0f80fc8 100755 --- a/mr +++ b/mr @@ -129,7 +129,7 @@ foreach my $topdir (sort keys %config) { if (defined $directory && $dir !~ /^\Q$directory\E\//) { - print "mr $action: $dir skipped per -d parameter\n" if $verbose; + print "mr $action: $dir skipped per -d parameter ($directory)\n" if $verbose; push @skipped, $dir; next; } @@ -212,16 +212,17 @@ sub loadconfig { $dir=""; } else { - $f=abs_path($f); - - if ($loaded{$f}) { + # $f might be a symlink + my $absf=abs_path($f); + if ($loaded{$absf}) { return; } - $loaded{$f}=1; + $loaded{$absf}=1; print "mr: loading config $f\n" if $verbose; open($in, "<", $f) || die "mr: open $f: $!\n"; ($dir)=$f=~/^(.*\/)[^\/]+$/; + $dir=abs_path($dir)."/"; # copy in defaults from first parent my $parent=$dir; -- 2.39.5