From 2d36ccae3e834632a69d1f51e627722d7af0b16c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 29 Dec 2010 10:28:25 -0800 Subject: bash: as a general rule, use read -r This solves cases like bug #350045. --- bin/ebuild-helpers/ecompressdir | 4 ++-- bin/ebuild-helpers/prepallman | 2 +- bin/ebuild-helpers/prepinfo | 2 +- bin/ebuild.sh | 4 ++-- bin/emerge-webrsync | 2 +- bin/etc-update | 2 +- bin/misc-functions.sh | 8 ++++---- mkrelease.sh | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/ebuild-helpers/ecompressdir b/bin/ebuild-helpers/ecompressdir index 7ed2627e3..7a95120a9 100755 --- a/bin/ebuild-helpers/ecompressdir +++ b/bin/ebuild-helpers/ecompressdir @@ -63,7 +63,7 @@ funk_up_dir() { ((ret|=$?)) find "${dir}" -type l -print0 | \ - while read -d $'\0' brokenlink ; do + while read -r -d $'\0' brokenlink ; do [[ -e ${brokenlink} ]] && continue olddest=$(readlink "${brokenlink}") [[ ${act} == "compress" ]] \ @@ -86,7 +86,7 @@ _relocate_skip_dirs() { [[ -d ${srctree} ]] || return 0 find "${srctree}" -name '*.ecompress.skip' -print0 | \ - while read -d $'\0' src ; do + while read -r -d $'\0' src ; do src=${src%.ecompress.skip} dst="${dsttree}${src#${srctree}}" parent=${dst%/*} diff --git a/bin/ebuild-helpers/prepallman b/bin/ebuild-helpers/prepallman index 4568bac1d..574ab6251 100755 --- a/bin/ebuild-helpers/prepallman +++ b/bin/ebuild-helpers/prepallman @@ -10,7 +10,7 @@ hasq "${EAPI}" 0 1 2 3 || exit 0 ret=0 find "${D}" -type d -name man > "${T}"/prepallman.filelist -while read mandir ; do +while read -r mandir ; do mandir=${mandir#${D}} prepman "${mandir%/man}" ((ret|=$?)) diff --git a/bin/ebuild-helpers/prepinfo b/bin/ebuild-helpers/prepinfo index cbbba3ed0..9552923a3 100755 --- a/bin/ebuild-helpers/prepinfo +++ b/bin/ebuild-helpers/prepinfo @@ -23,7 +23,7 @@ if [[ ! -d ${D}${infodir} ]] ; then fi fi -find "${D}${infodir}" -type d -print0 | while read -d $'\0' x ; do +find "${D}${infodir}" -type d -print0 | while read -r -d $'\0' x ; do for f in "${x}"/.keepinfodir*; do [[ -e ${f} ]] && continue 2 done diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 4daa07610..e88f0158d 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -504,7 +504,7 @@ econf() { if [ -e /usr/share/gnuconfig/ ]; then find "${WORKDIR}" -type f '(' \ -name config.guess -o -name config.sub ')' -print0 | \ - while read -d $'\0' x ; do + while read -r -d $'\0' x ; do vecho " * econf: updating ${x/${WORKDIR}\/} with /usr/share/gnuconfig/${x##*/}" cp -f /usr/share/gnuconfig/"${x##*/}" "${x}" done @@ -1324,7 +1324,7 @@ inherit() { echo "QA Notice: EXPORT_FUNCTIONS is called before inherit in" \ "$ECLASS.eclass. For compatibility with <=portage-2.1.6.7," \ "only call EXPORT_FUNCTIONS after inherit(s)." \ - | fmt -w 75 | while read ; do eqawarn "$REPLY" ; done + | fmt -w 75 | while read -r ; do eqawarn "$REPLY" ; done fi local location diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index e3ec5f639..195a3de22 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -378,7 +378,7 @@ do_latest_snapshot() { "use the --revert option or remove" \ "the timestamp file located at" \ "'${PORTDIR}/metadata/timestamp.x'." | fmt -w 70 | \ - while read line ; do + while read -r line ; do ewarn "${line}" done r=0 diff --git a/bin/etc-update b/bin/etc-update index e64ef493b..03e9dc9fe 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -206,7 +206,7 @@ user_special() { echo "ERROR: user_special() called without arguments" return 1 fi - while read pat; do + while read -r pat; do echo ${1} | grep "${pat}" > /dev/null && return 0 done < ${PORTAGE_CONFIGROOT}etc/etc-update.special fi diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 7ad7c0d52..46be5011c 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -322,7 +322,7 @@ install_qa_check() { fi # Save NEEDED information after removing self-contained providers - scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS= read l; do + scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS= read -r l; do arch=${l%%;*}; l=${l#*;} obj="/${l%%;*}"; l=${l#*;} soname=${l%%;*}; l=${l#*;} @@ -664,7 +664,7 @@ install_qa_check() { echo "Please do not file a Gentoo bug and instead" \ "report the above QA issues directly to the upstream" \ "developers of this software." | fmt -w 70 | \ - while read line ; do eqawarn "${line}" ; done + while read -r line ; do eqawarn "${line}" ; done eqawarn "Homepage: ${HOMEPAGE}" hasq stricter ${FEATURES} && die "install aborted due to" \ "poor programming practices shown above" @@ -774,7 +774,7 @@ preinst_sfperms() { if hasq sfperms $FEATURES; then local i find "${D}" -type f -perm -4000 -print0 | \ - while read -d $'\0' i ; do + while read -r -d $'\0' i ; do if [ -n "$(find "$i" -perm -2000)" ] ; then ebegin ">>> SetUID and SetGID: [chmod o-r] /${i#${D}}" chmod o-r "$i" @@ -786,7 +786,7 @@ preinst_sfperms() { fi done find "${D}" -type f -perm -2000 -print0 | \ - while read -d $'\0' i ; do + while read -r -d $'\0' i ; do if [ -n "$(find "$i" -perm -4000)" ] ; then # This case is already handled # by the SetUID check above. diff --git a/mkrelease.sh b/mkrelease.sh index c1890e443..e8fb98dc8 100755 --- a/mkrelease.sh +++ b/mkrelease.sh @@ -79,7 +79,7 @@ else git_log_opts+=" $TREE_ISH" fi skip_next=false -git log $git_log_opts | fmt -w 80 -p " " | while read ; do +git log $git_log_opts | fmt -w 80 -p " " | while read -r ; do if [[ $skip_next = true ]] ; then skip_next=false elif [[ $REPLY = " svn path="* ]] ; then -- cgit v1.2.3-1-g7c22