libc/eglibc: use generic SVN functions
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 31 00:20:44 2011 +0200 (2011-05-31)
changeset 249598b02f85db29
parent 2494 feee36c11ccc
child 2496 cc9b84a83b34
libc/eglibc: use generic SVN functions

eglibc is only available from SVN. The script currently calls svn
in its own tortuous and convoluted way.

Use the egeneric SVN extract functions, and sinplify the eglibc
download function.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/build/libc/eglibc.sh
     1.1 --- a/scripts/build/libc/eglibc.sh	Tue May 31 00:57:36 2011 +0200
     1.2 +++ b/scripts/build/libc/eglibc.sh	Tue May 31 00:20:44 2011 +0200
     1.3 @@ -9,97 +9,29 @@
     1.4  #   do_libc_min_kernel_config
     1.5  . "${CT_LIB_DIR}/scripts/build/libc/glibc-eglibc.sh-common"
     1.6  
     1.7 -# Download eglibc repository
     1.8 -do_eglibc_get() {
     1.9 -    CT_HasOrAbort svn
    1.10 +# Download glibc
    1.11 +# eglibc is only available through subversion, there are no
    1.12 +# snapshots available.
    1.13 +do_libc_get() {
    1.14 +    local addon
    1.15 +    local svn_base="svn://svn.eglibc.org"
    1.16  
    1.17      case "${CT_LIBC_VERSION}" in
    1.18 -        trunk)  svn_url="svn://svn.eglibc.org/trunk";;
    1.19 -        *)      svn_url="svn://svn.eglibc.org/branches/eglibc-${CT_LIBC_VERSION}";;
    1.20 +        trunk)  svn_base+="/trunk";;
    1.21 +        *)      svn_base+="/branches/eglibc-${CT_LIBC_VERSION}";;
    1.22      esac
    1.23  
    1.24 -    case "${CT_EGLIBC_CHECKOUT}" in
    1.25 -        y)  svn_action="checkout";;
    1.26 -        *)  svn_action="export --force";;
    1.27 -    esac
    1.28 +    CT_GetSVN "eglibc-${CT_LIBC_VERSION}"   \
    1.29 +              "${svn_base}/libc"            \
    1.30 +              "${CT_EGLIBC_REVISION:-HEAD}"
    1.31  
    1.32 -    CT_DoExecLog ALL svn ${svn_action} -r "${CT_EGLIBC_REVISION:-HEAD}" "${svn_url}" "$(pwd)"
    1.33 -
    1.34 -    # Compress eglibc
    1.35 -    CT_DoExecLog ALL mv libc "eglibc-${CT_LIBC_VERSION}"
    1.36 -    CT_DoExecLog ALL tar cjf "eglibc-${CT_LIBC_VERSION}.tar.bz2" "eglibc-${CT_LIBC_VERSION}"
    1.37 -
    1.38 -    # Compress linuxthreads, localedef and ports
    1.39 -    # Assign them the name the way ct-ng like it
    1.40 -    for addon in linuxthreads localedef ports; do
    1.41 -        CT_DoExecLog ALL mv "${addon}" "eglibc-${addon}-${CT_LIBC_VERSION}"
    1.42 -        CT_DoExecLog ALL tar cjf "eglibc-${addon}-${CT_LIBC_VERSION}.tar.bz2" "eglibc-${addon}-${CT_LIBC_VERSION}"
    1.43 +    for addon in $(do_libc_add_ons_list " "); do
    1.44 +        CT_GetSVN "eglibc-${addon}-${CT_LIBC_VERSION}"  \
    1.45 +                  "${svn_base}/${addon}"                \
    1.46 +                  "${CT_EGLIBC_REVISION:-HEAD}"
    1.47      done
    1.48  }
    1.49  
    1.50 -# Download glibc
    1.51 -do_libc_get() {
    1.52 -    # eglibc is only available through subversion, there are no
    1.53 -    # snapshots available. Moreover, addons will be downloaded
    1.54 -    # simultaneously.
    1.55 -
    1.56 -    # build filename
    1.57 -    eglibc="eglibc-${CT_LIBC_VERSION}.tar.bz2"
    1.58 -    eglibc_linuxthreads="${CT_LIBC}-linuxthreads-${CT_LIBC_VERSION}.tar.bz2"
    1.59 -    eglibc_localedef="${CT_LIBC}-localedef-${CT_LIBC_VERSION}.tar.bz2"
    1.60 -    eglibc_ports="${CT_LIBC}-ports-${CT_LIBC_VERSION}.tar.bz2"
    1.61 -
    1.62 -    # Check if every tarballs are already present
    1.63 -    if [    -f "${CT_TARBALLS_DIR}/${eglibc}"                   \
    1.64 -         -a -f "${CT_TARBALLS_DIR}/${eglibc_linuxthreads}"      \
    1.65 -         -a -f "${CT_TARBALLS_DIR}/${eglibc_localedef}"         \
    1.66 -         -a -f "${CT_TARBALLS_DIR}/${eglibc_ports}"             \
    1.67 -       ]; then
    1.68 -        CT_DoLog DEBUG "Already have 'eglibc-${CT_LIBC_VERSION}'"
    1.69 -        return 0
    1.70 -    fi
    1.71 -
    1.72 -    if [    -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc}"                 \
    1.73 -         -a -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_linuxthreads}"    \
    1.74 -         -a -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_localedef}"       \
    1.75 -         -a -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_ports}"           \
    1.76 -         -a "${CT_FORCE_DOWNLOAD}" != "y"                           \
    1.77 -       ]; then
    1.78 -        CT_DoLog DEBUG "Got 'eglibc-${CT_LIBC_VERSION}' from local storage"
    1.79 -        for file in ${eglibc} ${eglibc_linuxthreads} ${eglibc_localedef} ${eglibc_ports}; do
    1.80 -            CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${file}" "${CT_TARBALLS_DIR}/${file}"
    1.81 -        done
    1.82 -        return 0
    1.83 -    fi
    1.84 -
    1.85 -    # Not found locally, try from the network
    1.86 -    CT_DoLog EXTRA "Retrieving 'eglibc-${CT_LIBC_VERSION}'"
    1.87 -
    1.88 -    CT_MktempDir tmp_dir
    1.89 -    CT_Pushd "${tmp_dir}"
    1.90 -
    1.91 -    do_eglibc_get
    1.92 -    CT_DoLog DEBUG "Moving 'eglibc-${CT_LIBC_VERSION}' to tarball directory"
    1.93 -    for file in ${eglibc} ${eglibc_linuxthreads} ${eglibc_localedef} ${eglibc_ports}; do
    1.94 -        CT_DoExecLog ALL mv -f "${file}" "${CT_TARBALLS_DIR}"
    1.95 -    done
    1.96 -
    1.97 -    CT_Popd
    1.98 -
    1.99 -    # Remove source files
   1.100 -    CT_DoExecLog ALL rm -rf "${tmp_dir}"
   1.101 -
   1.102 -    if [ "${CT_SAVE_TARBALLS}" = "y" ]; then
   1.103 -        CT_DoLog EXTRA "Saving 'eglibc-${CT_LIBC_VERSION}' to local storage"
   1.104 -        for file in ${eglibc} ${eglibc_linuxthreads} ${eglibc_localedef} ${eglibc_ports}; do
   1.105 -            CT_DoExecLog ALL mv -f "${CT_TARBALLS_DIR}/${file}" "${CT_LOCAL_TARBALLS_DIR}"
   1.106 -            CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${file}" "${CT_TARBALLS_DIR}/${file}"
   1.107 -        done
   1.108 -    fi
   1.109 -
   1.110 -    return 0
   1.111 -}
   1.112 -
   1.113  # Copy user provided eglibc configuration file if provided
   1.114  do_libc_check_config() {
   1.115      if [ "${CT_EGLIBC_CUSTOM_CONFIG}" != "y" ]; then