aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-09-03 23:13:43 -0500
committerJack Nagel2012-09-03 23:13:43 -0500
commit296f7f4d8d74d80e4f55bcc97ca4827742ce6603 (patch)
tree24333e58915947081dee60b1382f5dda5825932f /Library
parent204c7e80966bb292da91673104189875f9b611cc (diff)
downloadhomebrew-296f7f4d8d74d80e4f55bcc97ca4827742ce6603.tar.bz2
brew-aspell-dictionaries: handle mirrors
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmds/brew-aspell-dictionaries9
1 files changed, 6 insertions, 3 deletions
diff --git a/Library/Contributions/cmds/brew-aspell-dictionaries b/Library/Contributions/cmds/brew-aspell-dictionaries
index b07e1a5e4..f6677ac54 100755
--- a/Library/Contributions/cmds/brew-aspell-dictionaries
+++ b/Library/Contributions/cmds/brew-aspell-dictionaries
@@ -9,12 +9,13 @@
# The result can then to be merged into the aspell formula, to update
# the available dictionary formulae.
-dictionaries_url=http://ftp.gnu.org/gnu/aspell/dict
+dictionaries_url=http://ftpmirror.gnu.org/aspell/dict
+dictionaries_mirror=http://ftp.gnu.org/gnu/aspell/dict
tmp_file=`mktemp -t brew_aspell_dictionaries`
brew_formulae_tmp_file=`mktemp -t brew_aspell_dictionaries_formulae`
echo "Downloading aspell dictionaries Index"
-curl -s ${dictionaries_url}/0index.html \
+curl -sL ${dictionaries_url}/0index.html \
| egrep '^(<tr><td><a|</table)' \
| cut -d\" -f2,4 \
> $tmp_file
@@ -25,12 +26,14 @@ for dict in `cat $tmp_file`; do
[ "${dict}" = "</table>" ] && break # only read the entries in the first table, which lists the dictionaries for aspell 0.60
lang=`echo $dict | awk -F\" '{ gsub("-", "_", $1); print $1 }'`
url="${dictionaries_url}/"`echo $dict | awk -F\" '{ print $2 }'`
+ mirror="${dictionaries_mirror}/"`echo $dict | awk -F\" '{ print $2 }'`
langs="${langs} ${lang}"
echo "Calculating sha1 for formula: ${lang}"
- sha1=`curl -s "${url}" | shasum | awk '{print $1}'`
+ sha1=`curl -sL "${url}" | shasum | awk '{print $1}'`
cat <<EOF >> $brew_formulae_tmp_file
class Aspell_${lang} < AspellLang
url '${url}'
+ mirror '${mirror}'
sha1 '${sha1}'
end
EOF