From 0041a8b1051e06dcb235780773f6b82d6685f428 Mon Sep 17 00:00:00 2001 From: Bryan Hundven Date: Wed, 25 Nov 2015 15:56:38 -0800 Subject: 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/..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 Reviewed-by: "Yann E. MORIN" diff --git a/scripts/functions b/scripts/functions index e266626..4761c1e 100644 --- a/scripts/functions +++ b/scripts/functions @@ -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." -- cgit v0.10.2-6-g49f6