[pacman-dev] [PATCH] Change the exit code for pacman_deptest().

Andrew Fyfe andrew at neptune-one.net
Mon Jul 2 13:28:39 EDT 2007


Changed the exit code for missing deps from 1 to 127 because 1 is used
for other errors. makepkg breaks if pacman exits with 1 for any reason
other than a missing dep.

Signed-off-by: Andrew Fyfe <andrew at neptune-one.net>
---
 scripts/makepkg.in   |    2 +-
 src/pacman/deptest.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.in b/scripts/makepkg.in
index 8be44c6..96c94ea 100644
--- a/scripts/makepkg.in
+++ b/scripts/makepkg.in
@@ -296,7 +296,7 @@ check_deps() {
 
 	pmout=$(pacman $PACMAN_OPTS -T $*)
 	ret=$?
-	if [ $ret -eq 1 ]; then #unresolved deps
+	if [ $ret -eq 127 ]; then #unresolved deps
 		echo "$pmout"
 	elif [ $ret -ne 0 ]; then
 		error "$(gettext "Pacman returned a fatal error (%i): %s")" "$ret" "$pmout"
diff --git a/src/pacman/deptest.c b/src/pacman/deptest.c
index 264ba1c..5addfb3 100644
--- a/src/pacman/deptest.c
+++ b/src/pacman/deptest.c
@@ -79,7 +79,7 @@ int pacman_deptest(alpm_list_t *targets)
 
 		if(!found) {
 			printf("%s\n", saved_target);
-			retval = 1;
+			retval = 127;
 		}
 		free(saved_target);
 	}
-- 
1.5.2.2





More information about the pacman-dev mailing list