my $binarylist = "";
my $binary_from_file = "";
my $commit = "HEAD";
+my $spec_commit = "";
my $includeall = 0;
my $upstream_branch = "";
my $upstream_tag = "";
"exclude=s" => \@exclude,
"exclude-from-file=s" => \$exclude_from_file,
"commit=s" => \$commit,
+ "spec-commit=s" => \$spec_commit,
"include-all" => \$includeall,
"upstream-branch=s" => \$upstream_branch,
"upstream-tag=s" => \$upstream_tag,
debug("working on $base");
if ($includeall == 0) {
my (undef, $tmp_file) = tempfile(CLEANUP=>1, OPEN => 0);
- if (my_system("cd $base; git show $commit:$packaging_dir >$tmp_file 2>/dev/null") == 0) {
+ if (my_system("cd $base; git show $spec_commit:$packaging_dir >$tmp_file 2>/dev/null") == 0) {
open my $file, '<', $tmp_file or die $!;
my $first_line = <$file>;
if ($first_line =~ /^tree/) {
}
} else { #packaging_dir is a symbol link
my (undef, $tmp_symlink_file) = tempfile(CLEANUP=>1, OPEN => 0);
- if (my_system("cd $base; git show $commit:$first_line >$tmp_symlink_file 2>/dev/null") == 0) {
+ if (my_system("cd $base; git show $spec_commit:$first_line >$tmp_symlink_file 2>/dev/null") == 0) {
open my $symlink_file, '<', $tmp_symlink_file or die $!;
while (<$symlink_file>) {
chomp;
my $without_base;
$spec =~ s!\Q$base/\E!!;
$without_base = $spec;
- if (my_system("cd $base; git show $commit:$without_base >$tmp_spec 2>/dev/null") != 0) {
- warning("failed to checkout spec file from commit: $commit:$without_base");
+ if (my_system("cd $base; git show $spec_commit:$without_base >$tmp_spec 2>/dev/null") != 0) {
+ warning("failed to checkout spec file from commit: $spec_commit:$without_base");
return;
}
$spec = $tmp_spec;
info("start building packages from: " . $package_path . " ($style)");
($_, $start_time) = my_system("date +\"%Y-%m-%d %H:%M %z\"");
+$spec_commit = $commit if ($spec_commit eq "");
if ($style eq 'git') {
File::Find::find({wanted => \&git_wanted}, $package_path );
if (@pre_packs > 1 && $commit ne "HEAD"){