my $clean = 0;
my $binarylist = "";
my $buildall = 0;
+my $commit = "";
+my $includeall = 0;
my $dist = "tizen";
my $dryrun = 0;
my $help = 0;
"exclude=s" => \@exclude,
"exclude-from-file=s" => \$exclude_from_file,
"build-all" => \$buildall,
+ "commit=s" => \$commit,
+ "include-all" => \$includeall,
"binary=s" => \$binarylist,
"style=s" => \$style,
"path=s" => \$path,
my $skip = 0;
my $old_base = "";
if ( -e "$base/.git" ) {
- open(GIT,"git --git-dir $base/.git rev-parse HEAD |") || die "Failed: $!\n";
+ my $commit_id;
+ if ($commit eq ""){
+ $commit_id = "HEAD";
+ }else{
+ $commit_id = $commit;
+ }
+ open(GIT,"git --git-dir $base/.git rev-parse $commit_id|") || die "Failed: $!\n";
while (my $current_rev = <GIT>) {
chomp($current_rev);
if ( system("grep -rq $current_rev $cache_path") == 0 ) {
} else {
debug("not a git repo: $base/.git!!");
}
- if ($skip == 1) {
+ if ($skip == 1 && $includeall == 0) {
if ( $old_base ne "" ) {
$old_base = basename($old_base);
push(@packs, "$pkg_path/$old_base/$spec_file");
push(@packs, "$pkg_path/$pkg_name-$pkg_version-$pkg_release/$spec_file");
}
} else {
- if ( system("gbs export $base -o $pkg_path") == 0 ) {
+ my @args = ();
+ my $cmd;
+ push @args, "gbs export";
+ push @args, "$base";
+ push @args, "-o $pkg_path";
+ if ($includeall == 1) {
+ push @args, "--include-all";
+ } elsif ($commit ne "") {
+ push @args, "--commit=$commit";
+ }
+ $cmd = join(" ", @args);
+ if ( system($cmd) == 0 ) {
push(@packs, "$pkg_path/$pkg_name-$pkg_version-$pkg_release/$spec_file");
} else {
debug("$name was not exported correctly");
if ($buildall || @packs == 0 ) {
if ($style eq "git") {
File::Find::find({wanted => \&git_wanted}, $package_path );
+ if (@original_specs > 1 && ! $commit eq ""){
+ error("--commit option can't be specified with multiple packages");
+ }
} elsif ($style eq "obs") {
File::Find::find({wanted => \&obs_wanted}, $package_path );
}