Copy debootstrap.log on failure

This commit is contained in:
Serge Schneider 2021-06-22 15:48:09 +01:00
parent d562f2a35b
commit f9d44edb72

View file

@ -21,8 +21,10 @@ bootstrap(){
setarch linux32 capsh --drop=cap_setfcap -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true
if [ -d "$2/debootstrap" ]; then
rmdir "$2/debootstrap"
if [ -d "$2/debootstrap" ] && ! rmdir "$2/debootstrap"; then
cp "$2/debootstrap/debootstrap.log" "${STAGE_WORK_DIR}"
log "bootstrap failed: please check ${STAGE_WORK_DIR}/debootstrap.log"
return 1
fi
}
export -f bootstrap