my $pkg_release = $pack->{release};
my $spec_file = basename($spec);
my $skip = 0;
+ my $old_base = "";
if ( -e "$base/.git" ) {
open(GIT,"git --git-dir $base/.git rev-parse HEAD |") || die "Failed: $!\n";
while (my $current_rev = <GIT>) {
chomp($current_rev);
+ if ( system("grep -rq $current_rev $cache_path") == 0 ) {
+ open(GREP,"grep -rl $current_rev $cache_path |") || die "Failed: $!\n";
+ while ( <GREP> ) {
+ chomp;
+ $old_base = $_;
+ }
+ $skip = 1;
+ }
my @lines = ();
if ( -e "$cache_path/$pkg_name-$pkg_version-$pkg_release" ) {
open (REV, "< $cache_path/$pkg_name-$pkg_version-$pkg_release");
open (REV, "> $cache_path/$pkg_name-$pkg_version-$pkg_release");
}
foreach my $old_rev(@lines) {
- chomp($old_rev);
if ( $current_rev eq $old_rev ) {
$skip = 1;
}
debug("not a git repo: $base/.git!!");
}
if ($skip == 1) {
- push(@packs, "$pkg_path/$pkg_name-$pkg_version-$pkg_release/$spec_file");
+ if ( $old_base ne "" ) {
+ $old_base = basename($old_base);
+ #print "yyy $old_base\n";
+ print "xxx $pkg_path/$old_base/$spec_file\n";
+ push(@packs, "$pkg_path/$old_base/$spec_file");
+ } else {
+ push(@packs, "$pkg_path/$pkg_name-$pkg_version-$pkg_release/$spec_file");
+ }
} else {
if ( system("gbs export $base -o $pkg_path") == 0 ) {
push(@packs, "$pkg_path/$pkg_name-$pkg_version-$pkg_release/$spec_file");