summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@parabola.nu>2024-02-20 18:34:48 -0700
committerLuke T. Shumaker <lukeshu@parabola.nu>2024-02-21 10:17:21 -0700
commit87cb7598e0d0147c2befb4937423672d1b91fcce (patch)
treefeae4d90d35e15500028c54a920dd167d8d48ba4
parentd89a0bc943525865b964f981a2bdcd3a7771dc2d (diff)
fix: librerelease: Fix the pbot-say check
It was doing the check as `which pbot-say && pbot-say …` to only run pbot-say if the command exists... but if the `which` fails then the whole librerelease would fail, defeating the point of the check. So switch it to a conventional `if` block. Also, use the `type` builtin instead of the external `which` binary.
-rwxr-xr-xsrc/abslibre-tools/librerelease4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease
index 1e79f4a..a887ce4 100755
--- a/src/abslibre-tools/librerelease
+++ b/src/abslibre-tools/librerelease
@@ -5,7 +5,7 @@
# Copyright (C) 2010-2012 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com>
# Copyright (C) 2010-2013 Nicolás Reynolds <fauno@parabola.nu>
# Copyright (C) 2013 Michał Masłowski <mtjm@mtjm.eu>
-# Copyright (C) 2013-2014, 2017-2018 Luke Shumaker <lukeshu@parabola.nu>
+# Copyright (C) 2013-2014, 2017-2018, 2024 Luke Shumaker <lukeshu@parabola.nu>
# Copyright (C) 2019 Bill Auger <mr.j.spam.me@gmail.com>
#
# For just the create_signature() function:
@@ -301,7 +301,7 @@ release_packages() {
local packages=${file_list} # TODO: parse package names? - this is gonna be messy
local login=${REPODEST_userinfo:-somebody} ; login=${login%%:*} ;
ssh ${REPODEST_port:+-p "$REPODEST_port"} "${REPODEST_userhost}" \
- "which pbot-say && pbot-say ${login} just published: ${packages}"
+ "if type pbot-say &>/dev/null-say; then pbot-say ${login} just published: ${packages}; fi"
return $EXIT_SUCCESS
}