glibc: properly handle internal addons

Some addons are bundled with glibc/eglibc, so we should not try to
download and extract them.

This is done as thus:
 - at download time:
   - if the add-on download fails, keep going;
 - at extract time:
   - if the addon is present in the source tree, ignore it;
   - if the addon is missing in the source tree:
     - if the archive is present, extract it;
     - if the archive is missing, bail out.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
Yann E. MORIN" 2011-05-30 23:05:28 +02:00
parent 3d6ce4cd3d
commit 93b0db91b4
3 changed files with 31 additions and 11 deletions

View File

@ -26,9 +26,17 @@ do_libc_get() {
"${CT_EGLIBC_REVISION:-HEAD}" "${CT_EGLIBC_REVISION:-HEAD}"
for addon in $(do_libc_add_ons_list " "); do for addon in $(do_libc_add_ons_list " "); do
CT_GetSVN "eglibc-${addon}-${CT_LIBC_VERSION}" \ # NPTL addon is not to be downloaded, in any case
"${svn_base}/${addon}" \ [ "${addon}" = "nptl" ] && continue || true
"${CT_EGLIBC_REVISION:-HEAD}" if ! CT_GetSVN "eglibc-${addon}-${CT_LIBC_VERSION}" \
"${svn_base}/${addon}" \
"${CT_EGLIBC_REVISION:-HEAD}"
then
# Some add-ons are bundled with the main sources
# so failure to download them is expected
CT_DoLog DEBUG "Addon '${addon}' could not be downloaded."
CT_DoLog DEBUG "We'll see later if we can find it in the source tree"
fi
done done
} }

View File

@ -11,8 +11,13 @@ do_libc_extract() {
# Extract the add-opns # Extract the add-opns
for addon in $(do_libc_add_ons_list " "); do for addon in $(do_libc_add_ons_list " "); do
# NPTL addon is not to be extracted, in any case # If the addon was bundled with the main archive, we do not
[ "${addon}" = "nptl" ] && continue || true # need to extract it. Worse, if we were to try to extract
# it, we'd get an error.
if [ -d "${addon}" ]; then
CT_DoLog DEBUG "Add-on already present, spkipping extraction"
continue
fi
CT_Extract nochdir "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" CT_Extract nochdir "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"

View File

@ -27,12 +27,19 @@ do_libc_get() {
# C library addons # C library addons
for addon in "${addons_list[@]}"; do for addon in "${addons_list[@]}"; do
# NPTL addon is not to be downloaded, in any case if ! CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \
[ "${addon}" = "nptl" ] && continue || true {ftp,http}://ftp.gnu.org/gnu/glibc \
CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \ ftp://gcc.gnu.org/pub/glibc/releases \
{ftp,http}://ftp.gnu.org/gnu/glibc \ ftp://gcc.gnu.org/pub/glibc/snapshots
ftp://gcc.gnu.org/pub/glibc/releases \ then
ftp://gcc.gnu.org/pub/glibc/snapshots # Some add-ons are bundled with glibc, others are
# bundled in their own tarball. Eg. NPTL is internal,
# while LinuxThreads was external. Also, for old
# versions of glibc, the libidn add-on was external,
# but with version >=2.10, it is internal.
CT_DoLog DEBUG "Addon '${addon}' could not be downloaded."
CT_DoLog DEBUG "We'll see later if we can find it in the source tree"
fi
done done
return 0 return 0