aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-buildpackage
diff options
context:
space:
mode:
authordancer <dancer>2006-03-17 22:17:16 +0000
committerdancer <dancer>2006-03-17 22:17:16 +0000
commitd4b92213f8340c9ff6917e0dcf2e64d80598f531 (patch)
tree4283adddc669293c2209de6ec357f10016a9b654 /pbuilder-buildpackage
parentfd08e84cf5075d5184eee1baaa7d64fecd1b14b4 (diff)
downloadpbuilder-d4b92213f8340c9ff6917e0dcf2e64d80598f531.tar
pbuilder-d4b92213f8340c9ff6917e0dcf2e64d80598f531.tar.gz
+2006-03-18 Junichi Uekawa <dancer@debian.org>
+ + * pbuilder.8: update documentation of --pkgname-logfile + + * pbuilder-buildpackage: allow chown, and add support for PKGNAME_LOGFILE_EXTENTION. + + * pbuilderrc (PKGNAME_LOGFILE_EXTENTION): add + + * pbuilderrc.5: document +
Diffstat (limited to 'pbuilder-buildpackage')
-rwxr-xr-xpbuilder-buildpackage24
1 files changed, 13 insertions, 11 deletions
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index 1c8d894..e186ec8 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -24,7 +24,6 @@ set -e
. /usr/lib/pbuilder/pbuilder-runhooks
. /usr/lib/pbuilder/pbuilder-buildpackage-funcs
-
PACKAGENAME="$1"
if [ ! -f "$PACKAGENAME" ]; then
echo "Command line parameter [$PACKAGENAME] is not a valid .dsc file name" >&2
@@ -43,6 +42,11 @@ else
BUILDUSERNAME=root
fi
+
+# created files should have these UID/GIDs outside of chroot.
+BUILDRESULTUID="${BUILDRESULTUID:-${SUDO_UID:-0}}"
+BUILDRESULTGID="${BUILDRESULTGID:-${SUDO_GID:-0}}"
+
export HOME="/tmp/buildd"
showbuildbanner '$Id$'
@@ -58,7 +62,7 @@ fi
if [ -z "${PBUILDER_BUILD_LOGFILE}" ]; then
if [ "${USE_PKGNAME_LOGFILE}" = "yes" ]; then
- PBUILDER_BUILD_LOGFILE="${BUILDRESULT}/"$(basename "${PACKAGENAME}" .dsc)
+ PBUILDER_BUILD_LOGFILE="${BUILDRESULT}/"$(basename "${PACKAGENAME}" .dsc)"${PKGNAME_LOGFILE_EXTENTION}"
exec > "${PBUILDER_BUILD_LOGFILE}"
exec 2>&1
PBUILDER_BUILD_LOGFILE=$(readlink -f "${PBUILDER_BUILD_LOGFILE}")
@@ -68,6 +72,13 @@ if [ -z "${PBUILDER_BUILD_LOGFILE}" ]; then
fi
fi
+# make logfile have the permissions, logfiles should already be created in all cases
+if [ -f "${PBUILDER_BUILD_LOGFILE}" ]; then
+ chown "${BUILDRESULTUID}:${BUILDRESULTGID}" "${PBUILDER_BUILD_LOGFILE}"
+ chgrp "${BUILDRESULTGID}" "${PBUILDER_BUILD_LOGFILE}"
+fi
+
+
recover_aptcache
echo "Installing the build-deps"
executehooks "D"
@@ -138,9 +149,6 @@ save_aptcache
trap cleanbuildplace exit
umountproc
-# FIXME: this should be included in pbuilder-checkparams, really.
-BUILDRESULTUID="${BUILDRESULTUID:-${SUDO_UID:-0}}"
-BUILDRESULTGID="${BUILDRESULTGID:-${SUDO_GID:-0}}"
if [ -d "${BUILDRESULT}" ]; then
chown "${BUILDRESULTUID}:${BUILDRESULTGID}" "${BUILDPLACE}"/tmp/buildd/*
@@ -150,10 +158,4 @@ else
echo "E: BUILDRESULT=[$BUILDRESULT] is not a directory." >&2
fi
-# chown/chgrp -- FIXME: this should be higher up, doesn't chmod/chown on failure cases.
-if [ -f "${PBUILDER_BUILD_LOGFILE}" ]; then
- chown "${BUILDRESULTUID}:${BUILDRESULTGID}" "${PBUILDER_BUILD_LOGFILE}"
- chgrp "${BUILDRESULTGID}" "${PBUILDER_BUILD_LOGFILE}"
-fi
-
echobacktime