hooks/pre-pkg/05-prepare-32bit.sh: fix symlinks

If lib32symlinks contains plain library names without a path as in
the case of glibc (lib32symlinks="ld-linux.so.2") the expression
${f%/*} is not empty, but returns the basename.
Handle that case by verifying that ${f%/*} is different from ${f}.

Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
This commit is contained in:
Jürgen Buchmüller 2019-05-28 15:11:37 +02:00
parent 9f8a8555b2
commit 998aac300a
No known key found for this signature in database
GPG key ID: DE55AD8DBEBB4EE8

View file

@ -156,7 +156,11 @@ hook() {
# Additional symlinks to the native libdir.
for f in ${lib32symlinks}; do
echo "$pkgver: symlinking $f to the native libdir..."
mkdir -p ${destdir32}/usr/lib{,32}/${f%/*}/
if [ "${f%/*}" != "${f}" ]; then
mkdir -p ${destdir32}/usr/lib{,32}/${f%/*}/
else
mkdir -p ${destdir32}/usr/lib{,32}/
fi
ln -sfr ${destdir32}/usr/lib32/$f ${destdir32}/usr/lib/$f
done
# If it's a development pkg add a dependency to the 64bit pkg.