Ticket #1684: alfs_wgetsettings.patch

File alfs_wgetsettings.patch, 4.4 KB (added by Tim Sarbin, 15 years ago)

Patch for adding wget options

  • common/libs/func_validate_configs.sh

     
    2323  local -r     BOOK_common="BOOK CUSTOM_TOOLS"
    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"
    2930  local -r ADVANCED_chroot="COMPARE RUN_ICA RUN_FARCE ITERATIONS OPTIMIZE"
     
    135136      GETKERNEL ) if [[ -z "$CONFIG" ]] && [[ -z "$BOOT_CONFIG" ]] ; then
    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
    148152      LUSER)      echo -e "`eval echo $PARAM_VALS`"
  • common/libs/func_download_pkgs

     
    6868      fromARCHIVE=0
    6969      # If the file does not exist yet in /sources download a fresh one
    7070      if [ ! -f $FILE ] ; then
    71         if ! wget $URL1 && ! wget $URL2 ; then
     71        if [[ "${RETRYSRCDOWNLOAD}" = "y" ]] ; then
     72          WGETPARAM="--retry-connrefused"
     73        fi
     74        WGETPARAM+=" --tries ${RETRYDOWNLOADCNT}"
     75        WGETPARAM+=" --tries ${DOWNLOADTIMEOUT}"
     76        if ! wget $URL1 $WGETPARAM && ! wget $URL2 $WGETPARAM ; then
    7277          gs_wrt_message "$FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
    7378          continue
    7479        fi
  • Config.in

     
    746746                        #   Any missing file will be downloaded and archived here,
    747747                        #   if the user has the right priviledges.
    748748
     749        config RETRYSRCDOWNLOAD
     750                bool "Retry on 'connection refused' failure"
     751                default n
     752                depends GETPKG
     753                help
     754                        #-- Attempt to download a source package again if it fails
     755                        #   with a 'connection refused' error. This can happen on
     756                        #   servers that are overloaded.
     757
     758        config RETRYDOWNLOADCNT
     759                int "Number of retry attempts on download failures"
     760                default 20
     761                depends GETPKG
     762                help
     763                        #-- Number of times to retry download a failed download.
     764
     765        config DOWNLOADTIMEOUT
     766                int "Download timeout (in seconds)"
     767                default 30
     768                depends GETPKG
     769                help
     770                        #-- Number of seconds to wait for a download to start before
     771                        #   timing out.
     772
    749773        config SERVER
    750774                string "FTP mirror"
    751775                default "ftp://ftp.lfs-matrix.net"