]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
python: fix exit status handling with uninstall
authorMike Frysinger <vapier@gentoo.org>
Wed, 16 Feb 2022 03:25:35 +0000 (22:25 -0500)
committerMike Frysinger <vapier@gentoo.org>
Wed, 16 Feb 2022 03:25:35 +0000 (22:25 -0500)
The st variable is set at the top of this shell script, and then here
is a pipeline where it tries to update it in the subshell.  But since
setting variables in a subshell doesn't propagate back up, it doesn't
actually work.  Have the final subshell in the pipeline manage its own
exit status and exit with that so that the final status of the pipeline
is the right value.

* lib/am/python.am: Fix final subshell exit status passing.

lib/am/python.am

index 8c302090aae860a4d1b2618c160dc886eb904cb5..e5e9dfe3bd429cf7f5af8e9902301dec7116b0f9 100644 (file)
@@ -118,9 +118,11 @@ uninstall-%DIR%PYTHON:
 ## into account.  Avoid exceeding the command-line length limit.
        dir='$(DESTDIR)$(%NDIR%dir)'; \
        echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \
-         while read files; do \
-           $(am__uninstall_files_from_dir) || st=$$?; \
-         done || exit $$?; \
+         ( sst=0; \
+           while read files; do \
+             $(am__uninstall_files_from_dir) || sst=$$?; \
+           done; \
+           exit $$sst ) || st=$$?; \
        exit $$st
 endif %?INSTALL%