This will take all renames and mode changes.
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
BuildArch: noarch
-BuildRequires: dash bash
+BuildRequires: dash bash git
%if 0%{?fedora} || 0%{?rhel} > 6
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%endif
%prep
%setup -q -n %{name}-%{version}
+git init
+git config user.email "dracut-maint@redhat.com"
+git config user.name "Fedora dracut team"
+git add .
+git commit -a -q -m "%{version} baseline."
+
+# Apply all the patches.
+git am -p1 %{patches}
%build
make
sub create_patches {
my $tag=shift;
my $num=0;
- open( GIT, 'git format-patch --no-renames -N --no-signature '.$tag.' |');
+ open( GIT, 'git format-patch -N --no-signature '.$tag.' |');
@lines=<GIT>;
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;
print $_;
$num=1;
for(@patches) {
- next if filter_patch $_;
print "Patch$num: $_";
$num++;
}
print "\n";
}
- elsif (/^%setup/) {
- print $_;
- $num=1;
- for(@patches) {
- next if filter_patch $_;
- print "%patch$num -p1\n";
- $num++;
- }
- print "\n";
- }
else {
print $_;
}