Make sync-all work with the GitHub mirror.
authorThomas Schilling <nominolo@googlemail.com>
Mon, 4 Apr 2011 13:00:54 +0000 (14:00 +0100)
committerEdward Z. Yang <ezyang@mit.edu>
Tue, 5 Apr 2011 17:07:38 +0000 (18:07 +0100)
sync-all

index 0d0af67..729dbd3 100755 (executable)
--- a/sync-all
+++ b/sync-all
@@ -228,6 +228,8 @@ sub scmall {
 
     my ($repo_base, $checked_out_tree) = getrepo();
 
 
     my ($repo_base, $checked_out_tree) = getrepo();
 
+    my $is_github_repo = $repo_base =~ m/(git@|git:\/\/)github.com/;
+
     parsePackages;
 
     @args = ();
     parsePackages;
 
     @args = ();
@@ -270,6 +272,12 @@ sub scmall {
             $scm        = $$line{"vcs"};
             $upstream   = $$line{"upstream"};
 
             $scm        = $$line{"vcs"};
             $upstream   = $$line{"upstream"};
 
+            # We can't create directories on GitHub, so we translate
+            # "package/foo" into "package-foo".
+            if ($is_github_repo) {
+                $remotepath =~ s/\//-/;
+            }
+
             # Check the SCM is OK as early as possible
             die "Unknown SCM: $scm" if (($scm ne "darcs") and ($scm ne "git"));
 
             # Check the SCM is OK as early as possible
             die "Unknown SCM: $scm" if (($scm ne "darcs") and ($scm ne "git"));