summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-15 02:25:05 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-15 02:25:05 +0000
commit22532ec8c8a030d4d513947a2ad12e0eab5e61cd (patch)
tree73560dd0f61931f4492942c450075c78582e29dd
parentf2c053b8516155d9e4b1e866e67c0c24c0702573 (diff)
downloadportage-22532ec8c8a030d4d513947a2ad12e0eab5e61cd.tar.gz
portage-22532ec8c8a030d4d513947a2ad12e0eab5e61cd.tar.bz2
portage-22532ec8c8a030d4d513947a2ad12e0eab5e61cd.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. (trunk r11916) svn path=/main/branches/2.1.6/; revision=11917
-rwxr-xr-xbin/dobin2
-rwxr-xr-xbin/dodoc2
-rwxr-xr-xbin/doexe3
-rwxr-xr-xbin/doinfo9
-rwxr-xr-xbin/doins1
-rwxr-xr-xbin/doman2
-rwxr-xr-xbin/domo2
-rwxr-xr-xbin/newbin5
-rwxr-xr-xbin/newconfd5
-rwxr-xr-xbin/newdoc5
-rwxr-xr-xbin/newenvd5
-rwxr-xr-xbin/newexe5
-rwxr-xr-xbin/newinitd5
-rwxr-xr-xbin/newins5
-rwxr-xr-xbin/newlib.a5
-rwxr-xr-xbin/newlib.so5
-rwxr-xr-xbin/newman5
-rwxr-xr-xbin/newsbin5
-rw-r--r--pym/portage/__init__.py12
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 ea188d44e..47751a3b6 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -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("")