mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-03-01 09:50:31 +00:00
checkapk: fix size difference output when multiple info matches
I rebuilt networkmanager locally and was greeted with this: >>> Size difference for networkmanager: 16 MiB -> 2772 KiB It turns out networkmanager-elogind provides networkmanager so apk info will list both, and the former is much bigger so it looked like the rebuilt package was much smaller when there was almost no difference (as expected) Fix by matching on exact package name for both lines; this is already what we were doing with the local package anyway and the apk fetch correctly picks the correct package in this case
This commit is contained in:
parent
d235d5c5a4
commit
d9f3f05b50
@ -98,16 +98,15 @@ for i in $pkgname $subpackages; do
|
|||||||
die "the built package ($_pkgname) is already in the repo"
|
die "the built package ($_pkgname) is already in the repo"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# For our local repo (newsize) apk info might return multiple packages, e.g. if different
|
# apk info could return multiple lines if multiple packages share a provide
|
||||||
# version of the package where built previously. However, for a repo only one of pkgname=pkgver-rpkgrel can exist.
|
# (e.g. dnsmasq); filter with the exact package name and take the second line:
|
||||||
# Filter out this specific pkgver with grep, as it can have only one match, then take the second line:
|
|
||||||
# 7zip-23.01-r0 installed size:
|
# 7zip-23.01-r0 installed size:
|
||||||
# 1668 KiB
|
# 1668 KiB
|
||||||
newsize="$(apk info --repositories-file /dev/null --repository "$REPODEST"/$repo --size $_pkgname | \
|
newsize="$(apk info --repositories-file /dev/null --repository "$REPODEST"/$repo --size $_pkgname | \
|
||||||
grep -F "$pkg" -A1 | \
|
grep -F "$pkg" -A1 | \
|
||||||
tail -n1)"
|
tail -n1)"
|
||||||
oldsize="$(apk info --repositories-file "$tmpdir"/repositories --size "$_pkgname" | \
|
oldsize="$(apk info --repositories-file "$tmpdir"/repositories --size "$_pkgname" | \
|
||||||
grep -F "$_pkgname" -A1 | \
|
grep -F "$oldpkg" -A1 | \
|
||||||
tail -n1)"
|
tail -n1)"
|
||||||
|
|
||||||
if [ "$oldsize" = "$newsize" ]; then
|
if [ "$oldsize" = "$newsize" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user