From d8382ae4ec31199527ecd3fd19c21c00fcbc2a85 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 4 Sep 2014 16:50:25 +0300 Subject: [PATCH] Fix --include-all when --spec-commit is defined Always find(use spec file(s) from the commit(ish) defined by --spec-commit - even if --include-all is defined. Fixes: DEVT-199 Change-Id: I9365b8af8ee2960cd1430d0bb6756da71d875447 Signed-off-by: Markus Lehtonen --- depanneur | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/depanneur b/depanneur index 0f8ab62..9250c8c 100755 --- a/depanneur +++ b/depanneur @@ -552,12 +552,13 @@ sub fill_packs_from_git { } debug("working on $base"); - if ($includeall == 0) { + if ($includeall == 0 || $spec_commit ne "") { my (undef, $tmp_file) = tempfile(OPEN => 0); - if (my_system("cd $base; git show $spec_commit:$packaging_dir >$tmp_file 2>/dev/null") == 0) { + my $__commit = $spec_commit eq "" ? $commit : $spec_commit; + if (my_system("cd $base; git show $__commit:$packaging_dir >$tmp_file 2>/dev/null") == 0) { open my $file, '<', $tmp_file or die $!; # the content like: - # tree $spec_commit:$packaging_dir + # tree $__commit:$packaging_dir # # xxxxx.spec # if packaging dir is a symbol link @@ -576,7 +577,7 @@ sub fill_packs_from_git { } else { #packaging_dir is a symbol link my (undef, $tmp_symlink_file) = tempfile(OPEN => 0); # git show the real packaging dir - if (my_system("cd $base; git show $spec_commit:$first_line >$tmp_symlink_file 2>/dev/null") == 0) { + if (my_system("cd $base; git show $__commit:$first_line >$tmp_symlink_file 2>/dev/null") == 0) { open my $symlink_file, '<', $tmp_symlink_file or die $!; while (<$symlink_file>) { chomp; @@ -733,7 +734,7 @@ sub prepare_git { my $spec = shift; my $spec_file = basename($spec); - if ($includeall == 0) { + if ($includeall == 0 || $spec_commit ne "") { # create temp directory and clean it autoly my $tmp_dir = abs_path(tempdir(CLEANUP=>1)); my $tmp_spec = "$tmp_dir/$spec_file"; @@ -1982,7 +1983,6 @@ info("start building packages from: " . $package_path . " ($style)"); ($_, $gbs_version) = my_system("gbs -V"); $gbs_version =~ s!gbs !!; -$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"){ -- 2.34.1