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 rm -f ${PKGDESTDIR}/usr/share/info/dir
fi fi
find ${PKGDESTDIR}/usr/share/info -type f -follow | while read f find ${PKGDESTDIR}/usr/share/info -type f -follow | while read -r f; do
do
j=$(echo "$f"|sed -e "$fpattern") j=$(echo "$f"|sed -e "$fpattern")
[ "$j" = "" ] && continue [ "$j" = "" ] && continue
[ "$j" = "/usr/share/info/dir" ] && continue [ "$j" = "/usr/share/info/dir" ] && continue

View file

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

View file

@ -2,7 +2,7 @@
hook() { hook() {
if [ -d "${PKGDESTDIR}" ]; then 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}}" _dir="${f##${PKGDESTDIR}}"
msg_warn "$pkgver: removed empty dir: ${_dir}\n" msg_warn "$pkgver: removed empty dir: ${_dir}\n"
done done

View file

@ -65,7 +65,7 @@ hook() {
STRIPCMD=/usr/bin/$STRIP 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 if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
continue continue
fi fi

View file

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

View file

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