From 2467756e9e048a4579ee65c9980672316e12ee24 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 Nov 2011 17:02:10 -0400 Subject: [PATCH] Support chaining to absolute paths. --- debian/changelog | 1 + mr | 33 +++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5e4cb7b..83f629f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ mr (1.06) UNRELEASED; urgency=low * Fix propigation of failure from pre and post hooks and from fixups. + * Support chaining to absolute paths. -- Joey Hess Thu, 27 Oct 2011 12:18:43 -0400 diff --git a/mr b/mr index 74b1cfc..97720d4 100755 --- a/mr +++ b/mr @@ -1238,21 +1238,26 @@ sub loadconfig { $knownactions{$parameter}=1; } if ($parameter eq 'chain' && - length $dir && $section ne "DEFAULT" && - -e $dir.$section."/.mrconfig") { - my $ret=system($value); - if ($ret != 0) { - if (($? & 127) == 2) { - print STDERR "mr: chain test interrupted\n"; - exit 2; + length $dir && $section ne "DEFAULT") { + my $chaindir="$section"; + if ($chaindir !~ m!/!) { + $chaindir=$dir.$chaindir; + } + if (-e "$chaindir/.mrconfig") { + my $ret=system($value); + if ($ret != 0) { + if (($? & 127) == 2) { + print STDERR "mr: chain test interrupted\n"; + exit 2; + } + elsif ($? & 127) { + print STDERR "mr: chain test received signal ".($? & 127)."\n"; + } } - elsif ($? & 127) { - print STDERR "mr: chain test received signal ".($? & 127)."\n"; + else { + push @toload, ["$chaindir/.mrconfig", $chaindir]; } } - else { - push @toload, $dir.$section."/.mrconfig"; - } } } } @@ -1261,8 +1266,8 @@ sub loadconfig { } } - foreach (@toload) { - loadconfig($_); + foreach my $c (@toload) { + loadconfig(@$c); } } -- 2.39.2