From f9d44edb72e9a153c997266189c79cb1f96b69f3 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 22 Jun 2021 15:48:09 +0100 Subject: [PATCH] Copy debootstrap.log on failure --- scripts/common | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/common b/scripts/common index e2048d9..300d30b 100644 --- a/scripts/common +++ b/scripts/common @@ -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