Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add clone/checkout of component HEAD from local bare repo; add fetch …
…command to fetch new commits to bare repos; stub build command
  • Loading branch information
Geoffrey Broadwell committed Oct 20, 2012
1 parent b1d60f5 commit a062490
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions bench
Expand Up @@ -42,14 +42,42 @@ multi MAIN ('setup') {
my $repo = $component<repo_url>;
my $bare = "$name.git";
run < git clone --bare >, $repo, $bare unless $bare.IO.d;
run < git clone -l >, $bare, $name unless $name.IO.d;
}

say 'Setup complete.';
}

#= Fetch latest commits in each cloned component
multi MAIN ('fetch') {
unless 'components'.IO.d {
say "There is no 'components' tree, and thus there are no repos to fetch.";
say "Please run `$*PROGRAM_NAME setup` instead.";
return;
}

chdir 'components';
my $comp_dir = cwd;

for dir('.').sort -> $component-name {
say "==> $component-name";
my $bare = "$component-name/$component-name.git";

unless $bare.IO.d {
say "No bare repository exists for component $component-name; can't fetch updates.";
next;
}

%*ENV<GIT_DIR> = $bare;
my $tag_list = open 'git tag', :p;
my @tags = $tag_list.lines;
.say for @tags;
run < git fetch >;
}
}

say 'Setup complete.';
multi MAIN ('build') {
# %*ENV<GIT_DIR> = $bare;
# my $tag_list = open 'git tag', :p;
# my @tags = $tag_list.lines;
# .say for @tags;
}

#= Clean up generated files and directories
Expand Down

0 comments on commit a062490

Please sign in to comment.