From 26caf3b571f023cfd9d56314abccab845e94b07b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 16 Nov 2018 09:53:51 +0100 Subject: bin/build-packages: add library names to provided symbols - it appears, symbol names are only unique within one library --- bin/build-packages | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/bin/build-packages b/bin/build-packages index dd733eb..ae3d01a 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -554,25 +554,19 @@ while [ "${count}" -ne 0 ] && \ done >&2 printf 'searching for required and more provided libraries\n' package_content_dir=$(mktemp -d "${tmp_dir}/package-content.XXXXXX") - # TODO: qt version should be added here, too find "${tar_content_dir}" -maxdepth 1 \ -name '*.pkg.tar.xz' | \ while read -r pkgfile; do - tar -OxJf "${pkgfile}" '.BUILDINFO' 2>/dev/null | \ - sed -n ' - s/^installed = \(glibc\)-\([0-9.]\+\)\(-[^-]\+\)\{2\}$/\1>=\2/ - T - p - ' > \ - "${pkgfile}.so.needs" if printf '%s\n' "${pkgfile}" | \ grep -vq -- '-any\.pkg\.tar\.xz$'; then # we do not check "any" packages for linked libraries # (why do they have them in the first place?) mkdir "${package_content_dir}/${pkgfile##*/}" tar -C "${package_content_dir}/${pkgfile##*/}" -xJf "${pkgfile}" 2>/dev/null + # we rely on "${checksum}" not appearing in any objdump output find "${package_content_dir}/${pkgfile##*/}" \ -name 'opt' -prune , \ + -type f \ -exec objdump -x '{}' \; 2>/dev/null | \ sed ' /^architecture:.* i386:x86-64, /,/^architecture:.* i386:x86-32, / d @@ -583,10 +577,19 @@ while [ "${count}" -ne 0 ] && \ t } /^Version References:$/,/^$/ { - /^\s*required from/ d - s/^\s*\(0x[0-9a-fA-F]\+\)\s\+0x[0-9a-fA-F]\+\s\+[0-9]\+\s\+\(\S\+\)$/\2=\1/ + /^\s*required from / { + s/^\s*required from \(\S\+\):\s*$/'"${checksum}"'\1/ + T end + h + d + } + s/^\s*\(0x[0-9a-fA-F]\+\)\s\+0x[0-9a-fA-F]\+\s\+[0-9]\+\s\+\(\S\+\)$/\2-\1/ + T end + G + s/^\(\S\+\)\n'"${checksum}"'\(\S\+\)$/\2-\1/ t } + :end d ' | \ sort -u > \ @@ -603,17 +606,27 @@ while [ "${count}" -ne 0 ] && \ ' "${pkgfile}.so.needs" find "${package_content_dir}/${pkgfile##*/}" \ -name 'opt' -prune , \ - -exec objdump -x '{}' \; 2>/dev/null | \ + -type f \ + -exec objdump -x '{}' \; \ + -printf "${checksum}"'%f\n' 2>/dev/null | \ sed ' /^architecture:.* i386:x86-64, /,/^architecture:.* i386:x86-32, / d + /^'"${checksum}"'/ { + h + d + } /SONAME/ { s/^\s*\S\+\s\+\(\S\+\)\s.*$/\1/ t } /^Version definitions:$/,/^$/ { - s/^[0-9]\+\s\+0x[0-9a-fA-F]\+\s\+\(0x[0-9a-fA-F]\+\)\s\+\(\S\+\)$/\2=\1/ + s/^[0-9]\+\s\+0x[0-9a-fA-F]\+\s\+\(0x[0-9a-fA-F]\+\)\s\+\(\S\+\)$/\2-\1/ + T end + G + s/^\(\S\+\)\n'"${checksum}"'\(\S\+\)$/\2-\1/ t } + :end d ' | \ sort -u >> \ -- cgit v1.2.3-70-g09d2