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

dbscrips: make createlinks also work if filename contains spaces

This addresses the problem that so far the for loop recognizes each
filename with a space as different word, i.e.:

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

while the correct output would have been:
pkg.1/usr/bin/Surge XT Effects
pkg.1/usr/bin/Surge XT

We fix this by explictly passing each find result as its own variable.

fixes archlinux/infrastructure#524


Signed-off-by: default avatarChristian Heusel <christian@heusel.eu>
parent e87cd39b
No related branches found
No related tags found
No related merge requests found
Pipeline #74342 passed
......@@ -44,9 +44,10 @@ 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 -print |
while IFS= read -r file; do
readelf -d "$file" 2> /dev/null | sed -nr 's/.*Shared library: \[(.*)\].*/\1/p'
done | 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