? Makefile.jx
? TODO.jx
? config-generic.jx
? kernel.spec.jx
? linux-2.6.29-pat-fixes.patch.jx
? linux-2.6.29.tar.bz2
? patch-2.6.29-git13.bz2
? patch-2.6.29-git9.bz2
? patch-2.6.31-rc1-git2.bz2
? patch-2.6.31-rc1.bz2
? patch-2.6.31-rc2-git9.bz2
? patch-2.6.31-rc2.bz2
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1643
diff -u -p -r1.1643 kernel.spec
--- kernel.spec	20 Jul 2009 19:06:35 -0000	1.1643
+++ kernel.spec	20 Jul 2009 19:50:56 -0000
@@ -545,26 +545,27 @@ Source100: config-arm
 %if 0%{?stable_update}
 %if 0%{?stable_base}
 %define    stable_patch_00  patch-2.6.%{base_sublevel}.%{stable_base}.bz2
-Patch00: %{stable_patch_00}
+Source1000: %{stable_patch_00}
 %endif
 %if 0%{?stable_rc}
 %define    stable_patch_01  patch-2.6.%{base_sublevel}.%{stable_update}-rc%{stable_rc}.bz2
-Patch01: %{stable_patch_01}
+Source1001: %{stable_patch_01}
 %endif
 
 # non-released_kernel case
 # These are automagically defined by the rcrev and gitrev values set up
-# near the top of this spec file.
+# near the top of this spec file.  These are SourceNNN to hide them from
+# %%{patches}.
 %else
 %if 0%{?rcrev}
-Patch00: patch-2.6.%{upstream_sublevel}-rc%{rcrev}.bz2
+Source1000: patch-2.6.%{upstream_sublevel}-rc%{rcrev}.bz2
 %if 0%{?gitrev}
-Patch01: patch-2.6.%{upstream_sublevel}-rc%{rcrev}-git%{gitrev}.bz2
+Source1001: patch-2.6.%{upstream_sublevel}-rc%{rcrev}-git%{gitrev}.bz2
 %endif
 %else
 # pre-{base_sublevel+1}-rc1 case
 %if 0%{?gitrev}
-Patch00: patch-2.6.%{base_sublevel}-git%{gitrev}.bz2
+Source100: patch-2.6.%{base_sublevel}-git%{gitrev}.bz2
 %endif
 %endif
 %endif
@@ -573,12 +574,16 @@ Patch00: patch-2.6.%{base_sublevel}-git%
 ### BRANCH PATCH ###
 %endif
 
+# Some patches we need even for -vanilla...
+
 Patch02: git-linus.diff
 
-# we always need nonintconfig, even for -vanilla kernels
+# 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
+# builds (as used in the buildsystem).
 Patch03: linux-2.6-build-nonintconfig.patch
 
-# we also need compile fixes for -vanilla
+# misc small stuff to make things compile
 Patch04: linux-2.6-compile-fixes.patch
 
 # build tweak for build ID magic, even for -vanilla
@@ -586,102 +591,142 @@ Patch05: linux-2.6-makefile-after_link.p
 
 %if !%{nopatches}
 
-# revert upstream patches we get via other methods
-Patch09: linux-2.6-upstream-reverts.patch
 # Git trees.
-Patch10: git-cpufreq.patch
-Patch11: git-bluetooth.patch
+#Patch10: git-cpufreq.patch
+#Patch11: git-bluetooth.patch
 
 # Standalone patches
 Patch20: linux-2.6-hotfixes.patch
 
+# Roland's utrace ptrace replacement.
 Patch21: linux-2.6-tracehook.patch
 Patch22: linux-2.6-utrace.patch
 
 Patch30: sched-introduce-SCHED_RESET_ON_FORK-scheduling-policy-flag.patch
 
-Patch41: linux-2.6-sysrq-c.patch
+# enable sysrq-c on all kernels, not only kexec
+#Patch41: linux-2.6-sysrq-c.patch
+
+# Architecture fixes
 
+## PowerPC
+### NOT (YET) UPSTREAM:
+# The storage alias patch is Fedora-local, and allows the old 'ps3_storage'
+# module name to work on upgrades. Otherwise, I believe mkinitrd will fail
+# to pull the module in,
 Patch141: linux-2.6-ps3-storage-alias.patch
+# Alleviate G5 thermal shutdown problems
 Patch143: linux-2.6-g5-therm-shutdown.patch
+# Provide modalias in sysfs for vio devices
 Patch144: linux-2.6-vio-modalias.patch
+# Work around PCIe bridge setup on iSight
 Patch147: linux-2.6-imac-transparent-bridge.patch
 
+# SPARC64
 Patch150: linux-2.6.29-sparc-IOC_TYPECHECK.patch
 
+# execshield
 Patch160: linux-2.6-execshield.patch
 
+# bugfixes to drivers and filesystems
+
+# Various low-impact patches to aid debugging.
 Patch250: linux-2.6-debug-sizeof-structs.patch
 Patch260: linux-2.6-debug-nmi-timeout.patch
 Patch270: linux-2.6-debug-taint-vm.patch
 Patch280: linux-2.6-debug-spinlock-taint.patch
+Patch290: linux-2.6-debug-vm-would-have-oomkilled.patch
+Patch291: linux-2.6-debug-always-inline-kzalloc.patch
+
 Patch300: linux-2.6-driver-level-usb-autosuspend.diff
 Patch301: linux-2.6-fix-usb-serial-autosuspend.diff
 Patch302: linux-2.6-qcserial-autosuspend.diff
 Patch303: linux-2.6-bluetooth-autosuspend.diff
 Patch304: linux-2.6-usb-uvc-autosuspend.diff
-Patch340: linux-2.6-debug-vm-would-have-oomkilled.patch
-Patch360: linux-2.6-debug-always-inline-kzalloc.patch
+# disable message signaled interrupts
 Patch380: linux-2.6-defaults-pci_no_msi.patch
-Patch381: linux-2.6-pciehp-update.patch
-Patch382: linux-2.6-defaults-pciehp.patch
+# update the pciehp driver
+#Patch381: linux-2.6-pciehp-update.patch
+# default to enabling passively listening for hotplug events
+#Patch382: linux-2.6-defaults-pciehp.patch
+# enable ASPM by default on hardware we expect to work
 Patch383: linux-2.6-defaults-aspm.patch
 Patch390: linux-2.6-defaults-acpi-video.patch
 Patch391: linux-2.6-acpi-video-dos.patch
+# The input layer spews crap no-one cares about.
 Patch450: linux-2.6-input-kill-stupid-messages.patch
-Patch451: linux-2.6-input-fix-toshiba-hotkeys.patch
+# Get away from having to poll Toshibas
+#Patch451: linux-2.6-input-fix-toshiba-hotkeys.patch
 
+# Allow to use 480600 baud on 16C950 UARTs
 Patch460: linux-2.6-serial-460800.patch
 
+# Silence some useless messages that still get printed with 'quiet'
 Patch510: linux-2.6-silence-noise.patch
+# Make fbcon not show the penguins with 'quiet'
 Patch530: linux-2.6-silence-fbcon-logo.patch
-Patch570: linux-2.6-selinux-mprotect-checks.patch
-Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
+# Fix the SELinux mprotect checks on executable mappings
+#Patch570: linux-2.6-selinux-mprotect-checks.patch
+# Fix SELinux for sparc
+#Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
 
+# ALSA
+
+# squelch hda_beep by default
 Patch600: linux-2.6-defaults-alsa-hda-beep-off.patch
 Patch610: hda_intel-prealloc-4mb-dmabuffer.patch
 
+# ia64 ata quirk
 Patch670: linux-2.6-ata-quirk.patch
 
-Patch680: linux-2.6-rt2x00-asus-leds.patch
-Patch681: linux-2.6-mac80211-age-scan-results-on-resume.patch
+# rt2x00: back-port activity LED init patches
+#Patch680: linux-2.6-rt2x00-asus-leds.patch
+# back-port scan result aging patches
+#Patch681: linux-2.6-mac80211-age-scan-results-on-resume.patch
 
+# /dev/crash driver.
 Patch800: linux-2.6-crash-driver.patch
 
+# Determine cacheline sizes in a generic manner.
 Patch900: linux-2.6-pci-cacheline-sizing.patch
 
 Patch1000: linux-2.6-cpufreq-ppc-suspend-clusterfuck.patch
 
+# http://www.lirc.org/
 Patch1515: linux-2.6.31-lirc.patch
+# should be a short-lived patch, hopefully fixing bz#508952 w/o breaking anything else...
 Patch1516: lirc_streamzap-buffer-rework.patch
+# enable IR receiver on Hauppauge HD PVR (v4l-dvb merge pending)
 Patch1517: hdpvr-ir-enable.patch
 
 # nouveau + drm fixes
-Patch1813: drm-radeon-pm.patch
+# pm broken on my thinkpad t60p - airlied
+#Patch1813: drm-radeon-pm.patch
 Patch1814: drm-nouveau.patch
 Patch1818: drm-i915-resume-force-mode.patch
 Patch1819: drm-intel-big-hammer.patch
 Patch1820: drm-intel-gen3-fb-hack.patch
 
 # vga arb
-Patch1900: linux-2.6-vga-arb.patch
-Patch1901: drm-vga-arb.patch
+#Patch1900: linux-2.6-vga-arb.patch
+#Patch1901: drm-vga-arb.patch
 
 # kludge to make ich9 e1000 work
 Patch2000: linux-2.6-e1000-ich9.patch
 
 # linux1394 git patches
-Patch2200: linux-2.6-firewire-git-update.patch
-Patch2201: linux-2.6-firewire-git-pending.patch
+#Patch2200: linux-2.6-firewire-git-update.patch
+#Patch2201: linux-2.6-firewire-git-pending.patch
 
 # Quiet boot fixes
 # silence the ACPI blacklist code
 Patch2802: linux-2.6-silence-acpi-blacklist.patch
 
-Patch2899: linux-2.6-v4l-dvb-fixes.patch
-Patch2900: linux-2.6-v4l-dvb-update.patch
-Patch2901: linux-2.6-v4l-dvb-experimental.patch
-Patch2903: linux-2.6-revert-dvb-net-kabi-change.patch
+# V4L/DVB updates/fixes/experimental drivers
+#Patch2899: linux-2.6-v4l-dvb-fixes.patch
+#Patch2900: linux-2.6-v4l-dvb-update.patch
+#Patch2901: linux-2.6-v4l-dvb-experimental.patch
+#Patch2903: linux-2.6-revert-dvb-net-kabi-change.patch
 
 # fs fixes
 
@@ -902,38 +947,23 @@ if [ "%{patches}" != "%%{patches}" ] ; t
   done
 fi 2>/dev/null
 
-patch_command='patch -p1 -F1 -s'
-ApplyPatch()
+Cat()
 {
-  local patch=$1
-  shift
-  if [ ! -f $RPM_SOURCE_DIR/$patch ]; then
-    exit 1
-  fi
-  if ! egrep "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME%%%%%{?variant}}.spec ; then
-    if [ "${patch:0:10}" != "patch-2.6." ] ; then
-      echo "ERROR: Patch  $patch  not listed as a source patch in specfile"
-      exit 1
-    fi
-  fi 2>/dev/null
-  case "$patch" in
-  *.bz2) bunzip2 < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
-  *.gz) gunzip < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
-  *) $patch_command ${1+"$@"} < "$RPM_SOURCE_DIR/$patch" ;;
+  case "$1" in
+  *.bz2) bunzip2 -c < "$1" ;;
+  *.gz) gunzip -c < "$1" ;;
+  *) cat "$1" 2> /dev/null ;;
   esac
 }
 
-# don't apply patch if it's empty
-ApplyOptionalPatch()
+patch_command='patch -p1 -F1 -s'
+ApplyPatch()
 {
-  local patch=$1
+  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+"$@"}
+  # not a useless use of cat
+  if [ `Cat "$patch" | diffstat -l | wc -l` -gt 0 ]; then
+    Cat "$patch" | $patch_command ${1+"$@"}
   fi
 }
 
@@ -1013,14 +1043,14 @@ if [ ! -d kernel-%{kversion}/vanilla-%{v
 # Update vanilla to the latest upstream.
 # (non-released_kernel case only)
 %if 0%{?rcrev}
-    ApplyPatch patch-2.6.%{upstream_sublevel}-rc%{rcrev}.bz2
+    ApplyPatch %{SOURCE1000}
 %if 0%{?gitrev}
-    ApplyPatch patch-2.6.%{upstream_sublevel}-rc%{rcrev}-git%{gitrev}.bz2
+    ApplyPatch %{SOURCE1001}
 %endif
 %else
 # pre-{base_sublevel+1}-rc1 case
 %if 0%{?gitrev}
-    ApplyPatch patch-2.6.%{base_sublevel}-git%{gitrev}.bz2
+    ApplyPatch %{SOURCE1000}
 %endif
 %endif
 
@@ -1049,10 +1079,10 @@ cd linux-%{kversion}.%{_target_cpu}
 
 # released_kernel with possible stable updates
 %if 0%{?stable_base}
-ApplyPatch %{stable_patch_00}
+ApplyPatch %{SOURCE1000}
 %endif
 %if 0%{?stable_rc}
-ApplyPatch %{stable_patch_01}
+ApplyPatch %{SOURCE1001}
 %endif
 
 %if %{using_upstream_branch}
@@ -1076,201 +1106,10 @@ make -f %{SOURCE20} VERSION=%{version} c
   done
 %endif
 
-#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
-# builds (as used in the buildsystem).
-ApplyPatch linux-2.6-build-nonintconfig.patch
-
-ApplyPatch linux-2.6-makefile-after_link.patch
-
-#
-# misc small stuff to make things compile
-#
-ApplyOptionalPatch linux-2.6-compile-fixes.patch
-
-%if !%{nopatches}
-
-# revert patches from upstream that conflict or that we get via other means
-ApplyOptionalPatch linux-2.6-upstream-reverts.patch -R
-
-#ApplyPatch git-cpufreq.patch
-#ApplyPatch git-bluetooth.patch
-
-ApplyPatch linux-2.6-hotfixes.patch
-
-# Roland's utrace ptrace replacement.
-ApplyPatch linux-2.6-tracehook.patch
-ApplyPatch linux-2.6-utrace.patch
-
-ApplyPatch sched-introduce-SCHED_RESET_ON_FORK-scheduling-policy-flag.patch
-
-# enable sysrq-c on all kernels, not only kexec
-#ApplyPatch linux-2.6-sysrq-c.patch
-
-# Architecture patches
-# x86(-64)
-ApplyPatch via-hwmon-temp-sensor.patch
-
-#
-# PowerPC
-#
-### NOT (YET) UPSTREAM:
-# The storage alias patch is Fedora-local, and allows the old 'ps3_storage'
-# module name to work on upgrades. Otherwise, I believe mkinitrd will fail
-# to pull the module in,
-ApplyPatch linux-2.6-ps3-storage-alias.patch
-# Alleviate G5 thermal shutdown problems
-ApplyPatch linux-2.6-g5-therm-shutdown.patch
-# Provide modalias in sysfs for vio devices
-ApplyPatch linux-2.6-vio-modalias.patch
-# Work around PCIe bridge setup on iSight
-ApplyPatch linux-2.6-imac-transparent-bridge.patch
-
-#
-# SPARC64
-#
-ApplyPatch linux-2.6.29-sparc-IOC_TYPECHECK.patch
-
-#
-# Exec shield
-#
-ApplyPatch linux-2.6-execshield.patch
-
-#
-# bugfixes to drivers and filesystems
-#
-
-# ext4
-
-# xfs
-
-# btrfs
-
-# NFSv4
-ApplyPatch linux-2.6-nfsd4-proots.patch
-
-# USB
-ApplyPatch linux-2.6-driver-level-usb-autosuspend.diff
-ApplyPatch linux-2.6-fix-usb-serial-autosuspend.diff
-ApplyPatch linux-2.6-qcserial-autosuspend.diff
-ApplyPatch linux-2.6-bluetooth-autosuspend.diff
-ApplyPatch linux-2.6-usb-uvc-autosuspend.diff
-
-# ACPI
-ApplyPatch linux-2.6-defaults-acpi-video.patch
-ApplyPatch linux-2.6-acpi-video-dos.patch
-
-# Various low-impact patches to aid debugging.
-ApplyPatch linux-2.6-debug-sizeof-structs.patch
-ApplyPatch linux-2.6-debug-nmi-timeout.patch
-ApplyPatch linux-2.6-debug-taint-vm.patch
-ApplyPatch linux-2.6-debug-spinlock-taint.patch
-ApplyPatch linux-2.6-debug-vm-would-have-oomkilled.patch
-ApplyPatch linux-2.6-debug-always-inline-kzalloc.patch
-
-#
-# PCI
-#
-# disable message signaled interrupts
-ApplyPatch linux-2.6-defaults-pci_no_msi.patch
-# update the pciehp driver
-#ApplyPatch linux-2.6-pciehp-update.patch
-# default to enabling passively listening for hotplug events
-#ApplyPatch linux-2.6-defaults-pciehp.patch
-# enable ASPM by default on hardware we expect to work
-ApplyPatch linux-2.6-defaults-aspm.patch
-
-#
-# SCSI Bits.
-#
-
-# ALSA
-# squelch hda_beep by default
-ApplyPatch linux-2.6-defaults-alsa-hda-beep-off.patch
-ApplyPatch hda_intel-prealloc-4mb-dmabuffer.patch
-
-# Networking
-
-# Misc fixes
-# The input layer spews crap no-one cares about.
-ApplyPatch linux-2.6-input-kill-stupid-messages.patch
-
-# Get away from having to poll Toshibas
-#ApplyPatch linux-2.6-input-fix-toshiba-hotkeys.patch
-
-# Allow to use 480600 baud on 16C950 UARTs
-ApplyPatch linux-2.6-serial-460800.patch
-
-# Silence some useless messages that still get printed with 'quiet'
-ApplyPatch linux-2.6-silence-noise.patch
-
-# Make fbcon not show the penguins with 'quiet'
-ApplyPatch linux-2.6-silence-fbcon-logo.patch
-
-# Fix the SELinux mprotect checks on executable mappings
-#ApplyPatch linux-2.6-selinux-mprotect-checks.patch
-# Fix SELinux for sparc
-#ApplyPatch linux-2.6-sparc-selinux-mprotect-checks.patch
-
-# Changes to upstream defaults.
-
-
-# ia64 ata quirk
-ApplyPatch linux-2.6-ata-quirk.patch
-
-# rt2x00: back-port activity LED init patches
-#ApplyPatch linux-2.6-rt2x00-asus-leds.patch
-
-# back-port scan result aging patches
-#ApplyPatch linux-2.6-mac80211-age-scan-results-on-resume.patch
-
-# /dev/crash driver.
-ApplyPatch linux-2.6-crash-driver.patch
-
-# Determine cacheline sizes in a generic manner.
-ApplyPatch linux-2.6-pci-cacheline-sizing.patch
-
-ApplyPatch linux-2.6-cpufreq-ppc-suspend-clusterfuck.patch
-
-# http://www.lirc.org/
-ApplyPatch linux-2.6.31-lirc.patch
-# should be a short-lived patch, hopefully fixing bz#508952 w/o breaking anything else...
-ApplyPatch lirc_streamzap-buffer-rework.patch
-# enable IR receiver on Hauppauge HD PVR (v4l-dvb merge pending)
-ApplyPatch hdpvr-ir-enable.patch
-
-ApplyPatch linux-2.6-e1000-ich9.patch
-
-# Nouveau DRM + drm fixes
-ApplyPatch drm-nouveau.patch
-# pm broken on my thinkpad t60p - airlied
-#ApplyPatch drm-radeon-pm.patch
-ApplyPatch drm-i915-resume-force-mode.patch
-ApplyPatch drm-intel-big-hammer.patch
-ApplyPatch drm-intel-gen3-fb-hack.patch
-
-# VGA arb + drm
-#ApplyPatch linux-2.6-vga-arb.patch
-#ApplyPatch drm-vga-arb.patch
-
-# linux1394 git patches
-#ApplyPatch linux-2.6-firewire-git-update.patch
-#ApplyOptionalPatch linux-2.6-firewire-git-pending.patch
-
-# silence the ACPI blacklist code
-ApplyPatch linux-2.6-silence-acpi-blacklist.patch
-
-# V4L/DVB updates/fixes/experimental drivers
-#ApplyPatch linux-2.6-v4l-dvb-fixes.patch
-#ApplyPatch linux-2.6-v4l-dvb-update.patch
-#ApplyPatch linux-2.6-v4l-dvb-experimental.patch
-#ApplyPatch linux-2.6-revert-dvb-net-kabi-change.patch
-
-# END OF PATCH APPLICATIONS
-
-%endif
+# and now, all the patches...
+for i in %{patches} ; do
+    ApplyPatch "$i"
+done
 
 # Any further pre-build tree manipulations happen here.
 
@@ -1887,6 +1726,9 @@ fi
 
 %changelog
 * Mon Jul 20 2009 Adam Jackson <ajax@redhat.com>
+- Use %%{patches} instead of a bajillion ApplyPatch lines
+
+* Mon Jul 20 2009 Adam Jackson <ajax@redhat.com>
 - Disable VGA arbiter patches for a moment
 
 * Mon Jul 20 2009 Adam Jackson <ajax@redhat.com>
