check for extraction dir existence

This commit is contained in:
George Danchev 2011-07-03 09:04:09 +00:00
parent 3c3e485ec9
commit 45cf24c6fa

View File

@ -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