xbps-src: consistently use read -r when reading file paths

This commit is contained in:
Duncaen 2023-08-31 14:17:24 +02:00
parent 9e68e66a04
commit 65c9ade5e4
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35
6 changed files with 6 additions and 8 deletions

View File

@ -15,8 +15,7 @@ hook() {
rm -f ${PKGDESTDIR}/usr/share/info/dir
fi
find ${PKGDESTDIR}/usr/share/info -type f -follow | while read f
do
find ${PKGDESTDIR}/usr/share/info -type f -follow | while read -r f; do
j=$(echo "$f"|sed -e "$fpattern")
[ "$j" = "" ] && continue
[ "$j" = "/usr/share/info/dir" ] && continue

View File

@ -9,8 +9,7 @@ hook() {
fi
# rewrite symlinks
find $mandir -type l -regex '.*\.\(gz\|bz2\)' | while read f
do
find $mandir -type l -regex '.*\.\(gz\|bz2\)' | while read -r f; do
lnkat=$(readlink "$f")
ln -s ${lnkat%.*} ${f%.*}
rm $f

View File

@ -2,7 +2,7 @@
hook() {
if [ -d "${PKGDESTDIR}" ]; then
find "${PKGDESTDIR}" -mindepth 1 -type d -empty -print -delete|sort -r|while read f; do
find "${PKGDESTDIR}" -mindepth 1 -type d -empty -print -delete|sort -r|while read -r f; do
_dir="${f##${PKGDESTDIR}}"
msg_warn "$pkgver: removed empty dir: ${_dir}\n"
done

View File

@ -65,7 +65,7 @@ hook() {
STRIPCMD=/usr/bin/$STRIP
find ${PKGDESTDIR} -type f | while read f; do
find ${PKGDESTDIR} -type f | while read -r f; do
if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
continue
fi

View File

@ -70,7 +70,7 @@ hook() {
exec 3<&0 # save stdin
exec < $depsftmp
while read f; do
while read -r f; do
lf=${f#${PKGDESTDIR}}
if [ "${skiprdeps/${lf}/}" != "${skiprdeps}" ]; then
msg_normal "Skipping dependency scan for ${lf}\n"

View File

@ -171,7 +171,7 @@ hook() {
_pattern="^${_shlib}\.so\.[0-9]+(.*)[[:blank:]]+${_pkgname}-[^-]+_[0-9]+"
fi
grep -E "${_pattern}" $mapshlibs | { \
while read conflictFile conflictPkg ignore; do
while read -r conflictFile conflictPkg ignore; do
found=1
conflictRev=${conflictFile#*.so.}
if [ -n "$ignore" -a "$ignore" != "$XBPS_TARGET_MACHINE" ]; then