Commit ad50ac00 authored by Mattia Rizzolo's avatar Mattia Rizzolo

import 0.125+nmu3

parent 93574091
......@@ -58,6 +58,7 @@ PKGLIB_SCRIPTS += \
pbuilder-satisfydepends-gdebi \
pbuilder-selftest \
pbuilder-uml-checkparams \
pbuilder-unshare-wrapper \
pbuilder-updatebuildenv \
pdebuild-checkparams \
pdebuild-internal \
......
pbuilder (0.215+nmu3) unstable; urgency=low
* Non-maintainer upload.
* Enable the loopback device even when USE_NETWORK=no (Closes: #753944)
Patch based on one provided by Niko Tyni; thanks! This also allows
getting rid of the env hack and disabling network for pre-squeeze
chroot by setting the new namespace up before chrooting.
-- Thorsten Glaser <tg@mirbsd.de> Fri, 11 Jul 2014 19:56:53 +0200
pbuilder (0.215+nmu2) unstable; urgency=low
* Fix missing space, thanks gregoa for spotting (Closes: #753690)
......
......@@ -27,6 +27,7 @@ Depends: coreutils (>= 4.5.8-1),
wget,
${misc:Depends}
Recommends: fakeroot,
net-tools | iproute2,
sudo,
devscripts
Suggests: pbuilder-uml,
......
......@@ -37,7 +37,7 @@ if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then
# environment, so cowdancer shouldn't have to run, and fakeroot
# should be running later, so it shouldn't matter.
# LOGNAME: set this to shut up some tools.
SUTOUSER=" env LD_PRELOAD= LOGNAME=$BUILDUSERNAME /sbin/start-stop-daemon --start --pidfile /dev/null --chuid $BUILDUSERNAME --startas /bin/sh"
SUTOUSER="LD_PRELOAD= LOGNAME=$BUILDUSERNAME /sbin/start-stop-daemon --start --pidfile /dev/null --chuid $BUILDUSERNAME --startas /bin/sh"
DEBBUILDOPTS="${DEBBUILDOPTS:+$DEBBUILDOPTS }-rfakeroot"
EXTRAPACKAGES="${EXTRAPACKAGES} fakeroot"
log "I: using fakeroot in build."
......@@ -45,9 +45,10 @@ else
# run the build in root
BUILDUSERID=0
BUILDUSERNAME=root
SUTOUSER=" env LOGNAME=$BUILDUSERNAME /bin/sh"
SUTOUSER="LOGNAME=$BUILDUSERNAME /bin/sh"
fi
UNSHARE=
case $USENETWORK in
yes)
if [ "$DEB_BUILD_ARCH_OS" = "linux" ]; then
......@@ -56,9 +57,9 @@ yes)
fi
;;
*)
if $CHROOTEXEC /usr/bin/unshare -n true; then
if /usr/bin/unshare -n -- /usr/lib/pbuilder/pbuilder-unshare-wrapper true; then
USENETWORK=no
SUTOUSER="/usr/bin/unshare -n -- $SUTOUSER"
UNSHARE="/usr/bin/unshare -n -- /usr/lib/pbuilder/pbuilder-unshare-wrapper"
log "I: pbuilder: network access will be disabled during build"
else
USENETWORK=yes
......@@ -115,7 +116,7 @@ recover_aptcache
createbuilduser
CCACHE_ENV=
setup_ccache
SUTOUSER=${SUTOUSER/ env / env $CCACHE_ENV }
SUTOUSER="$CCACHE_ENV $SUTOUSER"
log "I: Installing the build-deps"
executehooks "D"
trap saveaptcache_umountproc_cleanbuildplace_trap exit sighup sigpipe
......@@ -134,7 +135,7 @@ else
log "E: pbuilder: Failed chowning to $BUILDUSERNAME:$BUILDUSERNAME"
exit 1;
fi
if echo "( cd tmp/buildd; env PATH=\"$PATH\" /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )" | $CHROOTEXEC $SUTOUSER ; then
if echo "( cd tmp/buildd; env PATH=\"$PATH\" /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )" | $UNSHARE $CHROOTEXEC env $SUTOUSER ; then
: # success
else
log "E: pbuilder: Failed extracting the source"
......@@ -154,7 +155,7 @@ DPKG_COMMANDLINE="env PATH=\"$PATH\" dpkg-buildpackage -us -uc ${DEBEMAIL:+\"-e$
fi
DPKG_COMMANDLINE="cd tmp/buildd/*/ && $DPKG_COMMANDLINE"
log "I: Running $DPKG_COMMANDLINE"
echo "$DPKG_COMMANDLINE" | $CHROOTEXEC $SUTOUSER
echo "$DPKG_COMMANDLINE" | $UNSHARE $CHROOTEXEC env $SUTOUSER
) &
BUILD_PID=$!
if [ -n "${TIMEOUT_TIME}" ]; then
......
#!/bin/sh
die() {
echo >&@ E: $2 returned error code $1
echo >&2 N: Could not set up the loopback interface.
exit 1
}
if test -x /sbin/ifconfig; then
/sbin/ifconfig lo up || die $? ifconfig
elif test -x /sbin/ip; then
/sbin/ip link set lo up || die $? ip
elif test -x /bin/ip; then
/bin/ip link set lo up || die $? ip
else
echo >&2 E: Neither ifconfig nor ip found.
echo >&2 N: Could not set up the loopback interface.
exit 1
fi
exec "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment