Package: pbuilder
Version: 0.230.4
Severity: normal

Hi,

if ADDITIONAL_BUILDRESULTS is set and log level is set to debug mode
(`LOGLEVEL=D`), then pbuilder iterates over the debug output, e.g.:

| I: copying local configuration
| E: Failed autobuilding of package
| I: Trying to save additional result 'D:'
| cp: cannot stat 'D:': No such file or directory
| I: Trying to save additional result 'checking'
| cp: cannot stat 'checking': No such file or directory
| I: Trying to save additional result '[../*lintian.txt]...'
| cp: cannot stat '[../*lintian.txt]...': No such file or directory
| I: Trying to save additional result 'D:'
| cp: cannot stat 'D:': No such file or directory
| I: Trying to save additional result 'checking'
| cp: cannot stat 'checking': No such file or directory
| I: Trying to save additional result '[../*lintian.txt]...'
| cp: cannot stat '[../*lintian.txt]...': No such file or directory

The underlying reason is, that the export_additional_buildresults
function relies on output of the _find_additional_buildresults
helper function. The _find_additional_buildresults function outputs its
logging on stdout as well though, so when "log.d" is executed (which
it is under LOGLEVEL=D), then export_additional_buildresults()
operates on unexpected data.

Quoting the relevant code snippet from pbuilder-buildpackage-funcs:

| function _find_additional_buildresults() {
|     local file f
|     local root="${BUILDPLACE}${BUILDDIR}/${BUILDSUBDIR}"
|     for file in "${ADDITIONAL_BUILDRESULTS[@]}"; do
|         log.d "checking [$file]..."
|         echo "$root/$file" | perl -ne 'print "$_\n" foreach glob($_)' | \
|         while read f ; do
|             if [ -e "$f" ]; then
|                 echo "$f"
|             else
|                 log.w "file [$file] not found"
|             fi
|         done
|     done
| }
|
| function export_additional_buildresults() {
|     local file
|     for file in $(_find_additional_buildresults); do
|         log.i "Trying to save additional result '${file}'"
|         cp -a "${file}" "${BUILDRESULT}" || true
|     done
| }

regards
-mika-

Reply via email to