]> git.madduck.net Git - code/myrepos.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Support chaining to absolute paths.
authorJoey Hess <joey@kitenet.net>
Wed, 2 Nov 2011 21:02:10 +0000 (17:02 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 2 Nov 2011 21:02:10 +0000 (17:02 -0400)
debian/changelog
mr

index 5e4cb7b13132443e0f920592f1280e89da2b30c9..83f629f3b97be4a3ac4a50f870b922630706d578 100644 (file)
@@ -1,6 +1,7 @@
 mr (1.06) UNRELEASED; urgency=low
 
   * Fix propigation of failure from pre and post hooks and from fixups.
 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 <joeyh@debian.org>  Thu, 27 Oct 2011 12:18:43 -0400
 
 
  -- Joey Hess <joeyh@debian.org>  Thu, 27 Oct 2011 12:18:43 -0400
 
diff --git a/mr b/mr
index 74b1cfc094e963bd150890061f1181b61850efe6..97720d456feb136c2f6dc91eb4ef02a1a97d6775 100755 (executable)
--- a/mr
+++ b/mr
@@ -1238,21 +1238,26 @@ sub loadconfig {
                                        $knownactions{$parameter}=1;
                                }
                                if ($parameter eq 'chain' &&
                                        $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);
        }
 }
 
        }
 }