summaryrefslogtreecommitdiffstats
path: root/scripts/bash_completion
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-06-05 13:38:49 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-06-05 13:38:51 +0200
commita4a825c5f36e8c3242568aa2f518011901cc3420 (patch)
tree8a0671bdb7e5b15ecc85d8c859a09e138a597388 /scripts/bash_completion
parentf8ba11608734770fcf61f8ee2716f14aff276b7f (diff)
downloadptxdist-a4a825c5f36e8c3242568aa2f518011901cc3420.tar.gz
ptxdist-a4a825c5f36e8c3242568aa2f518011901cc3420.tar.xz
bash_completion: don't cache package list when an error occured
This can happen when the user aborts with 'ctrl+c' while ptxdist is generating the package list. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/bash_completion')
-rw-r--r--scripts/bash_completion3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/bash_completion b/scripts/bash_completion
index deb14ad0c..b41754bae 100644
--- a/scripts/bash_completion
+++ b/scripts/bash_completion
@@ -15,6 +15,9 @@ __ptxdist_completion_packages() {
local cache="${1}/.bash_completion_packages"
if [ -z "${2}" -o "${2}" -nt "${cache}" -o "${3}" -nt "${cache}" -o "${4}" -nt "${cache}" ]; then
${_ptxdist_cmd} print PTX_PACKAGES_SELECTED 2>/dev/null | tee "${cache}" 2>/dev/null
+ if [ ${PIPESTATUS[0]} -ne 0 -o ${PIPESTATUS[1]} -ne 0 ]; then
+ rm "${cache}"
+ fi
else
cat "${cache}"
fi