From 45aeb193f913615e20139b115257f412a7449ebf Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Tue, 12 Apr 2022 15:28:23 -0400 Subject: [PATCH] common/hooks/pre-pkg/04-generate-runtime-deps.sh: sort deps for reproducibility fixes #36641 --- common/hooks/pre-pkg/04-generate-runtime-deps.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh index c8f8c04d4884..987b0cece9c5 100644 --- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh +++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh @@ -34,15 +34,14 @@ add_rundep() { store_pkgdestdir_rundeps() { if [ -n "$run_depends" ]; then - : > ${PKGDESTDIR}/rdeps for f in ${run_depends}; do _curdep="$(echo "$f" | sed -e 's,\(.*\)?.*,\1,')" if [ -z "$($XBPS_UHELPER_CMD getpkgdepname ${_curdep} 2>/dev/null)" -a \ -z "$($XBPS_UHELPER_CMD getpkgname ${_curdep} 2>/dev/null)" ]; then _curdep="${_curdep}>=0" fi - printf -- "${_curdep} " >> ${PKGDESTDIR}/rdeps - done + printf -- "${_curdep}\n" + done | sort | xargs > ${PKGDESTDIR}/rdeps fi } @@ -145,7 +144,7 @@ hook() { if [ "${_pkgname}" != "${pkgname}" ]; then echo " SONAME: $f <-> ${_sdep}" - sorequires+="${f} " + sorequires+="${f}\n" else # Ignore libs by current pkg echo " SONAME: $f <-> ${_rdep} (ignored)" @@ -163,9 +162,9 @@ hook() { store_pkgdestdir_rundeps for f in ${shlib_requires}; do - sorequires+="${f} " + sorequires+="${f}\n" done if [ -n "${sorequires}" ]; then - echo "${sorequires}" > ${PKGDESTDIR}/shlib-requires + echo "${sorequires}" | sort | xargs > ${PKGDESTDIR}/shlib-requires fi }