From 58f70e8911327a75bd736b0927b9a178e908dc6f Mon Sep 17 00:00:00 2001 From: Reinhard Kotucha Date: Sun, 6 Apr 2008 17:56:02 +0000 Subject: tlpkg/installer/wgetrc: Read by installer on Windows. git-svn-id: svn://tug.org/texlive/trunk@7334 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLPDB.pm | 2 +- Master/tlpkg/TeXLive/TLUtils.pm | 9 ++-- Master/tlpkg/installer/wgetrc | 112 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 Master/tlpkg/installer/wgetrc (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 4585c0e6ff7..135e5856104 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -183,7 +183,7 @@ sub from_file { } if ($path =~ /^(http|ftp):\/\//) { tllog($::LOG_DDDEBUG, "TLPDB.pm: trying to initialize from $path\n"); - open(TMP, "wget --timeout=60 --tries=2 -q --output-document=- $path|") + open(TMP, "wget -q --output-document=- $path|") || die("Cannot open tlpdb file: $path"); } else { open(TMP,"<$path") || die("Cannot open tlpdb file: $path"); diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 5d4044e08ec..d275471a815 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -1,7 +1,7 @@ # $Id$ # The inevitable utilities for TeX Live. # -# Copyright 2007 Norbert Preining +# Copyright 2007 Norbert Preining, Reinhard Kotucha # This file is licensed under the GNU General Public License version 2 # or any later version. @@ -680,7 +680,7 @@ sub install_package { $tarfile =~ s/\.lzma$//; mkdirhier("$target/temp"); tllog($::LOG_DEBUG, "Downloading $what to $target\\temp\\$fn\n"); - tllog($::LOG_DEBUG, `$wget --tries=2 --timeout=60 -q -O \"$target\\temp\\$fn\" \"$what\" 2>\&1`); + tllog($::LOG_DEBUG, `$wget -q -O \"$target\\temp\\$fn\" \"$what\" 2>\&1`); tllog($::LOG_DEBUG, "Un-lzmaing $target\\temp\\$fn to $target\\temp\\$tarfile\n"); #tllog($::LOG_DEBUG, `type \"$target\\temp\\$fn\" | $lzmadec > \"$target\\temp\\$tarfile\" 2>&1`); tllog($::LOG_DEBUG, `$lzmadec < \"$target\\temp\\$fn\" > \"$target\\temp\\$tarfile\" 2>&1`); @@ -689,7 +689,7 @@ sub install_package { unlink("$target/temp/$tarfile", "$target/temp/$fn"); } else { tllog($::LOG_DEBUG, "downloading/unlzma-ing/unpacking $what\n"); - tllog($::LOG_NORMAL, `$wget --tries=2 --timeout=60 -q -O- \"$what\"|\"$lzmadec\"|$tar -xf - -C \"$target\"`); + tllog($::LOG_NORMAL, `$wget -q -O- \"$what\"|\"$lzmadec\"|$tar -xf - -C \"$target\"`); } } elsif ($what =~ m,\.tar.lzma$,) { if (win32()) { @@ -817,6 +817,9 @@ again. sub initialize_installer { &media; &platform; + if (win32) { + $ENV{'WGETRC'}="$::installerdir/plpkg/installer/wgetrc" + } } =pod diff --git a/Master/tlpkg/installer/wgetrc b/Master/tlpkg/installer/wgetrc new file mode 100644 index 00000000000..7aeacc74e1d --- /dev/null +++ b/Master/tlpkg/installer/wgetrc @@ -0,0 +1,112 @@ +### +### Sample Wget initialization file .wgetrc +### + +## You can use this file to change the default behaviour of wget or to +## avoid having to type many many command-line options. This file does +## not contain a comprehensive list of commands -- look at the manual +## to find out what you can put into this file. +## +## Wget initialization file can reside in /usr/local/etc/wgetrc +## (global, for all users) or $HOME/.wgetrc (for a single user). +## +## To use the settings in this file, you will have to uncomment them, +## as well as change them, in most cases, as the values on the +## commented-out lines are the default values (e.g. "off"). + + +## +## Global settings (useful for setting up in /usr/local/etc/wgetrc). +## Think well before you change them, since they may reduce wget's +## functionality, and make it behave contrary to the documentation: +## + +# You can set retrieve quota for beginners by specifying a value +# optionally followed by 'K' (kilobytes) or 'M' (megabytes). The +# default quota is unlimited. +#quota = inf + +# You can lower (or raise) the default number of retries when +# downloading a file (default is 20). +#tries = 20 + +# Lowering the maximum depth of the recursive retrieval is handy to +# prevent newbies from going too "deep" when they unwittingly start +# the recursive retrieval. The default is 5. +#reclevel = 5 + +# By default Wget uses "passive FTP" transfer where the client +# initiates the data connection to the server rather than the other +# way around. That is required on systems behind NAT where the client +# computer cannot be easily reached from the Internet. However, some +# firewalls software explicitly supports active FTP and in fact has +# problems supporting passive transfer. If you are in such +# environment, use "passive_ftp = off" to revert to active FTP. +#passive_ftp = off + +# The "wait" command below makes Wget wait between every connection. +# If, instead, you want Wget to wait only between retries of failed +# downloads, set waitretry to maximum number of seconds to wait (Wget +# will use "linear backoff", waiting 1 second after the first failure +# on a file, 2 seconds after the second failure, etc. up to this max). +waitretry = 10 + + +## +## Local settings (for a user to set in his $HOME/.wgetrc). It is +## *highly* undesirable to put these settings in the global file, since +## they are potentially dangerous to "normal" users. +## +## Even when setting up your own ~/.wgetrc, you should know what you +## are doing before doing so. +## + +# Set this to on to use timestamping by default: +#timestamping = off + +# It is a good idea to make Wget send your email address in a `From:' +# header with your request (so that server administrators can contact +# you in case of errors). Wget does *not* send `From:' by default. +#header = From: Your Name + +# You can set up other headers, like Accept-Language. Accept-Language +# is *not* sent by default. +#header = Accept-Language: en + +# You can set the default proxies for Wget to use for http and ftp. +# They will override the value in the environment. +#http_proxy = http://proxy.yoyodyne.com:18023/ +#ftp_proxy = http://proxy.yoyodyne.com:18023/ + +# If you do not want to use proxy at all, set this to off. +#use_proxy = on + +# You can customize the retrieval outlook. Valid options are default, +# binary, mega and micro. +#dot_style = default + +# Setting this to off makes Wget not download /robots.txt. Be sure to +# know *exactly* what /robots.txt is and how it is used before changing +# the default! +#robots = on + +# It can be useful to make Wget wait between connections. Set this to +# the number of seconds you want Wget to wait. +#wait = 0 + +# You can force creating directory structure, even if a single is being +# retrieved, by setting this to on. +#dirstruct = off + +# You can turn on recursive retrieving by default (don't do this if +# you are not sure you know what it means) by setting this to on. +#recursive = off + +# To always back up file X as X.orig before converting its links (due +# to -k / --convert-links / convert_links = on having been specified), +# set this variable to on: +#backup_converted = off + +# To have Wget follow FTP links from HTML files by default, set this +# to on: +#follow_ftp = off -- cgit v1.2.3