Description: Return 2 (instead of 1) when there is nothing to do This is mandatory to differentiate "error" and "everything's done". . This really ease the scripting around quilt, eg in patchsys-quilt.mk . It used to works this way, and was changed upstream in commit 188c7dac15a72c437c47664d3162b9f13844fe88 for quilt version 0.43. This regression was the result of a code factorization. . This patch also contains the documentation update, by adding a EXIT STATUS to the man page. Bug-Debian: http://bugs.debian.org/358792 (return 2 on NO-OP) Bug-Debian: http://bugs.debian.org/587001 (document exit status) Forwarded: Submitted 2013-01-18 Changelog: - 2012-12-19: Submitted upstream - 2013-01-18: Upstream asked for changes and documentation - 2013-01-18: new version subitted upstream Last-Update: 2013-01-18 Index: quilt.git/quilt/push.in =================================================================== --- quilt.git.orig/quilt/push.in 2013-01-18 15:35:17.571852522 +0100 +++ quilt.git/quilt/push.in 2013-01-18 15:35:17.511851570 +0100 @@ -362,7 +362,7 @@ [ -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 Index: quilt.git/quilt/scripts/patchfns.in =================================================================== --- quilt.git.orig/quilt/scripts/patchfns.in 2013-01-18 15:35:17.571852522 +0100 +++ quilt.git/quilt/scripts/patchfns.in 2013-01-18 15:35:17.535851949 +0100 @@ -477,7 +477,7 @@ else printf $"No series file found\n" >&2 fi - return 1 + return 2 fi echo "$patch" @@ -582,7 +582,7 @@ then printf $"Patch %s is currently applied\n" \ "$(print_patch $patch)" >&2 - return 1 + return 2 fi echo "$patch" else @@ -592,13 +592,13 @@ 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 } Index: quilt.git/doc/quilt.1.in =================================================================== --- quilt.git.orig/doc/quilt.1.in 2013-01-18 15:35:17.571852522 +0100 +++ quilt.git/doc/quilt.1.in 2013-01-18 15:35:17.567852457 +0100 @@ -118,6 +118,13 @@ Print the version number and exit immediately. +.SH EXIT STATUS + +The exit status is 0 if the subcommand was successfully executed, and +1 in case of error. An exit status of 2 denotes that quilt did not do +anything to complete the command; This happens for example when asking +to push when the whole stack is already pushed. This behavior is +intended to ease the scripting around quilt. .SH EXAMPLE OF WORKING TREE @@ -137,9 +144,7 @@ .RE .fam T -.SH EXAMPLE - -Please refer to the pdf documentation for an example. +Please refer to the pdf documentation for a full example of use. .SH CONFIGURATION FILE