diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2021-10-22 12:46:20 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2021-10-25 16:57:03 +0200 |
commit | ced1e411f301bf90ab90a5d649a7f0eb3cc54ab9 (patch) | |
tree | 8f93705246d15ba0a03cac84b958e628fa5c627b | |
parent | c997be07b0258e91ee8e7537c2e0ee2ff4c224a0 (diff) | |
download | ptxdist-ced1e411f301bf90ab90a5d649a7f0eb3cc54ab9.tar.gz ptxdist-ced1e411f301bf90ab90a5d649a7f0eb3cc54ab9.tar.xz |
bash_completion: don't try to create the cache in a non-existing directory
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | scripts/bash_completion | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/bash_completion b/scripts/bash_completion index eea89909d..052409205 100644 --- a/scripts/bash_completion +++ b/scripts/bash_completion @@ -13,7 +13,9 @@ declare -a _ptxdist_completion_newpkg __ptxdist_completion_packages() { set -- $(${_ptxdist_cmd} print STATEDIR PTXDIST_PTXCONFIG PTXDIST_PLATFORMCONFIG PTXDIST_COLLECTIONCONFIG) local cache="${1}/.bash_completion_packages" - if [ -z "${2}" -o "${2}" -nt "${cache}" -o "${3}" -nt "${cache}" -o "${4}" -nt "${cache}" ]; then + if [ ! -d "${1}" ]; then + ${_ptxdist_cmd} print PTX_PACKAGES_SELECTED 2>/dev/null + elif [ -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}" |