Browse Source

git2spec.pl: filter patches with no file changes

master
Harald Hoyer 14 years ago
parent
commit
f295392724
  1. 13
      git2spec.pl

13
git2spec.pl

@ -24,6 +24,15 @@ sub create_patches { @@ -24,6 +24,15 @@ sub create_patches {
close GIT; # be done
return @lines;
};

sub filter_patch {
my $patch=shift;
open(P, $patch);
@lines=<P>;
close(P);
grep (/^ 0 files changed/, @lines);
}

use POSIX qw(strftime);
my $datestr = strftime "%Y%m%d", gmtime;

@ -40,12 +49,13 @@ while(<>) { @@ -40,12 +49,13 @@ while(<>) {
print "Version: $tag\n";
}
elsif (/^Release:/) {
print "Release: $release\n";
print "Release: $release%{?dist}\n";
}
elsif ((/^Source0:/) || (/^Source:/)) {
print $_;
$num=1;
for(@patches) {
next if filter_patch $_;
print "Patch$num: $_";
$num++;
}
@ -55,6 +65,7 @@ while(<>) { @@ -55,6 +65,7 @@ while(<>) {
print $_;
$num=1;
for(@patches) {
next if filter_patch $_;
print "%patch$num -p1\n";
$num++;
}

Loading…
Cancel
Save