From 7436cebdd5e027d7b7e144e0dc403934c1d616db Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Wed, 30 Nov 2022 11:11:30 -0500 Subject: [PATCH] pre-pkg/04-generate-runtime-deps.sh: avoid conflict with `broken` template var Using a non-local `broken` variable in the hook common/hooks/prepkg/04-generate-runtime-deps.sh will cause a spurious shlib error when building templates marked broken are built with `xbps-src -b`. Declaring the variable local is sufficient, but let's make the name a bit more distinctive anyway. --- common/hooks/pre-pkg/04-generate-runtime-deps.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh index eb19ebfe708..8eace6c683e 100644 --- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh +++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh @@ -46,7 +46,7 @@ store_pkgdestdir_rundeps() { } hook() { - local depsftmp f lf j mapshlibs sorequires _curdep elfmagic + local depsftmp f lf j mapshlibs sorequires _curdep elfmagic broken_shlibs # Disable trap on ERR, xbps-uhelper cmd might return error... but not something # to be worried about because if there are broken shlibs this hook returns @@ -100,7 +100,7 @@ hook() { soname=$(find ${PKGDESTDIR} -name "$f") if [ -z "$soname" ]; then msg_red_nochroot " SONAME: $f <-> UNKNOWN PKG PLEASE FIX!\n" - broken=1 + broken_shlibs=1 else echo " SONAME: $f <-> $pkgname (ignored)" fi @@ -129,7 +129,7 @@ hook() { _rdepver=$($XBPS_UHELPER_CMD getpkgversion "${_rdep}" 2>/dev/null) if [ -z "${_pkgname}" -o -z "${_rdepver}" ]; then msg_red_nochroot " SONAME: $f <-> UNKNOWN PKG PLEASE FIX!\n" - broken=1 + broken_shlibs=1 continue fi # Check if pkg is a subpkg of sourcepkg; if true, ignore version @@ -155,7 +155,7 @@ hook() { # # If pkg uses any unknown SONAME error out. # - if [ -n "$broken" -a -z "$allow_unknown_shlibs" ]; then + if [ -n "$broken_shlibs" -a -z "$allow_unknown_shlibs" ]; then msg_error "$pkgver: cannot guess required shlibs, aborting!\n" fi