Changeset de63126 for common


Ignore:
Timestamp:
03/12/2010 03:32:25 AM (14 years ago)
Author:
Thomas Pegg <thomasp@…>
Branches:
2.3, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
9d55d85
Parents:
0873ccc
Message:

Add configuration options for retry on connection refused, number of times to attemp to download a file, and timeout for wget invocation. Thanks to Tim Sarbin for the patch, slightly modified by me to accomodate a second set of wget calls.

Location:
common/libs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • common/libs/func_download_pkgs

    r0873ccc rde63126  
    88#----------------------------#
    99  local saveIFS=$IFS
    10   local IFS line URL1 URL2 FILE BOOKMD5 MD5 HAVEMD5 fromARCHIVE
     10  local IFS line URL1 URL2 FILE BOOKMD5 MD5 HAVEMD5 fromARCHIVE WGETPARAM
     11
     12  WGETPARAM=""
     13  if [[ "${RETRYSRCDOWNLOAD}" = "y" ]] ; then
     14    WGETPARAM+="--retry-connrefused"
     15  fi
     16  WGETPARAM+=" --tries ${RETRYDOWNLOADCNT}"
     17  WGETPARAM+=" --timeout ${DOWNLOADTIMEOUT}"
    1118
    1219    # Test if the packages must be downloaded
     
    6976      # If the file does not exist yet in /sources download a fresh one
    7077      if [ ! -f $FILE ] ; then
    71         if ! wget $URL1 && ! wget $URL2 ; then
     78        if ! wget $URL1 $WGETPARAM && ! wget $URL2 $WGETPARAM ; then
    7279          gs_wrt_message "$FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
    7380          continue
     
    8996      fromARCHIVE=0;
    9097        # Try to retrieve again the file. Servers in reverse order.
    91       if ! wget $URL2 && ! wget $URL1 ; then
     98      if ! wget $URL2 $WGETPARAM && ! wget $URL1 $WGETPARAM ; then
    9299        gs_wrt_message "$FILE not found on the servers.. SKIPPING"
    93100        continue
  • common/libs/func_validate_configs.sh

    r0873ccc rde63126  
    2424  local -r      BOOK_clfsX="ARCH TARGET"
    2525  local -r  GENERAL_common="LUSER LGROUP LHOME BUILDDIR CLEAN GETPKG SRC_ARCHIVE \
    26                             SERVER GETKERNEL RUNMAKE"
     26                            SERVER RETRYSRCDOWNLOAD RETRYDOWNLOADCNT DOWNLOADTIMEOUT \
     27                            GETKERNEL RUNMAKE"
    2728  local -r    BUILD_chroot="TEST BOMB_TEST STRIP"
    2829  local -r    BUILD_common="FSTAB CONFIG TIMEZONE PAGE LANG INSTALL_LOG"
     
    136137                    [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`"
    137138                  fi ;;
    138       COMPARE)    [[ ! "$COMPARE" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    139       RUN_ICA)    [[ "$COMPARE" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    140       RUN_FARCE)  [[ "$COMPARE" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    141       ITERATIONS) [[ "$COMPARE" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    142       BOMB_TEST)  [[ ! "$TEST" = "0" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    143       TARGET32)   [[ -n "${TARGET32}" ]] &&  echo -e "`eval echo $PARAM_VALS`" ;;
    144       MIPS_LEVEL) [[ "${ARCH}" = "mips" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    145       SERVER)     [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     139      COMPARE)          [[ ! "$COMPARE" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     140      RUN_ICA)          [[ "$COMPARE" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     141      RUN_FARCE)        [[ "$COMPARE" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     142      ITERATIONS)       [[ "$COMPARE" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     143      BOMB_TEST)        [[ ! "$TEST" = "0" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     144      TARGET32)         [[ -n "${TARGET32}" ]] &&  echo -e "`eval echo $PARAM_VALS`" ;;
     145      MIPS_LEVEL)       [[ "${ARCH}" = "mips" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     146      SERVER)           [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     147      RETRYSRCDOWNLOAD) [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     148      RETRYDOWNLOADCNT) [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     149      DOWNLOADTIMEOUT)  [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    146150
    147151      # Envars that requires some validation
Note: See TracChangeset for help on using the changeset viewer.