Fix new* and do* ebuild helpers to generate consistent error messages for
authorZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 02:25:05 +0000 (02:25 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 02:25:05 +0000 (02:25 -0000)
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. (trunk r11916)

svn path=/main/branches/2.1.6/; revision=11917

19 files changed:
bin/dobin
bin/dodoc
bin/doexe
bin/doinfo
bin/doins
bin/doman
bin/domo
bin/newbin
bin/newconfd
bin/newdoc
bin/newenvd
bin/newexe
bin/newinitd
bin/newins
bin/newlib.a
bin/newlib.so
bin/newman
bin/newsbin
pym/portage/__init__.py

index 45cc61d7e231a01d2a15ebb60ce4fc22919a3e0b..958a37feeeb39387018bd7f1bd892062328851fe 100755 (executable)
--- 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+=$?))
index 3b502e9202690cd522c1276c0e6abe942c50ad5c..adf49d04f79c7f930b927fa3d114b2731ce1eb60 100755 (executable)
--- 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
index 012e320345ffbd987a4e0ea858f23de63e1a2690..6e72c1c7541e7d83b0be062b4494a2a8473e92bc 100755 (executable)
--- 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
index 7e1dd30ca8736aa6b3c3807afff931522926340a..1c9e7cc07f6beac82b680d818dd5b7a7694b3a51 100755 (executable)
@@ -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
index 658cb2e5dbd28836adaa676a48ad9c434ba22573..8c06bfd9ae298a81b55c279ce4f7c2128af7a0ba 100755 (executable)
--- 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
 }
 
index c8d34ee5ee4fa4f26c559b946cffb1f8f17ce810..48abc39fd1eae00f01ebf3e22caea86734d71dca 100755 (executable)
--- 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
index 213b43c596df9c4f2a8cdf46e85ff9431ee70575..a7ba5775a9564b19afaffb86cc25a038d730fad7 100755 (executable)
--- 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
index 8e2185b297be3dbf560d34dc8980727d76d2eded..905b2802e04cb40855a0ac33c786f445b0d16469 100755 (executable)
@@ -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}"
index 4b1e8e7b3f3a3f5b83c1ad5034b4505e3b685f21..6d57a343ccfed01678b631612b61ee33163fa829 100755 (executable)
@@ -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}"
index 757c8214e5f11b77a77f19fceabed36f8fcb339d..331bf0d02c95e25b1770a2c8c014185ebc5fd992 100755 (executable)
@@ -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}"
index 464084719af5847ece4c374d559cfde45fa26159..2c03e3738e0723a87aaf2781e9749fca485dedaa 100755 (executable)
@@ -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}"
index 7712644d7f50f76907f0f2ddc250e6c217a6bbf5..32d7d9293dbd860f8dfd3adc513e5b72e3e6c53c 100755 (executable)
@@ -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}"
index 6873771c378abd9a6ae147bba22dc99590c8883d..7ab89ae0be663ed36244c42bcf358ef62f18d30f 100755 (executable)
@@ -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}"
index 7735fc33cf7fbc261efcf19d2c584abb78db825f..f235835a275c3ab16166f7088473bd267a80a2fd 100755 (executable)
@@ -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}"
index 008aca966a2751b3e816ef1bc7a21a8d700a32ce..ddcb1af251991d266c388c4815f18b934cb883e6 100755 (executable)
@@ -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}"
index 5ea2e33b481a1c4e5307b1cf58d972b3f2d84f5a..eb23d267517865533a22785ec5aaba75b900f16c 100755 (executable)
@@ -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}"
index 4ae4fdb7cd5999217d8b99f65f13d26c696a3200..2d278aedd0c334a4ba961a973193bf3c9f031290 100755 (executable)
@@ -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}"
index 8adeee4092170c1e7f2998b2f43308181c2f24a4..cfe754501a660a12a5f66424c02b01c30ccd0c7c 100755 (executable)
@@ -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}"
index ea188d44ec39a5eaf2f541993cbd456789a71092..47751a3b6845a2dbd94f0dd2173e8b00752215e6 100644 (file)
@@ -4492,6 +4492,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(
@@ -4508,6 +4511,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:
@@ -4544,6 +4550,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("")