Package: pbuilder
Version: 0.215

I run pbuilder builds in separate PID namespaces to get a bit of isolation
from the rest of the system.
Unfortantely when running multiple builds in parallel the paths clash
because all pbuilder instances have the same pid and that pid is used
to generate the build path.

A bit of hackish solution I came up with is to use mktemp in simulate
mode to generate a random dirname for BUILDPLACE.
--- a/pbuilder-checkparams
+++ b/pbuilder-checkparams
@@ -279,7 +279,7 @@
 # the default is to add a PID in the buildplace specified in the config file.
 BASEBUILDPLACE="$BUILDPLACE"
 if [ "${INTERNAL_BUILD_UML}" != "yes" -a "${PRESERVE_BUILDPLACE}" != "yes" ]; then
-    BUILDPLACE="$BUILDPLACE/$$"
+    BUILDPLACE="$(mktemp -u -d "$BUILDPLACE/XXXXX")"
 fi
 if [ -z "${CHROOTEXEC}" ]; then
     CHROOTEXEC="chroot $BUILDPLACE "
--- a/pdebuild-checkparams
+++ b/pdebuild-checkparams
@@ -121,7 +121,7 @@
 # the default is to add a PID in the buildplace specified in the config file.
 BASEBUILDPLACE="$BUILDPLACE"
 if [ "${INTERNAL_BUILD_UML}" != "yes" -a "${PRESERVE_BUILDPLACE}" != "yes" ]; then
-    BUILDPLACE="$BUILDPLACE/$$"
+    BUILDPLACE="$(mktemp -p -d "$BUILDPLACE/XXXXXX")"
 fi
 if [ -z "${CHROOTEXEC}" ]; then
     CHROOTEXEC="chroot $BUILDPLACE "

Reply via email to