diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-11-15 02:23:43 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-11-15 02:23:43 +0000 |
commit | f18540f507de4b434c0dfccbcea747654c32b431 (patch) | |
tree | 74217d628380712cbae387ffc27ad1ecd9138850 | |
parent | 420a428b6e59afd5e5743c8ac9b19a281410e9f1 (diff) | |
download | portage-f18540f507de4b434c0dfccbcea747654c32b431.tar.gz portage-f18540f507de4b434c0dfccbcea747654c32b431.tar.bz2 portage-f18540f507de4b434c0dfccbcea747654c32b431.zip |
Fix new* and do* ebuild helpers to generate consistent error messages for
missing files and generate an appropriate QA Notice when such an error is
detected in the build log. Thanks to Diego 'Flameeyes' Pettenò <flameeyes@g.o>
for the suggestion.
svn path=/main/trunk/; revision=11916
-rwxr-xr-x | bin/dobin | 2 | ||||
-rwxr-xr-x | bin/dodoc | 2 | ||||
-rwxr-xr-x | bin/doexe | 3 | ||||
-rwxr-xr-x | bin/doinfo | 9 | ||||
-rwxr-xr-x | bin/doins | 1 | ||||
-rwxr-xr-x | bin/doman | 2 | ||||
-rwxr-xr-x | bin/domo | 2 | ||||
-rwxr-xr-x | bin/newbin | 5 | ||||
-rwxr-xr-x | bin/newconfd | 5 | ||||
-rwxr-xr-x | bin/newdoc | 5 | ||||
-rwxr-xr-x | bin/newenvd | 5 | ||||
-rwxr-xr-x | bin/newexe | 5 | ||||
-rwxr-xr-x | bin/newinitd | 5 | ||||
-rwxr-xr-x | bin/newins | 5 | ||||
-rwxr-xr-x | bin/newlib.a | 5 | ||||
-rwxr-xr-x | bin/newlib.so | 5 | ||||
-rwxr-xr-x | bin/newman | 5 | ||||
-rwxr-xr-x | bin/newsbin | 5 | ||||
-rw-r--r-- | pym/portage/__init__.py | 12 |
19 files changed, 82 insertions, 6 deletions
@@ -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+=$?)) @@ -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 @@ -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 @@ -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 } @@ -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 @@ -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("") |