From f18540f507de4b434c0dfccbcea747654c32b431 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 15 Nov 2008 02:23:43 +0000 Subject: [PATCH] =?utf8?q?Fix=20new*=20and=20do*=20ebuild=20helpers=20to?= =?utf8?q?=20generate=20consistent=20error=20messages=20for=20missing=20fi?= =?utf8?q?les=20and=20generate=20an=20appropriate=20QA=20Notice=20when=20s?= =?utf8?q?uch=20an=20error=20is=20detected=20in=20the=20build=20log.=20Tha?= =?utf8?q?nks=20to=20Diego=20'Flameeyes'=20Petten=C3=B2=20?= =?utf8?q?=20for=20the=20suggestion.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/main/trunk/; revision=11916 --- bin/dobin | 2 +- bin/dodoc | 2 +- bin/doexe | 3 ++- bin/doinfo | 9 ++++++++- bin/doins | 1 + bin/doman | 2 +- bin/domo | 2 +- bin/newbin | 5 +++++ bin/newconfd | 5 +++++ bin/newdoc | 5 +++++ bin/newenvd | 5 +++++ bin/newexe | 5 +++++ bin/newinitd | 5 +++++ bin/newins | 5 +++++ bin/newlib.a | 5 +++++ bin/newlib.so | 5 +++++ bin/newman | 5 +++++ bin/newsbin | 5 +++++ pym/portage/__init__.py | 12 ++++++++++++ 19 files changed, 82 insertions(+), 6 deletions(-) diff --git a/bin/dobin b/bin/dobin index 45cc61d7e..958a37fee 100755 --- a/bin/dobin +++ b/bin/dobin @@ -20,7 +20,7 @@ for x in "$@" ; do if [[ -e ${x} ]] ; then install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/bin" else - vecho "!!! ${0##*/}: ${x} does not exist" 1>&2 + echo "!!! ${0##*/}: $x does not exist" 1>&2 false fi ((ret+=$?)) diff --git a/bin/dodoc b/bin/dodoc index 3b502e920..adf49d04f 100755 --- a/bin/dodoc +++ b/bin/dodoc @@ -20,7 +20,7 @@ for x in "$@" ; do install -m0644 "${x}" "${dir}" ecompress --queue "${dir}/${x##*/}" elif [ ! -e "${x}" ] ; then - echo "dodoc: ${x} does not exist" 1>&2 + echo "!!! ${0##*/}: $x does not exist" 1>&2 ((++ret)) fi done diff --git a/bin/doexe b/bin/doexe index 012e32034..6e72c1c75 100755 --- a/bin/doexe +++ b/bin/doexe @@ -24,5 +24,6 @@ for x in "$@" ; do else mysrc="${x}" fi - install ${EXEOPTIONS} "${mysrc}" "${D}${_E_EXEDESTTREE_}" + install $EXEOPTIONS "$mysrc" "$D$_E_EXEDESTTREE_" || \ + echo "!!! ${0##*/}: $mysrc does not exist" 1>&2 done diff --git a/bin/doinfo b/bin/doinfo index 7e1dd30ca..1c9e7cc07 100755 --- a/bin/doinfo +++ b/bin/doinfo @@ -12,4 +12,11 @@ if [[ ! -d ${D}usr/share/info ]] ; then install -d "${D}usr/share/info" || exit 1 fi -exec install -m0644 "$@" "${D}usr/share/info" +install -m0644 "$@" "${D}usr/share/info" +rval=$? +if [ $rval -ne 0 ] ; then + for x in "$@" ; do + [ -e "$x" ] || echo "!!! ${0##*/}: $x does not exist" 1>&2 + done +fi +exit $rval diff --git a/bin/doins b/bin/doins index 658cb2e5d..8c06bfd9a 100755 --- a/bin/doins +++ b/bin/doins @@ -43,6 +43,7 @@ _doins() { install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}/${mydir}" rval=$? [[ -n ${cleanup} ]] && rm -f "${cleanup}" + [ $rval -ne 0 ] && echo "!!! ${0##*/}: $mysrc does not exist" 1>&2 return $rval } diff --git a/bin/doman b/bin/doman index c8d34ee5e..48abc39fd 100755 --- a/bin/doman +++ b/bin/doman @@ -50,7 +50,7 @@ for x in "$@" ; do install -m0644 "${x}" "${D}/usr/share/man/${mandir}/${name}" ((ret+=$?)) elif [[ ! -e ${x} ]] ; then - vecho "doman: ${x} does not exist" 1>&2 + echo "!!! ${0##*/}: $x does not exist" 1>&2 ((++ret)) fi else diff --git a/bin/domo b/bin/domo index 213b43c59..a7ba5775a 100755 --- a/bin/domo +++ b/bin/domo @@ -21,6 +21,6 @@ for x in "$@" ; do fi install -m0644 "${x}" "${mydir}/${MOPREFIX}.mo" else - echo "${0}: ${x} does not exist" + echo "!!! ${0##*/}: $x does not exist" 1>&2 fi done diff --git a/bin/newbin b/bin/newbin index 8e2185b29..905b2802e 100755 --- a/bin/newbin +++ b/bin/newbin @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec dobin "${T}/${2}" diff --git a/bin/newconfd b/bin/newconfd index 4b1e8e7b3..6d57a343c 100755 --- a/bin/newconfd +++ b/bin/newconfd @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec doconfd "${T}/${2}" diff --git a/bin/newdoc b/bin/newdoc index 757c8214e..331bf0d02 100755 --- a/bin/newdoc +++ b/bin/newdoc @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec dodoc "${T}/${2}" diff --git a/bin/newenvd b/bin/newenvd index 464084719..2c03e3738 100755 --- a/bin/newenvd +++ b/bin/newenvd @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec doenvd "${T}/${2}" diff --git a/bin/newexe b/bin/newexe index 7712644d7..32d7d9293 100755 --- a/bin/newexe +++ b/bin/newexe @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec doexe "${T}/${2}" diff --git a/bin/newinitd b/bin/newinitd index 6873771c3..7ab89ae0b 100755 --- a/bin/newinitd +++ b/bin/newinitd @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec doinitd "${T}/${2}" diff --git a/bin/newins b/bin/newins index 7735fc33c..f235835a2 100755 --- a/bin/newins +++ b/bin/newins @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" || exit $? cp -f "${1}" "${T}/${2}" || exit $? doins "${T}/${2}" diff --git a/bin/newlib.a b/bin/newlib.a index 008aca966..ddcb1af25 100755 --- a/bin/newlib.a +++ b/bin/newlib.a @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec dolib.a "${T}/${2}" diff --git a/bin/newlib.so b/bin/newlib.so index 5ea2e33b4..eb23d2675 100755 --- a/bin/newlib.so +++ b/bin/newlib.so @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec dolib.so "${T}/${2}" diff --git a/bin/newman b/bin/newman index 4ae4fdb7c..2d278aedd 100755 --- a/bin/newman +++ b/bin/newman @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec doman "${T}/${2}" diff --git a/bin/newsbin b/bin/newsbin index 8adeee409..cfe754501 100755 --- a/bin/newsbin +++ b/bin/newsbin @@ -8,6 +8,11 @@ if [[ -z ${T} ]] || [[ -z ${2} ]] ; then exit 1 fi +if [ ! -e "$1" ] ; then + echo "!!! ${0##*/}: $1 does not exist" 1>&2 + exit 1 +fi + rm -rf "${T}/${2}" && \ cp -f "${1}" "${T}/${2}" && \ exec dosbin "${T}/${2}" diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 8c8c99ebc..8dcd8a0c8 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -4502,6 +4502,9 @@ def _check_build_log(mysettings, out=None): bash_command_not_found = [] bash_command_not_found_re = re.compile( r'(.*): line (\d*): (.*): command not found$') + helper_missing_file = [] + helper_missing_file_re = re.compile( + r'^!!! (do|new).*: .* does not exist$') configure_opts_warn = [] configure_opts_warn_re = re.compile( @@ -4518,6 +4521,9 @@ def _check_build_log(mysettings, out=None): if bash_command_not_found_re.match(line) is not None: bash_command_not_found.append(line.rstrip("\n")) + if helper_missing_file_re.match(line) is not None: + helper_missing_file.append(line.rstrip("\n")) + if configure_opts_warn_re.match(line) is not None: configure_opts_warn.append(line.rstrip("\n")) finally: @@ -4554,6 +4560,12 @@ def _check_build_log(mysettings, out=None): msg.extend("\t" + line for line in bash_command_not_found) _eqawarn(msg) + if helper_missing_file: + msg = ["QA Notice: file does not exist:"] + msg.append("") + msg.extend("\t" + line[4:] for line in helper_missing_file) + _eqawarn(msg) + if configure_opts_warn: msg = ["QA Notice: Unrecognized configure options:"] msg.append("") -- 2.26.2