X-Spam-Check-By: sourceware.org Message-ID: <4421950A.8010000@newparticles.com> Date: Wed, 22 Mar 2006 11:18:50 -0700 From: Lance Nehring User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: modification to mkcygwget to overcome arg length limitation Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms080709080106040106050105" Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------ms080709080106040106050105 Content-Type: multipart/mixed; boundary="------------040308020200000603040904" This is a multi-part message in MIME format. --------------040308020200000603040904 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi all, I tried to use the mkcygwget script to download a cygwin mirror for offline installation. The mkcygwget script generates a script named cygwget to do the heavy lifting of retreiving files. However, I got a "argument list too long" exception from wget, since the generated script has all the files to be downloaded appended to a single wget command. I've made a slight modification to the mkcygwget script so that the generated cygwget contains a separate wget command for each file to be downloaded. This solved the problem I was having....thought I'd post the modified script to this mailing list in case anyone else was interested. r, Lance Nehring New Particles Corp http://www.newparticles.com/ --------------040308020200000603040904 Content-Type: text/plain; name="mkcygwget" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mkcygwget" #!/bin/bash getBZ2=1 # Validate usage (minimally) if [ $# -ne 1 ]; then echo "mkcygwget: Usage $0 " >&2 exit 1 fi mirrorURL="$1" # Dissect the argument to separate the host and directory portions mirrorHost="${mirrorURL%*/}" mirrorDir="${mirrorURL##*/}" ueMirror="$(echo "$mirrorURL" |sed -e 's/:/%3a/g' -e 's|/|%2f|g')" mkdir "$ueMirror" # Retrieve the "setup.ini" file from the mirror # Get the BZip2-compressed form? if [ "$getBZ2" ]; then wget -O "$ueMirror/setup.bz2" "$mirrorHost/setup.bz2" if [ $? -ne 0 ]; then echo "mkwget: Error retrieving \"setup.bz2\" from \"$mirrorHost/setup.bz2\"" >&2 exit 1; fi bzcat "$ueMirror/setup.bz2" >"$ueMirror/setup.ini" rm "$ueMirror/setup.bz2" # Get the uncompressed "setup.ini" file else wget -O "$ueMirror/setup.ini" "$mirrorHost/setup.ini" if [ $? -ne 0 ]; then echo "mkwget: Error retrieving \"setup.ini\" from \"$mirrorHost/setup.ini\"" >&2 exit 1; fi fi # Use the "setup.ini" file to produce a download script wgetprefix="wget -x -nH --cut-dirs=1 $mirrorURL" ( echo -e '#!/bin/sh\n' echo -e "cd \"$ueMirror\"\n" sed -n -e "/^install: / s|^install: \([^ ]*\) .*|\t$wgetprefix/\1 |p" "$ueMirror/setup.ini" echo ) >|cygwget chmod +x cygwget --------------040308020200000603040904-- --------------ms080709080106040106050105 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEH AQAAoIIHwDCCA9wwggNFoAMCAQICDwDmxgABAAKp2Cfc9YLvszANBgkqhkiG 9w0BAQQFADCBvDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1cmcxEDAO BgNVBAcTB0hhbWJ1cmcxOjA4BgNVBAoTMVRDIFRydXN0Q2VudGVyIGZvciBT ZWN1cml0eSBpbiBEYXRhIE5ldHdvcmtzIEdtYkgxIjAgBgNVBAsTGVRDIFRy dXN0Q2VudGVyIENsYXNzIDEgQ0ExKTAnBgkqhkiG9w0BCQEWGmNlcnRpZmlj YXRlQHRydXN0Y2VudGVyLmRlMB4XDTA2MDIwMTE4NDIzMVoXDTA3MDIwNzE4 NDIzMVowTjELMAkGA1UEBhMCVVMxFjAUBgNVBAMTDUxhbmNlIE5laHJpbmcx JzAlBgkqhkiG9w0BCQEWGG5laHJpbmdAbmV3cGFyd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