From 9b9e5c4162e39b63da4783124e844adf2f223f26 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 28 Feb 2019 14:39:08 -0800 Subject: Make lzip an optional dependency Signed-off-by: Alexey Neyman diff --git a/config/configure.in.in b/config/configure.in.in index a9bb8ad..49fdb2e 100644 --- a/config/configure.in.in +++ b/config/configure.in.in @@ -3,6 +3,9 @@ config CONFIGURE_has_static_link @KCONFIG_static_link@ +config CONFIGURE_has_lzip + @KCONFIG_lzip@ + config CONFIGURE_has_wget @KCONFIG_wget@ diff --git a/configure.ac b/configure.ac index 729047d..dddbd27 100644 --- a/configure.ac +++ b/configure.ac @@ -122,13 +122,24 @@ CTNG_CHECK_PROGS_REQ([readlink], [readlink]) CTNG_CHECK_PROGS_REQ([tar], [tar]) CTNG_CHECK_PROGS_REQ([gzip], [gzip]) CTNG_CHECK_PROGS_REQ([bzip2], [bzip2]) -CTNG_CHECK_PROGS_REQ([lzip], [lzip]) CTNG_CHECK_PROGS_REQ([xz], [xz]) CTNG_CHECK_PROGS_REQ([unzip], [unzip]) CTNG_CHECK_PROGS_REQ([help2man], [help2man]) CTNG_CHECK_PROGS_REQ([file], [file]) CTNG_CHECK_PROGS_REQ([which], [which]) +# Lzip is optional; all the packages that provide tarballs in .tar.lz format +# also provide them in some other format. All other formats are currently +# mandatory as there is at least one package that has no fallback for each +# of them. +# FIXME: this configure.ac should be only used for detecting the dependencies +# of the ct-ng framework itself; anything needed at build time should be +# determined by crosstool-NG.sh - perhaps, through another 'configure' that +# runs during `ct-ng build`. +AC_CHECK_PROGS([lzip], [lzip]) +CTNG_SET_KCONFIG_OPTION([lzip]) +AC_SUBST([lzip]) + # Not a fatal failure even if we have neither - the tarballs may # be provided in a local directory. AC_CHECK_PROGS([wget], [wget]) diff --git a/scripts/functions b/scripts/functions index fecdad2..09df03a 100644 --- a/scripts/functions +++ b/scripts/functions @@ -669,7 +669,9 @@ CT_DoListTarballExt() { printf ".tar.xz\n" printf ".tar.lzma\n" - printf ".tar.lz\n" + if [ "${CT_CONFIGURE_has_lzip}" = "y" ]; then + printf ".tar.lz\n" + fi printf ".tar.bz2\n" printf ".tar.gz\n.tgz\n" printf ".tar\n" @@ -2074,6 +2076,7 @@ CT_PackageRun() CT_DoFetch() { local tmp_dir + local extensions e a if [ "${src_release}" = "y" ]; then # Some packages do not contain any directory level at all @@ -2083,8 +2086,17 @@ CT_DoFetch() basename="${pkg_name}-${version}" fi pkg_dir="${pkg_name}/${version}" + # Check which extensions we are allowed to fetch + for a in ${archive_formats}; do + for e in $(CT_DoListTarballExt); do + if [ "${a}" = "${e}" ]; then + extensions="${extensions} ${a}" + break + fi + done + done if ! CT_GetFile package="${pkg_name}" pkg_dir="${pkg_dir}" dir_name="${dir_name}" \ - basename="${archive_filename}" extensions="${archive_formats}" \ + basename="${archive_filename}" extensions="${extensions}" \ digest="${CT_VERIFY_DOWNLOAD_DIGEST}" \ signature_format="${CT_VERIFY_DOWNLOAD_SIGNATURE:+${signature_format}}" \ mirrors="${mirrors}"; then -- cgit v0.10.2-6-g49f6