r1898 - trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian

Joshua Kwan joshk@haydn.debian.org
Wed, 24 Nov 2004 14:12:45 -0700


Author: joshk
Date: 2004-11-24 14:12:25 -0700 (Wed, 24 Nov 2004)
New Revision: 1898

Modified:
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/apply
Log:
fix sort order stuff


Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/apply
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/apply	2004-11-24 21:00:49 UTC (rev 1897)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/apply	2004-11-24 21:12:25 UTC (rev 1898)
@@ -61,7 +61,7 @@
 
 unpatch_series() {
 	series=$1
-	[ -f "$series" ] || die "I wasn't passed a series!"
+	[ -f "$series" ] || die "I wasn't passed a series: $series"
 
 	tac $series | while read action patch; do
 		case "$action" in
@@ -83,7 +83,7 @@
 
 patch_series() {
 	series=$1
-	[ -f "$series" ] || die "I wasn't passed a series!"
+	[ -f "$series" ] || die "I wasn't passed a series: $series"
 
 	while read action patch; do
 		case "$action" in
@@ -157,24 +157,22 @@
 		exit 0
 	fi
 
-	for sver in $(ls -d $home/series/* | sort -rnt- -k 2); do
-		base=$(basename "$sver")
+	for base in $((cd $home/series/ && ls -d *) | sort -rnt- -k 2); do
 		srev=${base#*-}
 		if [ -n "$srev" ]; then
 			if [ $srev -le $current_rev ]; then
-				unpatch_series $sver
+				unpatch_series $home/series/$base
 			fi
 		else
 			die "Series doesn't have a revision!"
 		fi
 	done
 elif [ "$current_rev" = "$upstream" ] || [ $target_rev -gt $current_rev ]; then
-	for sver in $(ls -d $home/series/* | sort -nt- -k 2); do
-		base=$(basename "$sver")
+	for base in $((cd $home/series/ && ls -d *) | sort -nt- -k 2); do
 		srev=${base#*-}
 		if [ -n "$srev" ]; then
 			if [ $srev -gt $current_rev ] && [ $srev -le $target_rev ]; then
-				patch_series $sver
+				patch_series $home/series/$base
 			fi
 		else
 			die "Series doesn't have a revision!"
@@ -184,13 +182,12 @@
 	echo "Nothing to do, exiting."
 	exit 0
 elif [ $target_rev -lt $current_rev ]; then
-	for sver in $(ls -d $home/series/* | sort -rnt- -k 2); do
-		base=$(basename "$sver")
+	for base in $((cd $home/series/ && ls -d *) | sort -rnt- -k 2); do
 		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
+				unpatch_series $home/series/$base
 			fi
 		else
 			die "Series doesn't have a revision!"