Skip to content
Snippets Groups Projects
Verified Commit 2ad7fefa authored by Christian Heusel's avatar Christian Heusel :rocket:
Browse files

dbscripts: fix createlinks for filenames that contain spaces

So far the for loop recognized filenames with spaces as different words:

$ for f in $(find pkg -type f); do echo "$f"; done
pkg/usr/bin/Surge
XT
Effects
pkg/usr/bin/Surge
XT

While the correct output here would have been:
pkg/usr/bin/Surge XT Effects
pkg/usr/bin/Surge XT

We fix this by just passing everything directly to readelf, which also
removes the loop overhead. This results in a significant speedup for
packages with a lot of libraries and binaries.

fixes: archlinux/infrastructure#524


Co-Authored-By: default avatarEvangelos Foutras <evangelos@foutras.com>
parent 0f612e2f
No related branches found
No related tags found
No related merge requests found
Pipeline #75963 passed
......@@ -44,9 +44,7 @@ for repo in ${repos[@]}; do
echo "$repo/$arch: $pkgname"
mkdir -p ${tmppkgdir}/pkg
bsdtar -xof $pkg -C ${tmppkgdir}/pkg --include={opt,{,usr/}{lib{,32},{s,}bin}}'/*' 2>/dev/null
for f in $(find ${tmppkgdir}/pkg -type f); do
readelf -d "$f" 2> /dev/null | sed -nr 's/.*Shared library: \[(.*)\].*/\1/p'
done | sort -u > ${tmppkgdir}/links
find "${tmppkgdir}/pkg" -type f -exec readelf -d {} + 2>/dev/null | sed -nr 's/.*Shared library: \[(.*)\].*/\1/p' | sort -u > "${tmppkgdir}/links"
rm -rf ${tmppkgdir}/pkg
fi
done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment