exit 1
}
+set -x
export
if [ "$REQUEST_ID" = "" ] ; then
#
# build liveboot
-#
-sudo pbuilder --execute --bindmounts /srv/build/ -- $BUILD_SCRIPT
-rm $BUILD_SCRIPT
+# (sudo is called from within a(nother) script as it's not possible to trap sudo directly
+#
+echo "sudo pbuilder --execute --bindmounts /srv/build/ -- $BUILD_SCRIPT" > ${BUILD_SCRIPT}_sudo
+bash -x ${BUILD_SCRIPT}_sudo
+rm $BUILD_SCRIPT ${BUILD_SCRIPT}_sudo
#
# add liveboot build result to cidb