Module Name: src Committed By: ginsbach Date: Fri Sep 7 21:04:43 UTC 2012
Modified Files: src/share/misc: make.country Log Message: - Fix broken links (ISO web site reorganized). Script now works again. - Use a few more variables so that it will be easier to change the next time ISO shuffles the deck. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/misc/make.country Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/misc/make.country diff -u src/share/misc/make.country:1.1 src/share/misc/make.country:1.2 --- src/share/misc/make.country:1.1 Tue Dec 15 03:38:58 2009 +++ src/share/misc/make.country Fri Sep 7 21:04:43 2012 @@ -10,8 +10,7 @@ cat << _EOF # <Name><TAB><Alpha-2-code><TAB><Alpha-3-code><TAB><Numeric-3-code><TAB><FIPS> # # Further information can be found at the ISO 3166 Maintenance Agency -# (ISO 3166/MA) web site, -# <http://www.iso.org/iso/en/prods-services/iso3166ma/index.html>. +# (ISO 3166/MA) web site, <http://www.iso.org/iso/country_codes>. # # FIPS 10-4 codes compiled from several sources, including # http://www.statoids.com/wab.html @@ -25,15 +24,17 @@ cat << _EOF _EOF } -I1=http://www.statoids.com/wab.html +I1=wab.html +U1=http://www.statoids.com/$I1 O1=/tmp/wab.$$ -I2=http://www.iso.org/iso/list-en1-semic-3.txt +I2=country_names_and_code_elements_txt +U2=http://www.iso.org/iso/$I2 O2=/tmp/list.$$ -trap "rm -f wab.html list-en1-semic-3.txt $O1 $O2" 0 1 2 3 15 -ftp $I1 -ftp $I2 +trap "rm -f $I1 $I2 $O1 $O2" 0 1 2 3 15 +ftp $U1 +ftp $U2 -grep '<tr class="[oe]">' wab.html | +grep '<tr class="[oe]">' $I1 | sed -e 's,<tr class="."><td>,,g' \ -e 's,\ ,,g' \ -e 's,<code>,,g' \ @@ -47,7 +48,7 @@ awk -F'\t' '{ printf("%s\t%s\t%s\t%s\t%s grep -v href= | sort > $O1 -grep ';[A-Z][A-Z]' list-en1-semic-3.txt | +grep ';[A-Z][A-Z]' $I2 | tr -d '\015' | awk -F ';' '{ print $2 }' | sort > $O2