From 65c9ade5e44afcf8040f5459e59b9f3819879fca Mon Sep 17 00:00:00 2001 From: Duncaen Date: Thu, 31 Aug 2023 14:17:24 +0200 Subject: xbps-src: consistently use read -r when reading file paths --- common/hooks/post-install/00-compress-info-files.sh | 3 +-- common/hooks/post-install/00-uncompress-manpages.sh | 3 +-- common/hooks/post-install/03-remove-empty-dirs.sh | 2 +- common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +- common/hooks/pre-pkg/04-generate-runtime-deps.sh | 2 +- common/hooks/pre-pkg/99-pkglint.sh | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/common/hooks/post-install/00-compress-info-files.sh b/common/hooks/post-install/00-compress-info-files.sh index ee394a8c901..0a1bec5360c 100644 --- a/common/hooks/post-install/00-compress-info-files.sh +++ b/common/hooks/post-install/00-compress-info-files.sh @@ -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 diff --git a/common/hooks/post-install/00-uncompress-manpages.sh b/common/hooks/post-install/00-uncompress-manpages.sh index c7a4e470157..3c0d2e2392e 100644 --- a/common/hooks/post-install/00-uncompress-manpages.sh +++ b/common/hooks/post-install/00-uncompress-manpages.sh @@ -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 diff --git a/common/hooks/post-install/03-remove-empty-dirs.sh b/common/hooks/post-install/03-remove-empty-dirs.sh index c54f458f61e..06354fc7f5c 100644 --- a/common/hooks/post-install/03-remove-empty-dirs.sh +++ b/common/hooks/post-install/03-remove-empty-dirs.sh @@ -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 diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh index 191c025e552..b6bd52320dc 100644 --- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh +++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh @@ -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 diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh index e2020ce05f7..f9cef1395fd 100644 --- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh +++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh @@ -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" diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh index a3ed816ed6e..30d97fcda40 100644 --- a/common/hooks/pre-pkg/99-pkglint.sh +++ b/common/hooks/pre-pkg/99-pkglint.sh @@ -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 -- cgit v1.2.3