summaryrefslogtreecommitdiff
path: root/fetch-apk.sh
diff options
context:
space:
mode:
Diffstat (limited to 'fetch-apk.sh')
-rw-r--r--fetch-apk.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/fetch-apk.sh b/fetch-apk.sh
index 5604498..e9bbca0 100644
--- a/fetch-apk.sh
+++ b/fetch-apk.sh
@@ -34,12 +34,18 @@ make_fetch_apks_list() {
local branch=$1; local F="${branch}.lst"; rm -f ${F}
echo ">>> creating ${F}"
+ local name file b
cat 'b.lst' | while read f; do \
- local name=$(echo $f | awk '{print $1}')
- local file=$(echo $f | sed 's/ /-/g' | sed 's/(//' | sed 's/)//')
+ name=$(echo $f | awk '{print $1}')
+ file=$(echo $f | sed 's/ /-/g' | sed 's/(//' | sed 's/)//')
- local b=$(apk policy ${name} | grep -c ${branch})
- # local b=$(grep -c "^P:${name}$" 'APKINDEX') # alt method
+ if [ ! -f "$alist" ]; then
+ b=$(apk policy ${name} | grep -c ${branch})
+ else
+ b=$(cat ${branch}/${ARCH}/APKINDEX.tar.gz \
+ | tar -O -zx APKINDEX | grep -c "^P:${name}$")
+ # b=$(grep -c "^P:${name}$" 'APKINDEX') # alt method
+ fi
if [ $b -gt 0 ]; then
echo "adding + $b $file"; echo ${file} >> ${F}
fi