summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--fetch-apk.sh13
2 files changed, 10 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 5b138d9..e325518 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@ community/
testing/
main.lst
community.lst
+testing.lst
diff --git a/fetch-apk.sh b/fetch-apk.sh
index c6048fa..5604498 100644
--- a/fetch-apk.sh
+++ b/fetch-apk.sh
@@ -21,14 +21,14 @@ make_fetch_apks_list() {
# 3. 'apk fetch --recursive <pkg name>',
# useful if pkgs downloaded can be sorted
- local isUpgrade=$2
+ local isUpgrade=$2 alist='a.lst'
if [ x${isUpgrade} = 'xupgrade' ]; then
echo ">>> Process UPGRADE"
- apk upgrade -a > a.lst 2>&1
+ if [ ! -f "$alist" ]; then apk upgrade -a > a.lst 2>&1; fi
grep '^(' a.lst | grep 'Upgrading' | awk -F' ' '{print $3 " " $6}' > b.lst
else
echo ">>> Process INSTALL"
- apk fix > a.lst 2>&1
+ if [ ! -f "$alist" ]; then apk fix > a.lst 2>&1; fi
grep '^(' a.lst | grep 'Installing' | awk -F' ' '{print $3 " " $4}' > b.lst
fi
@@ -44,7 +44,12 @@ make_fetch_apks_list() {
echo "adding + $b $file"; echo ${file} >> ${F}
fi
done
- echo "... list created, run fetch cmd"
+ if [ -f $F ]; then
+ _istxt=$(wc -l "$F" | grep -c '^')
+ if [ $_istxt -gt 0 ]; then echo "... list created, run fetch cmd"; fi
+ else
+ echo " ... nothing to do"
+ fi
rm -f a.lst b.lst
}