]> 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 absolute paths to repos
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 11 Oct 2007 21:25:28 +0000 (17:25 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 11 Oct 2007 21:25:28 +0000 (17:25 -0400)
mr
mrconfig

diff --git a/mr b/mr
index b35a3b72d80d3ad0cd3820970e0eb05ee97a3b92..04a5cbf72f8c55bde7d5c05f839f0411eb72c6f0 100755 (executable)
--- a/mr
+++ b/mr
@@ -133,8 +133,10 @@ come after it.
 The "ALIAS" section allows adding aliases for actions. Each parameter
 is an alias, and its value is the action to use.
 
-All other sections specify where each repository is located, relative to the
-directory that contains the .mrconfig file.
+All other sections add repositories. The section header specifies the
+directory where the repository is located. This is relative to the directory
+that contains the mrconfig file, but you can also choose to use absolute
+paths.
 
 Within a section, each parameter defines a shell command to run to handle a
 given action. mr contains default handlers for the "update", "status", and
@@ -247,8 +249,11 @@ my $nochdir=0;
 foreach my $topdir (sort keys %config) {
        foreach my $subdir (sort keys %{$config{$topdir}}) {
                next if $subdir eq 'DEFAULT';
-               my $dir=$topdir.$subdir;
-               next if $dir ne $directory && $dir !~ /^\Q$directory\E\//;
+               my $dir=($subdir =~/^\//) ? $subdir : $topdir.$subdir;
+               my $d=$directory;
+               $dir.="/" unless $dir=~/\/$/;
+               $d.="/" unless $d=~/\/$/;
+               next if $dir ne $directory && $dir !~ /^\Q$directory\E/;
                push @repos, [$dir, $topdir, $subdir];
        }
 }
@@ -257,7 +262,7 @@ if (! @repos) {
        LEAF: foreach my $topdir (reverse sort keys %config) {
                foreach my $subdir (reverse sort keys %{$config{$topdir}}) {
                        next if $subdir eq 'DEFAULT';
-                       my $dir=$topdir.$subdir;
+                       my $dir=($subdir =~/^\//) ? $subdir : $topdir.$subdir;
                        my $d=$directory;
                        $dir.="/" unless $dir=~/\/$/;
                        $d.="/" unless $d=~/\/$/;
@@ -330,7 +335,7 @@ sub action {
                my $ret=system($command);
                if ($ret != 0) {
                        print STDERR "mr $action: failed ($ret)\n" if $verbose;
-                       push @failed, $topdir.$subdir;
+                       push @failed, $dir;
                        if ($ret >> 8 != 0) {
                                print STDERR "mr $action: command failed\n";
                        }
index 28a68b05d2d547af57a2efa447ff410a29e3cd76..f70ff9bb6a69c87c117ff7def7518835ed315791 100644 (file)
--- a/mrconfig
+++ b/mrconfig
@@ -8,12 +8,16 @@ cleanup = if [ -d "$MR_REPO"/.svn ]; then svn cleanup ; fi
 #   large)
 # - mylaptop only succeeds if it's on my main development laptop, which 
 #   gets lots of extra cruft
+# - kite only succeeds on kite
 lib = \
        wantsrc() { \
                test "$(whoami)" = joey; \
        }; \
        mylaptop() { \
                test "$(hostname)" = kodama; \
+       }; \
+       kite() { \
+               test "$(hostname)" = wren; \
        }
 
 [src/mr]