Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Mehani <shtrom@ssji.net>2019-01-25 05:01:13 +0100
committerOlivier Mehani <shtrom@ssji.net>2019-01-25 05:01:13 +0100
commit1405a31d8367452bb7b1a551cda42ea6e9f64a22 (patch)
tree3a6c78b89ff913713493e8793285eca270ae1940
parent807988a8e4d802be95aec0dfe61a97a9a3082dc8 (diff)
titanium-cleanup.sh: actually delete all wanted files
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
-rwxr-xr-xopenbsd/titanium-cleanup.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/openbsd/titanium-cleanup.sh b/openbsd/titanium-cleanup.sh
index 77d2a08..cf41db6 100755
--- a/openbsd/titanium-cleanup.sh
+++ b/openbsd/titanium-cleanup.sh
@@ -14,11 +14,11 @@ BACKUPPATH=${1}
cd ${BACKUPPATH}
-PACKAGES=$(ls | sed s/-.*// | sort -u )
+PACKAGES=$(ls *.apk.*| sed s/-.*// | sort -u )
for PKG in ${PACKAGES}; do
- FILES=$(ls -1tr ${PKG}-*.properties 2>/dev/null | sed 1d)
- FILES=$(ls -1tr ${PKG}-*.tar.bz2 2>/dev/null | sed 1d)
- FILES=$(ls -1tr ${PKG}-*.apk.* 2>/dev/null | sed 1d)
+ FILES=$(ls -1tr ${PKG}-*.properties 2>/dev/null | sed 1d)
+ FILES="${FILES:+${FILES} }$(ls -1tr ${PKG}-*.tar.bz2 2>/dev/null | sed 1d)"
+ FILES="${FILES:+${FILES} }$(ls -1tr ${PKG}-*.apk.* 2>/dev/null | sed 1d)"
test -n "${FILES}" && rm ${FILES}
done