Allow for custom archive names

... and directories therein.

Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
Alexey Neyman 2017-07-02 13:12:53 -07:00
parent d0ff020e23
commit f63fbd356f
8 changed files with 41 additions and 16 deletions

View File

@ -16,7 +16,6 @@ config ISL_CLOOG_auto_select_2
def_bool y
depends on CLOOG_NEEDED && !ISL_0_13_or_older
select CLOOG_REQUIRE_0_18_4_or_later
# TBD 0.12.2 should allow both!
config ISL_NEEDS_WITH_GMP
bool

View File

@ -132,7 +132,7 @@ run_lines()
{
local start="${1}"
local end="${2}"
local l lnext s v
local l lnext s s1 v
debug "Running lines ${start}..${end}"
l=${start}
@ -142,6 +142,7 @@ run_lines()
# Expand @@foo@@ to ${info[foo]}. First escape variables/backslashes for evals below.
s="${s//\\/\\\\}"
s="${s//\$/\\\$}"
s1=
while [ -n "${s}" ]; do
case "${s}" in
*@@*@@*)
@ -150,16 +151,19 @@ run_lines()
if [ "${info[${v}]+set}" != "set" ]; then
error "line ${l}: reference to undefined variable '${v}'"
fi
s="${s%%@@*}\${info[${v}]}${s#*@@*@@}"
s1="${s1}${s%%@@*}\${info[${v}]}"
s="${s#*@@*@@}"
;;
*@@*)
error "line ${l}: non-paired @@ markers"
;;
*)
s1="${s1}${s}"
break
;;
esac
done
s=${s1}
debug "Evaluate: ${s}"
case "${s}" in
@ -448,7 +452,8 @@ enter_fork()
info[fork]=${fork}
info[name]=${fork}
info[mirrors]=
info[archivesuffix]=
info[archive_filename]='@{pkg_name}-@{version}'
info[archive_dirname]='@{pkg_name}-@{version}'
eval `read_package_desc ${fork}`

View File

@ -172,9 +172,13 @@ config @@pfx@@_MIRRORS
string
default "@@mirrors@@"
config @@pfx@@_ARCHIVE_SUFFIX
config @@pfx@@_ARCHIVE_FILENAME
string
default "@@archivesuffix@@"
default "@@archive_filename@@"
config @@pfx@@_ARCHIVE_DIRNAME
string
default "@@archive_dirname@@"
#!end-if

View File

@ -1,3 +1,3 @@
# We don't support building bionic (yet) so no official repository
archivesuffix='-linux-x86_64'
mirrors='https://dl.google.com/android/repository'
archive_filename='@{pkg_name}-@{version}-linux-x86_64'

View File

@ -1,2 +1,4 @@
repository='cvs :pserver:anonymous@duma.cvs.sourceforge.net:/cvsroot/duma duma'
mirrors='http://downloads.sourceforge.net/project/duma/duma/${CT_DUMA_VERSION}'
archive_filename='@{pkg_name}_@{version}'
archive_dirname='@{pkg_name}_@{version}'

View File

@ -1,3 +1,5 @@
repository='git git://git.debian.org/git/collab-maint/ltrace.git'
bootstrap='./autogen.sh'
mirrors='http://ftp.debian.org/debian/pool/main/l/ltrace ftp:://ftp.debian.org/debian/pool/main/l/ltrace'
archive_filename='@{pkg_name}_@{version}.orig'
archive_dirname='@{pkg_name}-@{version}'

View File

@ -265,7 +265,7 @@ do_elf2flt_backend() {
CFLAGS="${cflags}" \
LDFLAGS="${ldflags}" \
${CONFIG_SHELL} \
"${CT_SRC_DIR}/elf2flt-${CT_ELF2FLT_VERSION}/configure" \
"${CT_SRC_DIR}/elf2flt/configure" \
--build=${CT_BUILD} \
--host=${host} \
--target=${CT_TARGET} \

View File

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