Correctly handle the libfloat case: download, extract and patch sub-actions.

Small improvement in messages in scipts/functions when retrieving a file.
This commit is contained in:
Yann E. MORIN" 2007-05-19 13:10:11 +00:00
parent 266d2ec7e5
commit 361c617308
5 changed files with 16 additions and 22 deletions

View File

@ -7,26 +7,20 @@ if [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ]; then
# Download libfloat
do_libfloat_get() {
# Please note: because the file we download, and the file we store on the
# file system don't have the same name, CT_GetFile will always try to
# download the file over and over.
# To avoid this, we check that the file we want already exists in the
# tarball directory first. This is an ugly hack that overrides the standard
# CT_GetFile behavior... Sight...
lib_float_url="ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat/"
ext=`CT_GetFileExtension "${CT_LIBFLOAT_FILE}"`
if [ -z "${ext}" ]; then
CT_GetFile libfloat_990616.orig "${lib_float_url}"
ext=`CT_GetFileExtension "libfloat_990616.orig"`
# Hack: remove the .orig extension, and change _ to -
mv -v "${CT_TARBALLS_DIR}/libfloat_990616.orig${ext}" \
"${CT_TARBALLS_DIR}/libfloat-990616${ext}" 2>&1 |CT_DoLog DEBUG
fi
# Ah! libfloat separates the version string from the base name with
# an underscore. We need to workaround this in a sane manner: soft link.
local libfloat_file=`echo "${CT_LIBFLOAT_FILE}" |sed -r -e 's/^libfloat-/libfloat_/;'`
CT_GetFile "${libfloat_file}" \
ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat
CT_Pushd "${CT_TARBALLS_DIR}"
ext=`CT_GetFileExtension "${libfloat_file}"`
ln -s "${libfloat_file}${ext}" "${CT_LIBFLOAT_FILE}${ext}"
CT_Popd
}
# Extract libfloat
do_libfloat_extract() {
[ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
}
# Build libfloat
@ -34,13 +28,12 @@ do_libfloat() {
# Here we build and install libfloat for the target, so that the C library
# builds OK with those versions of gcc that have severed softfloat support
# code
[ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] || return 0
CT_DoStep INFO "Installing software floating point emulation library libfloat"
CT_DoStep INFO "Installing software floating point emulation library libfloat"
mkdir build-libfloat
cd build-libfloat
CT_Pushd "${CT_BUILD_DIR}"
CT_DoLog EXTRA "Copying sources to build dir"
mkdir build-libfloat
cd build-libfloat
( cd "${CT_SRC_DIR}/${CT_LIBFLOAT_FILE}"; tar cf - . ) |tar xvf - |CT_DoLog ALL
CT_DoLog EXTRA "Cleaning library"

View File

@ -97,7 +97,7 @@ fi
CT_CC_CORE_FILE="${CT_CC_CORE}-${CT_CC_CORE_VERSION}"
CT_CC_FILE="${CT_CC}-${CT_CC_VERSION}"
CT_LIBC_FILE="${CT_LIBC}-${CT_LIBC_VERSION}"
[ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_LIBFLOAT_FILE="libfloat-990616"
CT_LIBFLOAT_FILE="libfloat-${CT_LIBFLOAT_VERSION}"
# Where will we work?
CT_TARBALLS_DIR="${CT_TOP_DIR}/targets/tarballs"

View File

@ -294,7 +294,6 @@ CT_GetFile() {
return 0
fi
CT_DoLog EXTRA "Retrieving \"${file}\""
CT_Pushd "${CT_TARBALLS_DIR}"
# File not yet downloaded, try to get it
got_it=0
@ -303,11 +302,13 @@ CT_GetFile() {
for ext in .tar.bz2 .tar.gz .tgz .tar; do
if [ -r "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" -a \
"${CT_FORCE_DOWNLOAD}" != "y" ]; then
CT_DoLog EXTRA "Copying \"${file}\" from local copy"
cp -v "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" |CT_DoLog DEBUG
return 0
fi
done
# Try to download it
CT_DoLog EXTRA "Retrieving \"${file}\""
for ext in .tar.bz2 .tar.gz .tgz .tar; do
# Try all urls in turn
for url in "$@"; do