summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rwxr-xr-xbootstrap67
2 files changed, 44 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 9831e50f1..9ff5811f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-08-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap (get_translations): Skip this if WGET_COMMAND is empty.
+ Fail if the first "echo" fails. Suppress diagnostics from "ls po/*.po"
+ since there might not be any .po files.
+ (WGET_COMMAND): Set to empty if wget doesn't
+ seem to be available. Don't export; shouldn't be needed.
+
2006-08-26 Jim Meyering <jim@meyering.net>
* src/c99-to-c89.diff: Remove hunk for copy.c; no longer needed.
diff --git a/bootstrap b/bootstrap
index e13a7fdd0..17e07edaa 100755
--- a/bootstrap
+++ b/bootstrap
@@ -159,47 +159,52 @@ get_translations() {
subdir=$1
domain=$2
- echo "$0: getting translations into $subdir for $domain..."
- (cd $subdir && rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'`) &&
-
- $WGET_COMMAND -O "$subdir/$domain.html" "$TP_URL$domain" &&
-
- sed -n 's|.*"http://[^"]*/translation/teams/PO/\([^/"]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\1.\2|p' <"$subdir/$domain.html" |
- sort -k 1,1 -k 2,2n -k2,2 -k3,3n -k3,3 -k4,4n -k4,4 -k5,5n -k5.5 |
- awk -F. '
- { if (lang && $1 != lang) print lang, ver }
- { lang = $1; ver = substr($0, index($0, ".") + 1) }
- END { if (lang) print lang, ver }
- ' | awk -v domain="$domain" -v subdir="$subdir" '
- {
- lang = $1
- ver = $2
- urlfmt = ""
- printf "{ $WGET_COMMAND -O %s/%s.po '\'"$TP_PO_URL"'/%s/%s-%s.%s.po'\'' &&\n", subdir, lang, lang, domain, ver, lang
- printf " msgfmt -c -o /dev/null %s/%s.po || {\n", subdir, lang
- printf " echo >&2 '\'"$0"': omitting translation for %s'\''\n", lang
- printf " rm -f %s/%s.po; }; } &&\n", subdir, lang
- }
- END { print ":" }
- ' | sh &&
- ls "$subdir"/*.po | sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" &&
- rm "$subdir/$domain.html"
+ case $WGET_COMMAND in
+ '')
+ echo "$0: wget not available; skipping translations";;
+ ?*)
+ echo "$0: getting translations into $subdir for $domain..." &&
+
+ (cd $subdir && rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'`) &&
+ $WGET_COMMAND -O "$subdir/$domain.html" "$TP_URL$domain" &&
+
+ sed -n 's|.*"http://[^"]*/translation/teams/PO/\([^/"]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\1.\2|p' <"$subdir/$domain.html" |
+ sort -k 1,1 -k 2,2n -k2,2 -k3,3n -k3,3 -k4,4n -k4,4 -k5,5n -k5.5 |
+ awk -F. '
+ { if (lang && $1 != lang) print lang, ver }
+ { lang = $1; ver = substr($0, index($0, ".") + 1) }
+ END { if (lang) print lang, ver }
+ ' | awk -v domain="$domain" -v subdir="$subdir" '
+ {
+ lang = $1
+ ver = $2
+ urlfmt = ""
+ printf "{ $WGET_COMMAND -O %s/%s.po '\'"$TP_PO_URL"'/%s/%s-%s.%s.po'\'' &&\n", subdir, lang, lang, domain, ver, lang
+ printf " msgfmt -c -o /dev/null %s/%s.po || {\n", subdir, lang
+ printf " echo >&2 '\'"$0"': omitting translation for %s'\''\n", lang
+ printf " rm -f %s/%s.po; }; } &&\n", subdir, lang
+ }
+ END { print ":" }
+ ' | sh;;
+ esac &&
+ ls "$subdir"/*.po 2>/dev/null |
+ sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" &&
+ rm -f "$subdir/$domain.html"
}
case $SKIP_PO in
'')
case `wget --help` in
*'--no-cache'*)
- no_cache='--no-cache';;
+ WGET_COMMAND='wget -nv --no-cache';;
*'--cache=on/off'*)
- no_cache='--cache=off';;
+ WGET_COMMAND='wget -nv --cache=off';;
+ *'--non-verbose'*)
+ WGET_COMMAND='wget -nv';;
*)
- no_cache='';;
+ WGET_COMMAND='';;
esac
- WGET_COMMAND="wget -nv $no_cache"
- export WGET_COMMAND
-
get_translations po $package || exit
if test -d runtime-po; then