checkapk: Check how many packages depend on a previous soname
Since the changeset committed by psykose a while ago in commit
26118d4997
we now extract the
previous soname. We can pass this previous soname to `apk search -R`
to figure out how many packages are linked against this old soname.
I believe this to be useful for reviewing MRs since the checkapk
output will directly tell us if a contributor has missed rebuilds.
It will also inform us when no rebuilds are necessary, e.g. if the
SONAME was changed but no packages is linked against the library.
Example output for `main/libsodium`:
```
>>> Size difference for libsodium: 336 KiB -> 340 KiB
--- filelist-libsodium-old 2023-09-22 11:24:54.799204225 +0200
+++ filelist-libsodium-new 2023-09-22 11:24:54.799204225 +0200
@@ -1,5 +1,5 @@
.PKGINFO
usr/
usr/lib/
-usr/lib/libsodium.so.23
-usr/lib/libsodium.so.23.3.0
+usr/lib/libsodium.so.26
+usr/lib/libsodium.so.26.1.0
SODIFF:
-usr/lib/libsodium.so.23.3.0: SONAME libsodium.so.23
+usr/lib/libsodium.so.26.1.0: SONAME libsodium.so.26
REBUILDS:
*** 36 packages linked against 'libsodium.so.23' need to be rebuild!
```
This commit is contained in:
parent
fab41364f7
commit
acfa7d6732
23
checkapk.in
23
checkapk.in
|
@ -142,8 +142,17 @@ for i in $pkgname $subpackages; do
|
|||
# filter to things that start with -+ but strip the header (---/+++)
|
||||
diff -U0 "filelist-$_pkgname-old" "filelist-$_pkgname-new" | grep -E '^(\+|-)[A-Za-z0-9]+' | grep '\.so' | while read -r diff_sofile; do
|
||||
case "$diff_sofile" in
|
||||
-*) path="$_pkgname-pkg-old"; sofile="${diff_sofile#\-}" ;;
|
||||
+*) path="$_pkgname-pkg-new"; sofile="${diff_sofile#\+}" ;;
|
||||
-*)
|
||||
path="$_pkgname-pkg-old"
|
||||
sofile="${diff_sofile#\-}"
|
||||
soname=$(scanelf -qS "$path/$sofile" | awk '{print $1}')
|
||||
rebuild_required=$(apk search -r --origin --exact -q "so:$soname" | sort -u | wc -l)
|
||||
;;
|
||||
+*)
|
||||
path="$_pkgname-pkg-new"
|
||||
sofile="${diff_sofile#\+}"
|
||||
rebuild_required=0
|
||||
;;
|
||||
esac
|
||||
|
||||
# skip symlinks (only adds duplicate output or is dangling), and things that aren't valid elfs
|
||||
|
@ -151,8 +160,18 @@ for i in $pkgname $subpackages; do
|
|||
if ! [ -L "$path"/"$sofile" ] && readelf -h "$path"/"$sofile" >/dev/null 2>&1; then
|
||||
echo "$diff_sofile: " "$(objdump -p "$path"/"$sofile" | grep SONAME)"
|
||||
fi
|
||||
|
||||
if [ "$rebuild_required" -ne 0 ]; then
|
||||
echo "*** $rebuild_required packages linked against $soname need to be rebuild!" >> "$tmpdir"/rebuilds
|
||||
fi
|
||||
done
|
||||
else
|
||||
msg "No soname differences for $_pkgname."
|
||||
fi
|
||||
|
||||
if [ -e "$tmpdir"/rebuilds ]; then
|
||||
echo "REBUILDS:"
|
||||
cat "$tmpdir"/rebuilds
|
||||
rm "$tmpdir"/rebuilds
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue