From 45cf24c6fa52c8290e6c905c97d5db7587a35675 Mon Sep 17 00:00:00 2001 From: George Danchev Date: Sun, 3 Jul 2011 09:04:09 +0000 Subject: [PATCH] check for extraction dir existence --- releng/releng_isojigdo | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/releng/releng_isojigdo b/releng/releng_isojigdo index de82f8f2..37a6211c 100755 --- a/releng/releng_isojigdo +++ b/releng/releng_isojigdo @@ -97,7 +97,7 @@ RES="${RELENG_IMG}.iso ${RELENG_IMG}.new ${RELENG_IMG}.md5 ${RELENG_IMG}.jigdo $ if ! "${RELENG_XORRISO}" -version | grep libjte >/dev/null 2>&1; then printf "\n${SELF}: JTE not supported with this xorriso build. Install jigit and rebuild." printf "\n${SELF}: See http://www.einval.com/~steve/software/JTE/\n" - exit 10 + exit 9 fi # remove cruft from previous runs @@ -123,9 +123,13 @@ else fi # check for extraction directory existence -if [ ! -d "${IMG_EXTRACT_DIR}" ]; then +if [ -d "${IMG_EXTRACT_DIR}" ]; then + printf "\n${SELF}: Found ${IMG_EXTRACT_DIR}. Please cleanup.\n" + exit 11 +else mkdir "${IMG_EXTRACT_DIR}" fi + # extract image content set +e "${RELENG_XORRISO}" -indev "${TMP_DATA_DIR}"/"${REMOTE_IMG}" \ @@ -164,7 +168,7 @@ CMD+="\ " else printf "\n${SELF}: FAIL to compose the boot section.\n" - exit 10 + exit 12 fi # JIGDO section @@ -182,7 +186,7 @@ if which jigdo-gen-md5-list >/dev/null 2>&1; then else printf "\n${SELF}: Not found: jigdo-gen-md5-list. Install jigit." printf "\n${SELF}: See http://www.einval.com/~steve/software/JTE/\n" - exit 11 + exit 13 fi CMD+="\ @@ -214,7 +218,7 @@ if which jigit-mkimage >/dev/null 2>&1; then else printf "\n${SELF}: Not found: jigit-mkimage. Install jigit." printf "\n${SELF}: See http://www.einval.com/~steve/software/JTE/\n" - exit 12 + exit 14 fi # trap the exit code of diff and let the Universe explode @@ -233,7 +237,7 @@ esac if [ ${KEEP} -eq 0 ]; then # safety net, just in case -> we want to be in the starting # directory before removing whatever self-generated stuff - cd "${START_DIR_DONT_CHANGE}" || exit 13 + cd "${START_DIR_DONT_CHANGE}" || exit 15 rm -rf ${GEN_DATA_DIR} printf "${SELF}: removed %s\n" ${GEN_DATA_DIR} else