Description: Return 2 (instead of 1) when there is nothing to do
 This is mandatory to differenciate "error" and "everything's done".
 .
 This really ease the scripting around quilt, eg in patchsys-quilt.mk 
 .
 It used to works this way in quilt 0.33, and was changed for some
 reason upstream.
Bug-Debian: http://bugs.debian.org/358792
Forwarded: Submitted 2012-12-19

---
 quilt/push.in             |    2 +-
 quilt/scripts/patchfns.in |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

--- a/quilt/push.in
+++ b/quilt/push.in
@@ -362,7 +362,7 @@ else
 	[ -z "$opt_all" ] && number=1
 fi
 
-stop_at_patch=$(find_unapplied_patch "$stop_at_patch") || exit 1
+stop_at_patch=$(find_unapplied_patch "$stop_at_patch") || exit $?
 
 [ -z "$opt_verbose" ] && silent_unless_verbose=-s
 [ -n "$opt_force" ] && opt_leave_rejects=1
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -477,7 +477,7 @@ find_last_patch()
 		else
 			printf $"No series file found\n" >&2
 		fi
-		return 1
+		return 2
 	fi
 
 	echo "$patch"
@@ -582,7 +582,7 @@ find_unapplied_patch()
 	        then
 			printf $"Patch %s is currently applied\n" \
 				"$(print_patch $patch)" >&2
-               		return 1
+               		return 2
 	        fi
 		echo "$patch"
 	else
@@ -592,13 +592,13 @@ find_unapplied_patch()
 		then
 			patch_after "$start"
 		else
-			find_first_patch || return 1
+			find_first_patch || return 2
 		fi
 		if [ $? -ne 0 ]
 		then
 			printf $"File series fully applied, ends at patch %s\n" \
 				"$(print_patch $start)" >&2
-			return 1
+			return 2
 		fi
 	fi
 }
