summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-07-02 20:12:53 (GMT)
committerAlexey Neyman <stilor@att.net>2017-07-08 17:57:56 (GMT)
commitf63fbd356f4e80b2f597796039eb79a69121fb4d (patch)
tree28d8f105c0e00fd6697b48790c7f3f3ffa515436 /scripts/functions
parentd0ff020e23372a8eccd319c142c72d266c652f56 (diff)
Allow for custom archive names
... and directories therein. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions29
1 files changed, 21 insertions, 8 deletions
diff --git a/scripts/functions b/scripts/functions
index e3c04ef..4588315 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -1688,12 +1688,20 @@ CT_PackageRun()
use="${use:-${sym}}"
# Variables that are per-fork
- for v in basename pkg_name version src_release mirrors archive_suffix src_devel src_custom \
- devel_vcs devel_url devel_branch devel_revision devel_subdir devel_bootstrap \
- custom_location; do
+ for v in basename pkg_name version src_release mirrors archive_filename archive_dirname \
+ src_devel src_custom devel_vcs devel_url devel_branch devel_revision \
+ devel_subdir devel_bootstrap custom_location; do
eval "local ${v}=\${CT_${use}_${v^^}}"
done
+ for v in archive_filename archive_dirname; do
+ # kconfig and shell have different quoting rules, so it seems impossible to make
+ # kconfig quote '$' properly for eval (i.e. not have it expanded when loading the
+ # .config). Therefore, use '@' instead of '$' in kconfig files and substitute it
+ # here for select variables.
+ eval "eval ${v}=\${${v}//@/$}"
+ done
+
${run} "$@"
# Save certain variables that may be modified by the callback.
@@ -1710,8 +1718,8 @@ CT_DoFetch()
local tmp_dir
if [ "${src_release}" = "y" ]; then
- basename="${pkg_name}-${version}"
- if ! CT_GetFile "${basename}${archive_suffix}" ${mirrors}; then
+ basename="${archive_dirname}"
+ if ! CT_GetFile "${archive_filename}" ${mirrors}; then
CT_Abort "${pkg_name}: download failed"
fi
@@ -1834,7 +1842,7 @@ CT_Extract()
CT_DoExtractPatch()
{
local patchfunc="${1}"
- local ext
+ local archive ext
local -a patch_dirs
local bundled_patch_dir
local local_patch_dir
@@ -1854,9 +1862,14 @@ CT_DoExtractPatch()
else
CT_DoLog EXTRA "Extracting ${basename}"
CT_DoExecLog ALL touch "${CT_COMMON_SRC_DIR}/.${basename}.extracting"
+ if [ "${src_release}" = "y" ]; then
+ archive="${archive_filename}"
+ else
+ archive="${basename}"
+ fi
# TBD save/discover the extension while fetching
- ext=`CT_GetFileExtension "${basename}${archive_suffix}"`
- CT_Extract "${CT_TARBALLS_DIR}/${basename}${archive_suffix}${ext}" "${CT_COMMON_SRC_DIR}"
+ ext=`CT_GetFileExtension "${archive}"`
+ CT_Extract "${CT_TARBALLS_DIR}/${archive}${ext}" "${CT_COMMON_SRC_DIR}"
CT_DoExecLog ALL touch "${CT_COMMON_SRC_DIR}/.${basename}.extracted"
CT_DoExecLog ALL rm -f "${CT_COMMON_SRC_DIR}/.${basename}.extracting"
fi