Revert "xbps-src: multiple performance improvements."

This reverts commit 2a4e178e35.
This commit is contained in:
Jürgen Buchmüller 2019-07-05 12:08:45 +02:00
parent 3dc3a61144
commit 17ba00b095
13 changed files with 608 additions and 407 deletions

View file

@ -32,16 +32,16 @@ genpkg() {
_preserve=${preserve:+-p}
if [ -s ${PKGDESTDIR}/rdeps ]; then
_deps="$(<${PKGDESTDIR}/rdeps)"
_deps="$(cat ${PKGDESTDIR}/rdeps)"
fi
if [ -s ${PKGDESTDIR}/shlib-provides ]; then
_shprovides="$(<${PKGDESTDIR}/shlib-provides)"
_shprovides="$(cat ${PKGDESTDIR}/shlib-provides)"
fi
if [ -s ${PKGDESTDIR}/shlib-requires ]; then
_shrequires="$(<${PKGDESTDIR}/shlib-requires)"
_shrequires="$(cat ${PKGDESTDIR}/shlib-requires)"
fi
if [ -s ${XBPS_STATEDIR}/gitrev ]; then
_gitrevs="$(<${XBPS_STATEDIR}/gitrev)"
_gitrevs="$(cat ${XBPS_STATEDIR}/gitrev)"
fi
# Stripping whitespaces

View file

@ -5,7 +5,7 @@
# - Generates shlib-requires file for xbps-create(1)
add_rundep() {
local dep="$1" i= rpkgdep= _depname= found=
local dep="$1" i= rpkgdep= _depname= _rdeps= found=
_depname="$($XBPS_UHELPER_CMD getpkgdepname ${dep} 2>/dev/null)"
if [ -z "${_depname}" ]; then
@ -68,19 +68,26 @@ hook() {
exec < $depsftmp
while read f; do
lf=${f#${PKGDESTDIR}}
if [ "${skiprdeps/${lf}/}" != "${skiprdeps}" ]; then
msg_normal "Skipping dependency scan for ${lf}\n"
continue
fi
if [ "${skiprdeps/${lf}/}" != "${skiprdeps}" ]; then
msg_normal "Skipping dependency scan for ${lf}\n"
continue
fi
case "$(file -bi "$f")" in
application/x-*executable*|application/x-sharedlib*)
for nlib in $($OBJDUMP -p "$f"|grep NEEDED|awk '{print $2}'); do
[ -z "$verify_deps" ] && verify_deps="$nlib" && continue
found=0
if [ -z "$verify_deps" ]; then
verify_deps="$nlib"
continue
fi
for j in ${verify_deps}; do
[[ $j == $nlib ]] && found=1 && break
[ "$j" != "$nlib" ] && continue
found_dup=1
break
done
[[ $found -eq 0 ]] && verify_deps="$verify_deps $nlib"
if [ -z "$found_dup" ]; then
verify_deps="$verify_deps $nlib"
fi
unset found_dup
done
;;
esac
@ -90,13 +97,13 @@ hook() {
#
# Add required run time packages by using required shlibs resolved
# above, the mapping is done thru the common/shlibs file.
# above, the mapping is done thru the mapping_shlib_binpkg.txt file.
#
for f in ${verify_deps}; do
unset _f j rdep _rdep rdepcnt soname _pkgname _rdepver found
_f=$(echo "$f"|sed -E 's|\+|\\+|g')
rdep="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|cut -d ' ' -f2)"
rdepcnt="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|cut -d ' ' -f2|wc -l)"
rdep="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|awk '{print $2}')"
rdepcnt="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|awk '{print $2}'|wc -l)"
if [ -z "$rdep" ]; then
# Ignore libs by current pkg
soname=$(find ${PKGDESTDIR} -name "$f")
@ -114,9 +121,15 @@ hook() {
_pkgname=$($XBPS_UHELPER_CMD getpkgname "$j")
# if there's a SONAME matching pkgname, use it.
for x in ${pkgname} ${subpackages}; do
[[ $_pkgname == $x ]] && found=1 && break
if [ "${_pkgname}" = "${x}" ]; then
found=1
break
fi
done
[[ $found ]] && _rdep=$j && break
if [ -n "$found" ]; then
_rdep=$j
break
fi
done
if [ -z "${_rdep}" ]; then
# otherwise pick up the first one.

View file

@ -119,7 +119,7 @@ hook() {
msg_red "${pkgver}: SONAME bump detected: ${libname}.so.${conflictRev} -> ${libname}.so.${rev}\n"
msg_red "${pkgver}: please update common/shlibs with this line: \"${libname}.so.${rev} ${pkgver}\"\n"
msg_red "${pkgver}: all reverse dependencies should also be revbumped to be rebuilt against ${libname}.so.${rev}:\n"
_revdeps=$($XBPS_QUERY_XCMD -Rs ${libname}.so -p shlib-requires|cut -d ' ' -f1)
_revdeps=$($XBPS_QUERY_XCMD -Rs ${libname}.so -p shlib-requires|awk '{print $1}')
for x in ${_revdeps}; do
msg_red " ${x%:}\n"
done
@ -128,7 +128,7 @@ hook() {
# Try to match provided shlibs in virtual packages.
for f in ${provides}; do
_vpkgname="$($XBPS_UHELPER_CMD getpkgname ${f} 2>/dev/null)"
_spkgname="$(grep "^${filename}" $mapshlibs | cut -d ' ' -f2)"
_spkgname="$(grep "^${filename}" $mapshlibs | awk '{print $2}')"
_libpkgname="$($XBPS_UHELPER_CMD getpkgname ${_spkgname} 2>/dev/null)"
if [ -z "${_spkgname}" -o -z "${_libpkgname}" ]; then
continue