CT_Extract: Move check extracted up

If we are using a custom location, and that custom location is a
directory that does not have an associated tarball, then we shouldn't
warn about not finding a tarball in CT_TARBALLS_DIR if
CT_SRC_DIR/.<basename>.extracted is found.

If the extracted file is not found, then we can warn that the tarball
was not found then error out that the tarball is missing.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
This commit is contained in:
Bryan Hundven 2015-11-25 15:56:38 -08:00
parent 2d3c70dd3d
commit 0041a8b105

View File

@ -938,18 +938,18 @@ CT_Extract() {
basename="$1"
shift
if ! ext="$(CT_GetFileExtension "${basename}")"; then
CT_DoLog WARN "'${basename}' not found in '${CT_TARBALLS_DIR}'"
return 1
fi
local full_file="${CT_TARBALLS_DIR}/${basename}${ext}"
# Check if already extracted
if [ -e "${CT_SRC_DIR}/.${basename}.extracted" ]; then
CT_DoLog DEBUG "Already extracted '${basename}'"
return 0
fi
if ! ext="$(CT_GetFileExtension "${basename}")"; then
CT_DoLog WARN "'${basename}' not found in '${CT_TARBALLS_DIR}'"
return 1
fi
local full_file="${CT_TARBALLS_DIR}/${basename}${ext}"
# Check if previously partially extracted
if [ -e "${CT_SRC_DIR}/.${basename}.extracting" ]; then
CT_DoLog ERROR "The '${basename}' sources were partially extracted."