]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.spec: apply patches with git
authorHarald Hoyer <harald@redhat.com>
Fri, 21 Oct 2011 10:35:07 +0000 (12:35 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 21 Oct 2011 10:35:07 +0000 (12:35 +0200)
This will take all renames and mode changes.

dracut.spec
git2spec.pl

index f9848eda5bf0f59b9463a726b2ee1b671bef2ee6..69809ca2b4932c9a0febca30930eea48cb77ecbb 100644 (file)
@@ -24,7 +24,7 @@ URL: https://dracut.wiki.kernel.org/
 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
@@ -155,6 +155,14 @@ This package contains tools to assemble the local initrd and host configuration.
 
 %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
index 2ea74c835ddebb0ef9cbe1a3d2a8c2029d7f8a65..9db42aa1907df5dcb5034dbf2f874ad00f1ffcfb 100755 (executable)
@@ -19,20 +19,12 @@ sub last_tag {
 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;
 
@@ -55,22 +47,11 @@ while(<>) {
        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 $_;
     }