aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-buildpackage
diff options
context:
space:
mode:
authordancer <dancer>2005-07-13 22:02:20 +0000
committerdancer <dancer>2005-07-13 22:02:20 +0000
commit417fe5eb1c122390ca9e9ed41fc3aa2786b24248 (patch)
tree27c92d09cba50450a90e9c57f45f6bbbe18500e3 /pbuilder-buildpackage
parent529189bf4f365be70fc15ba369440855f80a5cce (diff)
downloadpbuilder-417fe5eb1c122390ca9e9ed41fc3aa2786b24248.tar
pbuilder-417fe5eb1c122390ca9e9ed41fc3aa2786b24248.tar.gz
* pbuilder-buildpackage: change the use of su, to
allow su design change. Bug: 317264
Diffstat (limited to 'pbuilder-buildpackage')
-rwxr-xr-xpbuilder-buildpackage17
1 files changed, 13 insertions, 4 deletions
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index 2d6a7b2..71c2c91 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -31,14 +31,15 @@ if [ ! -f "$PACKAGENAME" ]; then
exit 1;
fi;
+# due to
if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then
- SUTOUSER="su -p $BUILDUSERNAME -- "
+ SUTOUSER="su -p $BUILDUSERNAME"
DEBBUILDOPTS="$DEBBUILDOPTS -rfakeroot"
EXTRAPACKAGES="${EXTRAPACKAGES} fakeroot"
echo "I: using fakeroot in build."
else
# run the build in root
- SUTOUSER=""
+ SUTOUSER="su "
BUILDUSERID=0
BUILDUSERNAME=root
fi
@@ -81,7 +82,15 @@ echo "Copying source file"
copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd"
echo "Extracting source"
-if ! $CHROOTEXEC /bin/bash -c "( cd tmp/buildd; chown $BUILDUSERNAME:$BUILDUSERNAME ../buildd *; $SUTOUSER /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )"; then
+if echo "chown $BUILDUSERNAME:$BUILDUSERNAME /tmp/buildd /tmp/buildd/*" | $CHROOTEXEC /bin/bash; then
+ : # success
+else
+ echo "pbuilder: Failed chowning to $BUILDUSERNAME:$BUILDUSERNAME" >&2
+ exit 1;
+fi
+if echo "( cd tmp/buildd; /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )" | $CHROOTEXEC $SUTOUSER ; then
+ : # success
+else
echo "pbuilder: Failed extracting the source" >&2
exit 1;
fi
@@ -98,7 +107,7 @@ fi
(
: Build process
- echo "${DPKG_COMMANDLINE}" | $CHROOTEXEC $SUTOUSER /bin/bash
+ echo "${DPKG_COMMANDLINE}" | $CHROOTEXEC $SUTOUSER
) &
BUILD_PID=$!
if [ -n "${TIMEOUT_TIME}" ]; then