diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-10-24 20:21:41 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-10-24 20:21:41 -0700 |
commit | f48625c547398ee5f92d33e16b1a837c3c595ae9 (patch) | |
tree | 3976ce87e11f42dca2211780bb2d1b267a2080ea | |
parent | 5ebd980500d788ec6adfe2d004d22f954e5ab54d (diff) | |
download | portage-f48625c547398ee5f92d33e16b1a837c3c595ae9.tar.gz portage-f48625c547398ee5f92d33e16b1a837c3c595ae9.tar.bz2 portage-f48625c547398ee5f92d33e16b1a837c3c595ae9.zip |
Use checkbashisms for init.d scripts, bug #439490
-rwxr-xr-x | bin/misc-functions.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 9b280588c..db023e48a 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -558,6 +558,23 @@ install_qa_check() { done done + local checkbashisms=$(type -P checkbashisms) + if [[ -n ${checkbashisms} ]] ; then + for d in /etc/init.d ; do + [[ -d ${ED}${d} ]] || continue + for i in "${ED}${d}"/* ; do + [[ -e ${i} ]] || continue + [[ -L ${i} ]] && continue + f=$("${checkbashisms}" -f "${i}" 2>&1) + [[ $? != 0 && -n ${f} ]] || continue + eqawarn "QA Notice: shell script appears to use non-POSIX feature(s):" + while read -r ; + do eqawarn " ${REPLY}" + done <<< "${f//${ED}}" + done + done + fi + # Look for leaking LDFLAGS into pkg-config files f=$(egrep -sH '^Libs.*-Wl,(-O[012]|--hash-style)' "${ED}"/usr/*/pkgconfig/*.pc) if [[ -n ${f} ]] ; then |