diff options
-rw-r--r-- | checkapk.in | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/checkapk.in b/checkapk.in index b9313d5..e935ed5 100644 --- a/checkapk.in +++ b/checkapk.in @@ -170,17 +170,24 @@ for i in $pkgname $subpackages; do # generate a temp repositories file with only the http(s) repos grep -E "^https?:" /etc/apk/repositories > "$tmpdir/repositories" - if ! $APK fetch --stdout --repositories-file "$tmpdir/repositories" "$_pkgname" > old.apk; then + oldapk=old.apk + if ! $APK fetch --stdout --repositories-file "$tmpdir/repositories" "$_pkgname" > "$oldapk"; then warning "could not download $_pkgname (network error or new package)" - continue + oldapk= + else + [ -e "$oldapk" ] || die "can't find old apk $oldapk" fi - [ -e "old.apk" ] || die "can't find old apk old.apk" - pkginfo "old.apk" "pkginfo-$_pkgname-old" - pkginfo "$newapk" "pkginfo-$_pkgname-new" + if [ -n "$oldapk" ]; then + pkginfo "$oldapk" "pkginfo-$_pkgname-old" + filelist "$oldapk" "filelist-$_pkgname-old" + touch -r "pkginfo-$_pkgname-old" "filelist-$_pkgname-old" + else + touch "filelist-$_pkgname-old" + touch "pkginfo-$_pkgname-old" + fi - filelist "old.apk" "filelist-$_pkgname-old" - touch -r "pkginfo-$_pkgname-old" "filelist-$_pkgname-old" + pkginfo "$newapk" "pkginfo-$_pkgname-new" filelist "$newapk" "filelist-$_pkgname-new" touch -r "pkginfo-$_pkgname-new" "filelist-$_pkgname-new" @@ -193,5 +200,5 @@ for i in $pkgname $subpackages; do done [ -n "$soname" ] || msg "No soname differences for $_pkgname." - rm "old.apk" + rm -f old.apk done |