r1372 - in branches: . exp-patch-system/debian exp-patch-system/debian/patches exp-patch-system/debian/patches/series

Joshua Kwan joshk@haydn.debian.org
Sat, 28 Aug 2004 20:39:01 -0600


Author: joshk
Date: 2004-08-27 03:52:45 -0600 (Fri, 27 Aug 2004)
New Revision: 1372

Added:
   branches/exp-patch-system/
   branches/exp-patch-system/debian/compat
   branches/exp-patch-system/debian/patches/series/
   branches/exp-patch-system/debian/patches/series/2.6.8-1
   branches/exp-patch-system/debian/patches/series/2.6.8-2
   branches/exp-patch-system/debian/patches/series/2.6.8-3
   branches/exp-patch-system/debian/patches/series/2.6.8-4
   branches/exp-patch-system/debian/patches/series/2.6.8-5
Removed:
   branches/exp-patch-system/debian/make-kernel-patch-pkgs
   branches/exp-patch-system/debian/patches/00list-1
   branches/exp-patch-system/debian/patches/00list-2
   branches/exp-patch-system/debian/patches/00list-3
   branches/exp-patch-system/debian/patches/00list-4
   branches/exp-patch-system/debian/patches/00list-5
Modified:
   branches/exp-patch-system/debian/apply
   branches/exp-patch-system/debian/make-substvars
   branches/exp-patch-system/debian/rules
   branches/exp-patch-system/debian/unpatch
Log:
branch


Copied: branches/exp-patch-system (from rev 1371, trunk/kernel/source/kernel-source-2.6.8-2.6.8)

Modified: branches/exp-patch-system/debian/apply
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/apply	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/apply	2004-08-27 09:52:45 UTC (rev 1372)
@@ -1,34 +1,183 @@
-#!/bin/sh
-# $Id: apply,v 1.1 2003/12/21 05:37:17 herbert Exp $
+#!/bin/sh 
+# $Id: apply,v 1.4 2003/06/30 12:49:09 herbert Exp $
 
 set -e
 
+die() {
+	echo "E: $@" >&2
+	exit 1
+}
+
+warn() {
+	echo "W: $@" >&2
+}
+
+uncompress_patch() {
+	patch=$1
+	case "$patch" in
+		*.bz2) bzcat $patch ;;
+		*.gz) zcat $patch ;;
+		*) cat $patch ;;
+	esac
+}
+
+find_patch() {
+	patch=$1
+
+	if [ -f "$patch" ]; then
+		echo "$patch"
+	elif [ -f "$patch.bz2" ]; then
+		echo "$patch.bz2"
+	elif [ -f "$patch.gz" ]; then
+		echo "$patch.gz"
+	else
+		die "$patch is in the series, but doesn't exist!"
+	fi
+}
+		
+apply_patch() {
+	patch=$(find_patch $home/$1)
+	base=$1
+	if uncompress_patch "$patch" | patch -p1 -s -t --no-backup-if-mismatch; then
+		printf "%-32s\tOK (+)\n" "$base"
+	else
+		printf "%-32s\tFAIL (+)\n" "$base"
+		exit 1
+	fi
+}
+
+deapply_patch() {
+	patch=$(find_patch $home/$1)
+	base=$1
+	if uncompress_patch "$patch" | patch -p1 -s -t -R --no-backup-if-mismatch; then
+		printf "%-32s\tOK (-)\n" "$base"
+	else
+		printf "%-32s\tFAIL (-)\n" "$base"
+		exit 1
+	fi
+}
+
+unpatch_series() {
+	series=$1
+	[ -f "$series" ] || die "I wasn't passed a series!"
+
+	tac $series | while read action patch; do
+		case "$action" in
+			+) deapply_patch $patch ;;
+			-) apply_patch $patch ;;
+		esac
+	done 
+	echo "--> $(basename $series) fully unapplied."
+}
+
+patch_series() {
+	series=$1
+	[ -f "$series" ] || die "I wasn't passed a series!"
+
+	while read action patch; do
+		case "$action" in
+			+) apply_patch $patch ;;
+			-) deapply_patch $patch ;;
+		esac
+	done < $series
+	echo "--> $(basename $series) fully applied."
+}
+
 if ! [ -d Documentation ] || ! [ -d kernel ]; then
-	echo 'Not in kernel top level directory.  Exiting' >&2
+	die 'Not in kernel top level directory.  Exiting'
 	exit 1
 fi
 
-version=@version@
+# for THIS particular version of the source package
+version=${override_version:-@version@}
 upstream=${version%-*}
-home=/usr/src/kernel-patches/all/$upstream/debian
+revision=${version#*-}
 
+home=${home:-/usr/src/kernel-patches/all/$upstream/debian}
+
 if [ -f version.Debian ]; then
 	current=$(cat version.Debian)
+	current_rev=${current#*-}
+	current_up=${current%-*}
+
+	if [ "$current" = "$upstream" ]; then
+		current_rev=0
+	fi
 else
-	echo "No version.Debian file, assuming pristine Linux $upstream" >&2
+	warn "No version.Debian file, assuming pristine Linux $upstream"
 	current=$upstream
+	current_rev=0
 fi
 
-intended=${1:-$version}
+target=${1:-$version}
 
-patches=$($home/list-patches $current $intended $home/list)
-reverse=-R
-for i in $patches; do
-	if [ $i = / ]; then
-		reverse=
-		continue
+target_rev=${target#*-}
+target_up=${target%-*}
+
+# Sanity checks
+if [ "$target_up" != "$upstream" ]; then
+	die "Upstream $target_up doesn't match $upstream!"
+# We don't have that version out yet!
+elif [ ! -n "$target_rev" ] || ( [ "$target_rev" != "$target" ] && [ $target_rev -gt $revision ] ); then
+	year=$(($(date +%Y) + 1))
+	die "Can't patch to nonexistent revision $target_rev (wait until $year)"
+fi
+
+# At this point, we must handle three cases.
+# 1. $target_rev is greater than $current_rev. We must patch forward for this.
+# 2. $target_rev is less than $current_rev. We must reverse the list of series,
+#    reverse each used series (tac) and unapply applied patches and vice versa.
+# 3. $target_rev is undefined, and $target is $upstream.
+
+# Revert to upstream.
+if [ "$target_rev" = "$target" ]; then
+	# already reverted
+	if [ "$current" = "$target" ]; then 
+		echo "Nothing to do, exiting."
+		exit 0
 	fi
-	bzcat $home/$i.bz2 | patch -s -p1 $reverse
-done
 
-echo $intended > version.Debian
+	for sver in $(ls -d $home/series/* | sort -r); do
+		base=$(basename "$sver")
+		srev=${base#*-}
+		if [ -n "$srev" ]; then
+			if [ $srev -le $current_rev ]; then
+				unpatch_series $sver
+			fi
+		else
+			die "Series doesn't have a revision!"
+		fi
+	done
+elif [ "$current_rev" = "$upstream" ] || [ $target_rev -gt $current_rev ]; then
+	for sver in $home/series/*; do
+		base=$(basename "$sver")
+		srev=${base#*-}
+		if [ -n "$srev" ]; then
+			if [ $srev -gt $current_rev ]; then
+				patch_series $sver
+			fi
+		else
+			die "Series doesn't have a revision!"
+		fi
+	done
+elif [ $target_rev -eq $current_rev ]; then
+	echo "Nothing to do, exiting."
+	exit 0
+elif [ $target_rev -lt $current_rev ]; then
+	for sver in $(ls -d $home/series/* | sort -r); do
+		base=$(basename "$sver")
+		srev=${base#*-}
+		if [ -n "$srev" ]; then
+			# -gt because you don't want to unapply the target series
+			if [ $srev -le $current_rev ] && [ $srev -gt $target_rev ]; then
+				unpatch_series $sver
+			fi
+		else
+			die "Series doesn't have a revision!"
+		fi
+	done
+fi
+
+echo $target > version.Debian
+
+# vim:noet:ai:ts=4

Added: branches/exp-patch-system/debian/compat
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/compat	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/compat	2004-08-27 09:52:45 UTC (rev 1372)
@@ -0,0 +1 @@
+4

Deleted: branches/exp-patch-system/debian/make-kernel-patch-pkgs
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/make-kernel-patch-pkgs	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/make-kernel-patch-pkgs	2004-08-27 09:52:45 UTC (rev 1372)
@@ -1,39 +0,0 @@
-#!/bin/sh
-# $Id: make-kernel-patch-pkgs,v 1.1 2003/12/21 05:37:17 herbert Exp $
-
-set -e
-
-top=$PWD
-version=$(cat version.Debian)
-upstream=${version%-*}
-kp=kernel-patch-debian-$upstream
-kt=kernel-tree-$upstream
-pkgs="--package=$kp --package=$kt"
-kphome=$top/debian/$kp/usr/src/kernel-patches/all/$upstream
-
-mkdir -p $kphome/apply $kphome/debian $kphome/unpatch
-
-cd debian/monolith
-awk '!/^#/ && NF > 0 {print $1}' list |
-	xargs cp --target-directory=$kphome/debian
-bzip2 -9 $kphome/debian/*
-cp list $kphome/debian
-
-cd ..
-install list-patches $kphome/debian
-sed "s/@version@/$version/g" apply > $kphome/apply/debian
-sed "s/@version@/$version/g" unpatch > $kphome/unpatch/debian
-chmod 755 \
-	$kphome/apply/debian \
-	$kphome/unpatch/debian
-
-cd ..
-dh_installdocs $pkgs
-dh_installchangelogs --package=$kp
-dh_installchangelogs --package=$kt debian/ChangeLog-$upstream
-dh_compress $pkgs
-dh_fixperms $pkgs
-dh_installdeb $pkgs
-dh_gencontrol $pkgs -- -Tdebian/substvars
-dh_md5sums $pkgs
-dh_builddeb $pkgs

Modified: branches/exp-patch-system/debian/make-substvars
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/make-substvars	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/make-substvars	2004-08-27 09:52:45 UTC (rev 1372)
@@ -1,43 +1,20 @@
-#!/usr/bin/awk -f
-# $Id: make-substvars,v 1.1 2003/12/21 05:37:17 herbert Exp $
+#!/bin/sh
 
-BEGIN {
-	version_file = ARGV[1]
-	delete ARGV[1]
-	getline < version_file
-	version = $0
-	upstream = version
-	sub(/-[^-]*$/, "", upstream)
-}
+upstream=$1
 
-/^#/ || NF < 1 {
-	next
-}
+ktdepends="kt-depends="
+ktprovides="kt-provides="
 
-NF != 3 {
-	print "Line " NR ": incorrect number of fields" > "/dev/stderr"
-	exit 1
-}
+for series in debian/patches/series/*; do
+	base=$(basename $series)
+	ktdepends="${ktdepends}kernel-source-$upstream (= $base) | "
+	ktprovides="${ktprovides}kernel-tree-$base, "
+done
 
-$2 != upstream && !($2 in prev) {
-	print "Line " NR ": patch " $1 " is not well-founded" > "/dev/stderr"
-	exit 1
-}
+ktprovides=${ktprovides%, }
+ktdepends=${ktdepends%| }
 
-{
-	prev[$3] = $2
-}
+echo $ktdepends
+echo $ktprovides
 
-END {
-	if (!(version in prev)) {
-		print "Patch for " version " must be listed" > "/dev/stderr"
-		exit 1
-	}
-
-	for (v in prev) {
-		dep = dep " | kernel-source-" upstream " (= " v ")"
-		prov = prov ", kernel-tree-" v
-	}
-	print "kt-depends=" substr(dep, 4)
-	print "kt-provides=" substr(prov, 3)
-}
+# vim:ts=4:noet:ai

Deleted: branches/exp-patch-system/debian/patches/00list-1
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-1	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/00list-1	2004-08-27 09:52:45 UTC (rev 1372)
@@ -1,30 +0,0 @@
-alpha-epoch-comment
-alpha-termbits
-doc-post_halloween
-drivers-ftape
-drivers-ide-dma-blacklist-toshiba
-drivers-input-hiddev-HIDIOCGUCODE
-drivers-input-psaux-hacks
-drivers-net-8139too-locking
-drivers-net-tg3-readd
-drivers-scsi_changer
-drivers-scsi-generic_proc_info
-extraversion
-fs-asfs
-include-missing-includes
-ipsec-missing_wakeup
-modular-ide
-modular-ide-pnp
-modular-vesafb
-remove-references-to-removed-drivers
-x86-i486_emu
-marvell-mm
-marvell-pegasos
-powerpc-pegasos
-nfs-fix
-SG_IO-cap
-ia64-generic-no-smp
-ptmx-fix
-powerpc-ibm-240-e30
-xfs-ioctl32
-drivers-scsi-sym53c8xx_revert

Deleted: branches/exp-patch-system/debian/patches/00list-2
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-2	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/00list-2	2004-08-27 09:52:45 UTC (rev 1372)
@@ -1,34 +0,0 @@
-alpha-epoch-comment
-alpha-termbits
-doc-post_halloween
-drivers-ftape
-drivers-ide-dma-blacklist-toshiba
-drivers-input-hiddev-HIDIOCGUCODE
-drivers-input-psaux-hacks
-drivers-net-8139too-locking
-drivers-net-tg3-readd
-drivers-scsi_changer
-drivers-scsi-generic_proc_info
-extraversion
-fs-asfs
-include-missing-includes
-ipsec-missing_wakeup
-modular-ide
-modular-ide-pnp
-modular-vesafb
-remove-references-to-removed-drivers
-x86-i486_emu
-marvell-mm
-marvell-pegasos-2
-powerpc-pegasos
-powerpc-g4-l2-flush-errata
-nfs-fix
-SG_IO-cap
-ia64-generic-no-smp
-ptmx-fix
-powerpc-ibm-240-e30
-xfs-ioctl32
-drivers-scsi-sym53c8xx_revert
-ia64-generic-no-smp-1-to-2
-ia64_cyclone_nosmp
-fix-sn_console-for-config_smp

Deleted: branches/exp-patch-system/debian/patches/00list-3
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-3	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/00list-3	2004-08-27 09:52:45 UTC (rev 1372)
@@ -1,46 +0,0 @@
-alpha-epoch-comment
-alpha-termbits
-doc-post_halloween
-drivers-ftape
-drivers-ide-dma-blacklist-toshiba
-drivers-input-hiddev-HIDIOCGUCODE
-drivers-input-psaux-hacks
-drivers-net-8139too-locking
-drivers-net-tg3-readd
-drivers-scsi_changer
-drivers-scsi-generic_proc_info
-extraversion
-fs-asfs
-include-missing-includes
-ipsec-missing_wakeup
-modular-ide
-modular-ide-pnp
-modular-vesafb
-remove-references-to-removed-drivers
-x86-i486_emu
-marvell-mm
-marvell-pegasos-2
-powerpc-pegasos
-powerpc-g4-l2-flush-errata
-nfs-fix
-SG_IO-safe-commands
-ia64-generic-no-smp
-ptmx-fix
-powerpc-ibm-240-e30
-xfs-ioctl32
-ia64-generic-no-smp-1-to-2
-ia64_cyclone_nosmp
-fix-sn_console-for-config_smp
-bio_uncopy_user-memleak-2
-scsi-blacklist
-acpi-osname
-acpi-early
-acpi-speedstep-fix
-pmac-no-of-stdout
-net-sched-fix
-drivers-scsi-sym_2-dv-hang
-cciss-update
-minix-block-accounting-fix
-nfsd-subtreecheck-nostale
-shm-segment-count-fix
-modular-xfrm_tunnel

Deleted: branches/exp-patch-system/debian/patches/00list-4
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-4	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/00list-4	2004-08-27 09:52:45 UTC (rev 1372)
@@ -1,49 +0,0 @@
-alpha-epoch-comment
-alpha-termbits
-doc-post_halloween
-drivers-ftape
-drivers-ide-dma-blacklist-toshiba
-drivers-input-hiddev-HIDIOCGUCODE
-drivers-input-psaux-hacks
-drivers-macintosh-adb-trackpad
-drivers-net-8139too-locking
-drivers-net-tg3-readd
-drivers-scsi_changer
-drivers-scsi-generic_proc_info
-extraversion
-fs-asfs
-include-missing-includes
-ipsec-missing_wakeup
-modular-ide
-modular-ide-pnp
-modular-vesafb
-remove-references-to-removed-drivers
-x86-i486_emu
-marvell-mm
-marvell-pegasos-2
-powerpc-pegasos
-powerpc-g4-l2-flush-errata
-powerpc-g4-errata
-nfs-fix
-SG_IO-safe-commands-2
-ia64-generic-no-smp
-ptmx-fix
-powerpc-ibm-240-e30
-xfs-ioctl32
-ia64-generic-no-smp-1-to-2
-ia64_cyclone_nosmp
-fix-sn_console-for-config_smp
-bio_uncopy_user-memleak-2
-scsi-blacklist
-acpi-osname
-acpi-early
-acpi-speedstep-fix
-pmac-no-of-stdout
-net-sched-fix
-drivers-scsi-sym_2-dv-hang
-cciss-update
-minix-block-accounting-fix
-nfsd-subtreecheck-nostale
-shm-segment-count-fix
-modular-xfrm_tunnel
-sparc64-update

Deleted: branches/exp-patch-system/debian/patches/00list-5
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-5	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/00list-5	2004-08-27 09:52:45 UTC (rev 1372)
@@ -1,53 +0,0 @@
-alpha-epoch-comment
-alpha-termbits
-doc-post_halloween
-drivers-ftape
-drivers-ide-dma-blacklist-toshiba
-drivers-input-hiddev-HIDIOCGUCODE
-drivers-input-psaux-hacks
-drivers-macintosh-adb-trackpad
-drivers-net-8139too-locking
-drivers-net-tg3-readd
-drivers-scsi_changer
-drivers-scsi-generic_proc_info
-extraversion
-fs-asfs
-include-missing-includes
-ipsec-missing_wakeup
-modular-ide
-modular-ide-pnp
-modular-vesafb
-remove-references-to-removed-drivers
-x86-i486_emu
-marvell-mm
-marvell-pegasos-2
-powerpc-pegasos
-powerpc-g4-l2-flush-errata
-powerpc-g4-errata
-nfs-fix
-SG_IO-safe-commands-2
-ia64-generic-no-smp
-ptmx-fix
-powerpc-ibm-240-e30
-xfs-ioctl32
-ia64-generic-no-smp-1-to-2
-ia64_cyclone_nosmp
-fix-sn_console-for-config_smp
-bio_uncopy_user-memleak-2
-scsi-blacklist
-acpi-osname
-acpi-early
-acpi-speedstep-fix
-pmac-no-of-stdout
-net-sched-fix
-drivers-scsi-sym_2-dv-hang
-cciss-update
-minix-block-accounting-fix
-nfsd-subtreecheck-nostale
-shm-segment-count-fix
-modular-xfrm_tunnel
-sparc64-update
-sparc64-sunsab-skip-fix
-sparc64-syslog-register
-sparc32-export-more-ksyms
-scsi-disambiguate-proc_name

Copied: branches/exp-patch-system/debian/patches/series/2.6.8-1 (from rev 1371, trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-1)
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/00list-1	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/series/2.6.8-1	2004-08-27 09:52:45 UTC (rev 1372)
@@ -0,0 +1,30 @@
++ alpha-epoch-comment.dpatch
++ alpha-termbits.dpatch
++ doc-post_halloween.dpatch
++ drivers-ftape.dpatch
++ drivers-ide-dma-blacklist-toshiba.dpatch
++ drivers-input-hiddev-HIDIOCGUCODE.dpatch
++ drivers-input-psaux-hacks.dpatch
++ drivers-net-8139too-locking.dpatch
++ drivers-net-tg3-readd.dpatch
++ drivers-scsi_changer.dpatch
++ drivers-scsi-generic_proc_info.dpatch
++ extraversion.dpatch
++ fs-asfs.dpatch
++ include-missing-includes.dpatch
++ ipsec-missing_wakeup.dpatch
++ modular-ide.dpatch
++ modular-ide-pnp.dpatch
++ modular-vesafb.dpatch
++ remove-references-to-removed-drivers.dpatch
++ x86-i486_emu.dpatch
++ marvell-mm.dpatch
++ marvell-pegasos.dpatch
++ powerpc-pegasos.dpatch
++ nfs-fix.dpatch
++ SG_IO-cap.dpatch
++ ia64-generic-no-smp.dpatch
++ ptmx-fix.dpatch
++ powerpc-ibm-240-e30.dpatch
++ xfs-ioctl32.dpatch
++ drivers-scsi-sym53c8xx_revert.dpatch

Added: branches/exp-patch-system/debian/patches/series/2.6.8-2
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-2	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/series/2.6.8-2	2004-08-27 09:52:45 UTC (rev 1372)
@@ -0,0 +1,6 @@
+- marvell-pegasos.dpatch
++ marvell-pegasos-2.dpatch
++ powerpc-g4-l2-flush-errata.dpatch
++ ia64-generic-no-smp-1-to-2.dpatch
++ ia64_cyclone_nosmp.dpatch
++ fix-sn_console-for-config_smp.dpatch

Added: branches/exp-patch-system/debian/patches/series/2.6.8-3
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-3	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/series/2.6.8-3	2004-08-27 09:52:45 UTC (rev 1372)
@@ -0,0 +1,16 @@
+- SG_IO-cap.dpatch
++ SG_IO-safe-commands.dpatch
+- drivers-scsi-sym53c8xx_revert.dpatch
++ bio_uncopy_user-memleak-2.dpatch
++ scsi-blacklist.dpatch
++ acpi-osname.dpatch
++ acpi-early.dpatch
++ acpi-speedstep-fix.dpatch
++ pmac-no-of-stdout.dpatch
++ net-sched-fix.dpatch
++ drivers-scsi-sym_2-dv-hang.dpatch
++ cciss-update.dpatch
++ minix-block-accounting-fix.dpatch
++ nfsd-subtreecheck-nostale.dpatch
++ shm-segment-count-fix.dpatch
++ modular-xfrm_tunnel.dpatch

Added: branches/exp-patch-system/debian/patches/series/2.6.8-4
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-4	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/series/2.6.8-4	2004-08-27 09:52:45 UTC (rev 1372)
@@ -0,0 +1,5 @@
++ drivers-macintosh-adb-trackpad.dpatch
++ powerpc-g4-errata.dpatch
+- SG_IO-safe-commands.dpatch
++ SG_IO-safe-commands-2.dpatch
++ sparc64-update.dpatch

Added: branches/exp-patch-system/debian/patches/series/2.6.8-5
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-5	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/patches/series/2.6.8-5	2004-08-27 09:52:45 UTC (rev 1372)
@@ -0,0 +1,4 @@
++ sparc64-sunsab-fix.dpatch
++ sparc64-syslog-register.dpatch
++ sparc32-export-more-ksyms.dpatch
++ scsi-disambiguate-proc_name.dpatch

Modified: branches/exp-patch-system/debian/rules
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/rules	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/rules	2004-08-27 09:52:45 UTC (rev 1372)
@@ -7,118 +7,41 @@
 # Copyright (c) 2004 Jens Schmalzing <jensen@debian.org>
 #
 
-# This is the debhelper compatability version to use.
-export DH_COMPAT=3
+release := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }')
+upstream := $(shell echo "$(release)" | sed 's/:\?\([0-9\.]\+\)-[0-9]*/\1/')
+patch_home := debian/kernel-patch-debian-$(upstream)/usr/src/kernel-patches/all/$(upstream)
 
-# extract the upstream release and the full package version from the changelog
-release	:= $(shell sed -n '1s/^.*(\(.*\)-.*).*$$/\1/p' debian/changelog)
-version	:= $(shell sed -n '1s/^.*(\(.*\)).*$$/\1/p' debian/changelog)
+# Little things that help you...
+patch:
+	override_version=$(release) home=debian/patches sh debian/apply
 
-# extract all the Debian revisions for this release from the changelog
-revisions := $(shell sed -n 's/^kernel-source-$(release)\ .*(.*-\(.*\)).*$$/\1/p' debian/changelog | tac)
+unpatch:
+	override_version=$(release) home=debian/patches sh debian/apply $(upstream)
 
-# set the current Debian revision to the latest by default;
-# note that for some targets, the two may actually be different.
-revision ?= $(word $(words $(revisions)),$(revisions))
 
-version.Debian: debian/changelog
-	sed 's/^[^ ]* (\([^)]*\)).*/\1/; q' $< > $@
-
 #####################
-# The following targets create the monolithic patches for all revisions.
-# 
-# They create a copy of the current unpatched directory, then for each
-# revision apply the appropriate split patches through dpatch and diff
-# the result against the previous revision.  Finally, they clean up the
-# intermediate directories.
-
-# how we call ourselves recursively
-RECURSION = $(MAKE) -f debian/rules
-
-# where to put the monolithic patches
-MONODIR = debian/monolith
-
-# where to put the list of monolithic patches
-PATCHLIST = $(MONODIR)/list
-
-# where to find the patch lists for dpatch
-DPATCHLIST = debian/patches/00list
-
-# where to put the intermediate directory trees; use a tmpfs for maximum efficiency
-DIFFDIR ?= $(CURDIR)/debian/diffdir
-
-# the name of the package
-PACKAGE = $(notdir $(CURDIR))
-
-.PHONY:		monolith
-monolith:	stamp-monolith
-stamp-monolith:	stamp-monolith-prepare \
-	$(foreach revision,$(revisions),stamp-monolith-$(revision))
-	rm -rf $(DIFFDIR)
-
-stamp-monolith-prepare:
-
-	if test -f $(DPATCHLIST); then dpatch unpatch-all; rm -f $(DPATCHLIST); fi
-
-	rm -rf $(MONODIR); mkdir -p $(MONODIR)
-
-	rm -rf $(DIFFDIR)/$(PACKAGE).orig
-	find . -path ./debian -prune -o -print | cpio -dump $(DIFFDIR)/$(PACKAGE).orig
-
-	touch $@
-
-stamp-monolith-%:
-	$(RECURSION) $(MONODIR)/patch-$(release)-$* revision=$*
-	touch $@
-
-# for the first revision, we diff against the original
-ifeq ($(revision),$(firstword $(revisions)))
-PREVPACKAGE = $(PACKAGE).orig
-prevrelease = $(release)
-else
-prerevision = $(shell echo $(revisions) | awk '{ for (i=2;i<=NF;i++) if ($$i == "$(revision)") print $$(i-1) }')
-PREVPACKAGE = $(PACKAGE)-$(prerevision)
-prevrelease = $(release)-$(prerevision)
-endif
-
-$(MONODIR)/patch-$(release)-$(revision):
-
-	dpatch unpatch-all
-	cp -p $(DPATCHLIST)-$(revision) $(DPATCHLIST)
-	dpatch patch-all
-
-	rm -rf $(DIFFDIR)/$(PACKAGE)-$(revision)
-	find . -path ./debian -prune -o -print | cpio -dump $(DIFFDIR)/$(PACKAGE)-$(revision)
-
-	( cd $(DIFFDIR); diff -Nur $(PREVPACKAGE) $(PACKAGE)-$(revision) || true ) > $@
-	echo $(notdir $@) $(prevrelease) $(release)-$(revision) >> $(PATCHLIST)
-
-
-#####################
 # Below comes Herbert's stuff with minimal additions
 
-debian/substvars.safe: $(PATCHLIST) version.Debian debian/make-substvars
-	chmod u+x debian/make-substvars
-	debian/make-substvars version.Debian $(PATCHLIST) > $@
+build:
+# Ye olde no-op.
 
-build: monolith stamp-build
-stamp-build: version.Debian debian/substvars.safe debian/make-kernel-patch-pkgs
-	dh_testdir
-
-	touch $@
-
 clean:
 	dh_testdir
 	dh_testroot
 
+# Hack in case we killed it in the middle of something
+ifneq (,$(wildcard version.Debian))
+ifneq ($(shell cat version.Debian),$(upstream))
+	override_version=$(release) home=debian/patches sh debian/apply $(upstream)
+endif
+endif
+
 	make-kpkg clean
-	dpatch unpatch-all
-	rm -f stamp-* .config* version.Debian $(DPATCHLIST)
-	rm -rf debian/patched $(DIFFDIR) $(MONODIR)
+	rm -f stamp-* .config* version.Debian 
 
 	dh_clean
 
-install: build
+install:
 	dh_testdir
 	dh_testroot
 	dh_clean -k
@@ -126,15 +49,34 @@
 
 	cp -p debian/substvars.safe debian/substvars
 
+debian/kernel-tree-$(upstream).substvars: debian/patches debian/make-substvars
+	sh debian/make-substvars $(upstream) > $@
+
+binary-kernel-patch:
+	mkdir -p $(patch_home) $(patch_home)/apply $(patch_home)/debian $(patch_home)/unpatch
+	cp debian/patches/*.dpatch $(patch_home)/debian
+	mkdir -p $(patch_home)/debian/series
+	cp debian/patches/series/* $(patch_home)/debian/series/
+
+	sed 's/@version@/$(release)/' debian/apply > $(patch_home)/apply/debian
+	sed 's/@upstream@/$(upstream)/' debian/unpatch > $(patch_home)/unpatch/debian
+	chmod a+x $(patch_home)/apply/debian $(patch_home)/unpatch/debian
+	bzip2 -9 $(patch_home)/debian/*.dpatch
+
+	dh_installdocs -pkernel-patch-debian-$(upstream)
+	dh_installchangelogs -pkernel-patch-debian-$(upstream)
+	dh_compress -pkernel-patch-debian-$(upstream)
+	dh_installdeb -pkernel-patch-debian-$(upstream)
+	dh_gencontrol -pkernel-patch-debian-$(upstream)
+	dh_builddeb -pkernel-patch-debian-$(upstream)
+	
 # Build architecture-independent files here.
-binary-indep: build install
+binary-indep: install binary-kernel-patch debian/kernel-tree-$(upstream).substvars
 	dh_testdir
 	dh_testroot
 
-	chmod u+x debian/make-kernel-patch-pkgs
-	debian/make-kernel-patch-pkgs
-	APPEND_TO_VERSION='' make-kpkg kernel-source
-	APPEND_TO_VERSION='' make-kpkg kernel-doc
+	make-kpkg kernel-source
+	make-kpkg kernel-doc
 
 # Build architecture-dependent files here.
 binary-arch:

Modified: branches/exp-patch-system/debian/unpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/unpatch	2004-08-27 08:57:47 UTC (rev 1371)
+++ branches/exp-patch-system/debian/unpatch	2004-08-27 09:52:45 UTC (rev 1372)
@@ -1,8 +1,8 @@
 #!/bin/sh
-# $Id: unpatch,v 1.1 2003/12/21 05:37:17 herbert Exp $
+# $Id: unpatch,v 1.3 2003/06/30 12:49:09 herbert Exp $
 
 set -e
 
-version=@version@
-upstream=${version%-*}
+upstream=${override_upstream:-@upstream@}
+
 /usr/src/kernel-patches/all/$upstream/apply/debian $upstream