Skip to content

Commit

Permalink
allow path prefix before package name
Browse files Browse the repository at this point in the history
  • Loading branch information
rofl0r committed May 7, 2012
1 parent c4df8cb commit 42f01c3
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions butch.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,12 +815,20 @@ int main(int argc, char** argv) {
state.checked[JT_DOWNLOAD] = stringptrlist_new(64);
state.checked[JT_BUILD] = stringptrlist_new(64);

int force[] = { [PKGC_REBUILD] = 1, [PKGC_REBUILD_ALL] = -1, [PKGC_INSTALL] = 0 };
stringptr curr;
for(i=2; i < argc; i++) {
queue_package(&state, stringptr_fromchar(argv[i], &curr), JT_DOWNLOAD, 0);
for(i = 2; i < argc; i++) {
const int force[] = { [PKGC_REBUILD] = 1, [PKGC_REBUILD_ALL] = -1, [PKGC_INSTALL] = 0 };
stringptr curr;
// allow something like pkg/packagename to be passed
char* pkg_name = strrchr(argv[i], '/');

if(!pkg_name) pkg_name = argv[i];
else pkg_name++;

stringptr_fromchar(pkg_name, &curr);

queue_package(&state, &curr, JT_DOWNLOAD, 0);
if(mode != PKGC_PREFETCH)
queue_package(&state, stringptr_fromchar(argv[i], &curr), JT_BUILD, force[mode]);
queue_package(&state, &curr, JT_BUILD, force[mode]);
}
print_info(&state);
prepare_slots(&state);
Expand Down

0 comments on commit 42f01c3

Please sign in to comment.