[pacman-dev] [PATCH] tolerate broken logpipe

Yardena Cohen yardenack at gmail.com
Wed Jul 10 01:57:45 UTC 2019


Sometimes makechrootpkg fails with:

   rm: cannot remove '/logdest/logpipe.xxxxxxxx': No such file or directory

This shouldn't cause the whole script to fail, so let's tolerate a missing pipe

Signed-off-by: Yardena Cohen <yardenack at gmail.com>
---
 scripts/makepkg.sh.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index aa03e9d9..9f8c9096 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -344,7 +344,7 @@ remove_deps() {
 
 error_function() {
 	if [[ -p $logpipe ]]; then
-		rm "$logpipe"
+		rm -f "$logpipe"
 	fi
 	# first exit all subshells, then print the error
 	if (( ! BASH_SUBSHELL )); then
@@ -428,7 +428,7 @@ run_function() {
 		$pkgfunc &>"$logpipe"
 
 		wait $teepid
-		rm "$logpipe"
+		rm -f "$logpipe"
 	else
 		"$pkgfunc"
 	fi
-- 
2.22.0


More information about the pacman-dev mailing list