X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=bootstrap;h=6d9ac6728374051a43874b33c5b71b9087cd8270;hb=42250f501075275fa97b54e7d64600e4f7a363cf;hp=0ea005f8a593585722c8145dd777dbbfe8ab8494;hpb=b09417ca8dee6c1cab5554cc085ae470b33c6ba2;p=chaz%2Ftar diff --git a/bootstrap b/bootstrap index 0ea005f..6d9ac67 100755 --- a/bootstrap +++ b/bootstrap @@ -2,11 +2,11 @@ # Bootstrap this package from CVS. -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, @@ -108,8 +108,9 @@ gnulib_files= # Translation Project URL, for the registry of all projects # and for the translation-team master directory. -TP_URL='http://www.iro.umontreal.ca/translation/registry.cgi?domain=' -TP_PO_URL='http://www.iro.umontreal.ca/translation/teams/PO/' +tp_url() { + echo "http://translationproject.org/domain/$1.html" +} extract_package_name=' /^AC_INIT(/{ @@ -221,33 +222,35 @@ get_translations() { '') echo "$0: wget not available; skipping translations";; ?*) - echo "$0: getting ${po_file:-translations} into $subdir for $domain..." && + url=`tp_url $domain` + baseurl=`expr "$url" : '\(.*\)/.*'` + echo "$0: getting translations into $subdir for $domain..." && case $po_file in '') (cd $subdir && rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'`);; esac && - - $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 po_file="$po_file" -v subdir="$subdir" ' + + $WGET_COMMAND -O "$subdir/$domain.html" "$url" && + + sed -n 's|.*href="\(.*\)/\([^/][^/]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\2:\3:\1|p' <"$subdir/$domain.html" | + sort -t: -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, $3 } + { lang = $1; ver = $2 } + END { if (lang) print lang, ver, $3 } + ' | awk -v domain="$domain" -v baseurl="$baseurl" -v subdir="$subdir" \ + -v po_file="$po_file" ' { lang = $1 if (po_file && po_file != (lang ".po")) next - 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 "{ $WGET_COMMAND -O %s/%s.po %s/%s/%s/%s-%s.%s.po &&\n", subdir, lang, baseurl, $3, 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 ":" } - ' | WGET_COMMAND="$WGET_COMMAND" sh;; + ' | WGET_COMMAND="$WGET_COMMAND" sh + ;; esac && ls "$subdir"/*.po 2>/dev/null | sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" && @@ -298,6 +301,24 @@ if [ -r $PAXUTILS_SRCDIR/gnulib.modules ]; then ` fi +ignore_file_list= +cleanup_ifl() { + test -n "$ignore_file_list" && rm -f $ignore_file_list +} + +trap 'cleanup_ifl' 1 2 3 15 + +# ignorefile DIR FILE +# add FILE to the temporary ignorelist in the directory DIR +ignorefile() { + file=$1/.ignore.$$ + echo "$2" >> $file + if `echo $ignore_list | grep -qv $file`; then + ignore_file_list="$ignore_file_list +$file" + fi +} + # copy_files srcdir dstdir copy_files() { for file in `cat $1/DISTFILES` @@ -314,6 +335,7 @@ copy_files() { fi echo "$0: Copying file $1/$file to $2/$dst" cp -p $1/$file $2/$dst + ignorefile $2 $dst done } @@ -324,6 +346,7 @@ echo "$0: Creating m4/paxutils.m4" echo "AC_DEFUN([${package}_PAXUTILS],[" cat ${PAXUTILS_SRCDIR}/m4/DISTFILES | sed '/^#/d;s/\(.*\)\.m4/pu_\1/' | tr a-z A-Z echo "])") > ./m4/paxutils.m4 +ignorefile m4 paxutils.m4 if [ -d rmt ]; then : @@ -458,7 +481,7 @@ slurp() { done if test $file = Makefile.am; then copied=$copied${sep}gnulib.mk; sep=$nl - remove_intl='/^[^#].*\/intl/s/^/#/' + remove_intl='/^[^#].*\/intl/s/^/#/;'"s,/$bt,,g" sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/gnulib.mk || { echo "$0: Copying $1/$dir/$file to $dir/gnulib.mk ..." && rm -f $dir/gnulib.mk && @@ -497,9 +520,14 @@ $copied" fi ig=$dir/$dot_ig + if [ -f $dir/.ignore.$$ ]; then + tfile=$dir/.ignore.$$ + else + tfile= + fi if test -f $ig; then echo "$copied" | sort -u - $ig | cmp -s - $ig || - echo "$copied" | sort -u - $ig -o $ig + echo "$copied" | sort -u - $ig $tfile -o $ig else copied="$dot_ig $copied" @@ -515,7 +543,7 @@ stamp-po $package.pot $copied" fi - echo "$copied" | sort -u -o $ig + echo "$copied" | sort -u - $tfile -o $ig fi || exit fi done @@ -619,5 +647,5 @@ if test -d runtime-po; then # Copy identical files from po to runtime-po. (cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po) fi - +cleanup_ifl echo "$0: done. Now you can run './configure'."