rpms/kernel/devel kernel.spec,1.1529,1.1530

Chuck Ebbert cebbert at fedoraproject.org
Fri Apr 24 14:50:57 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27318

Modified Files:
	kernel.spec 
Log Message:
clean up code that applies optional patches


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1529
retrieving revision 1.1530
diff -u -r1.1529 -r1.1530
--- kernel.spec	22 Apr 2009 20:40:44 -0000	1.1529
+++ kernel.spec	24 Apr 2009 14:50:27 -0000	1.1530
@@ -593,7 +593,6 @@
 Patch41: linux-2.6-sysrq-c.patch
 
 Patch50: rds-only-on-64-bit-or-x86.patch
-Patch51: fix-ppc-debug_kmap_atomic.patch
 
 Patch141: linux-2.6-ps3-storage-alias.patch
 Patch143: linux-2.6-g5-therm-shutdown.patch
@@ -896,6 +895,20 @@
   esac
 }
 
+# don't apply patch if it's empty
+ApplyOptionalPatch()
+{
+  local patch=$1
+  shift
+  if [ ! -f $RPM_SOURCE_DIR/$patch ]; then
+    exit 1
+  fi
+  local C=$(wc -l $RPM_SOURCE_DIR/$patch | awk '{print $1}')
+  if [ "$C" -gt 9 ]; then
+    ApplyPatch $patch ${1+"$@"}
+  fi
+}
+
 # First we unpack the kernel tarball.
 # If this isn't the first make prep, we use links to the existing clean tarball
 # which speeds things up quite a bit.
@@ -1035,7 +1048,7 @@
   done
 %endif
 
-#ApplyPatch git-linus.diff
+#ApplyOptionalPatch git-linus.diff
 
 # This patch adds a "make nonint_oldconfig" which is non-interactive and
 # also gives a list of missing options at the end. Useful for automated
@@ -1047,18 +1060,12 @@
 #
 # misc small stuff to make things compile
 #
-C=$(wc -l $RPM_SOURCE_DIR/linux-2.6-compile-fixes.patch | awk '{print $1}')
-if [ "$C" -gt 10 ]; then
-ApplyPatch linux-2.6-compile-fixes.patch
-fi
+ApplyOptionalPatch linux-2.6-compile-fixes.patch
 
 %if !%{nopatches}
 
 # revert patches from upstream that conflict or that we get via other means
-C=$(wc -l $RPM_SOURCE_DIR/linux-2.6-upstream-reverts.patch | awk '{print $1}')
-if [ "$C" -gt 10 ]; then
-ApplyPatch linux-2.6-upstream-reverts.patch -R
-fi
+ApplyOptionalPatch linux-2.6-upstream-reverts.patch -R
 
 #ApplyPatch git-cpufreq.patch
 #ApplyPatch git-bluetooth.patch
@@ -1208,10 +1215,7 @@
 
 # linux1394 git patches
 #ApplyPatch linux-2.6-firewire-git-update.patch
-C=$(wc -l $RPM_SOURCE_DIR/linux-2.6-firewire-git-pending.patch | awk '{print $1}')
-#if [ "$C" -gt 10 ]; then
-#ApplyPatch linux-2.6-firewire-git-pending.patch
-#fi
+#ApplyOptionalPatch linux-2.6-firewire-git-pending.patch
 
 # silence the ACPI blacklist code
 ApplyPatch linux-2.6-silence-acpi-blacklist.patch




More information about the scm-commits mailing list