Package: pbuilder
Version: 0.204
Severity: wishlist
Tags: patch

Hi,
I needed to nose's nosetests.xml and coverage file out of the build
directory so it can be consumed by Jenkins to display the test results. 

Attached patch allows for this by introducing $ADDITIONAL_BUILDRESULT
which can be set to a file list to be copied out of the builddir. This
might need some tweaking before it can be applied but I wanted to get
some feedback first whether this is the right way to go?

Cheers,
 -- Guido


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (50, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.1.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pbuilder depends on:
ii  cdebootstrap           0.5.8+b1
ii  coreutils              8.13-3
ii  debconf [debconf-2.0]  1.5.41
ii  debianutils            4.1
ii  debootstrap            1.0.38
ii  wget                   1.13.4-1

Versions of packages pbuilder recommends:
ii  devscripts  2.11.2
ii  fakeroot    1.18.2-1
ii  sudo        1.8.3p1-2

Versions of packages pbuilder suggests:
pn  cowdancer     0.66
pn  gdebi-core    <none>
pn  pbuilder-uml  <none>

-- debconf information excluded
>From ff5de7c5ca47f92d47ed755348702f173484c513 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <a...@sigxcpu.org>
Date: Mon, 19 Dec 2011 13:31:59 +0100
Subject: [PATCH] Add ADDITIONAL_BUILDRESULT variable

this can be used to copy additional build results out of the build
directory. This is useful to e.g. preserve a xml testresult file when
using a build system like Jenkins.
---
 pbuilder-buildpackage |    6 ++++++
 pdebuild              |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index b711934..580bb66 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -171,6 +171,12 @@ if [ -d "${BUILDRESULT}" ]; then
 	    cp -p ${FILE} "${BUILDRESULT}" || true
 	fi
     done
+    if [ -n "${ADDITIONAL_BUILDRESULT}" ]; then
+	echo "Saving additional results ${ADDITIONAL_BUILDRESULT}"
+	for FILE in ${ADDITIONAL_BUILDRESULT}; do
+	    cp -a "${BUILDPLACE}/tmp/buildd/*/${FILE}" "${BUILDRESULT}"
+	done
+    fi
 else
     log "E: BUILDRESULT=[$BUILDRESULT] is not a directory."
 fi
diff --git a/pdebuild b/pdebuild
index 2bfe858..149f8ab 100644
--- a/pdebuild
+++ b/pdebuild
@@ -50,6 +50,12 @@ if [ "${USE_PDEBUILD_INTERNAL}" = 'yes' ]; then
 	    conditional_cp_a ../"$files" "${BUILDRESULT}"
 	done
 	conditional_cp_a ../${CHANGES} "${BUILDRESULT}"
+	if [ -n "${ADDITIONAL_BUILDRESULT}" ]; then
+	    echo "Saving additional results ${ADDITIONAL_BUILDRESULT}"
+	    for FILE in ${ADDITIONAL_BUILDRESULT}; do
+		conditional_cp_a "${FILE}" "${BUILDRESULT}"
+            done
+	fi
     else
 	log "E: BUILDRESULT=[$BUILDRESULT] is not a directory."
 	exit 1
-- 
1.7.7.3

Reply via email to