Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/misc Rewrite the update-domains: target; there's now a...



details:   https://anonhg.NetBSD.org/src/rev/8fde2e790d8d
branches:  trunk
changeset: 543699:8fde2e790d8d
user:      jhawk <jhawk%NetBSD.org@localhost>
date:      Sun Mar 02 20:12:16 2003 +0000

description:
Rewrite the update-domains: target; there's now an html file to process,
not a flat text file (boo!). Use sed instead of perl, though. In-tree
tools are better.

Also, when inserted RCS tags into generated files, don't use a tag
that will get expanded in the Makefile; quote it such that it is
only expanded when the generated file is checked in.

diffstat:

 share/misc/Makefile |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (33 lines):

diff -r 01190b599d4b -r 8fde2e790d8d share/misc/Makefile
--- a/share/misc/Makefile       Sun Mar 02 20:10:39 2003 +0000
+++ b/share/misc/Makefile       Sun Mar 02 20:12:16 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.23 2002/09/18 08:12:30 lukem Exp $
+#      $NetBSD: Makefile,v 1.24 2003/03/02 20:12:16 jhawk Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/8/93
 
 NOOBJ= # defined
@@ -12,14 +12,15 @@
 # According to iana%ISI.EDU@localhost, the URL below is the authoritative list
 # distributed by the ISO 3166 Maintenance Agency.
 update-domains:
-       ftp -o /tmp/domains.$$$$ http://www.iana.org/country-codes.txt ; \
        ( \
-       echo '# $$NetBSD: Makefile,v 1.23 2002/09/18 08:12:30 lukem Exp $$' ;  \
-       echo '# ISO 3166 country codes, from http://www.iana.org/country-codes.txt' ;  \
-       echo '# '`grep ^Latest /tmp/domains.$$$$` ;  \
-       echo '#' ;  \
-       perl -ane 'print lc(join(" ", $$F[$$#F-2], @F[0..$$#F-3])),"\n" if /^[A-Z]{2,}\s*.*\d{3}\s*$$/;' </tmp/domains.$$$$ \
-       ) >domains ; \
-       rm /tmp/domains.$$$$
+         mkdir /tmp/domains.$$$$; cd /tmp/domains.$$$$ ; \
+         ftp -o - http://www.iana.org/cctld/cctld-whois.htm | \
+         tr -d \\015 | \
+         sed -f ${.CURDIR}/domains.sed > list ;\
+         echo '# $$''NetBSD: $$' ;  \
+         echo '# ISO 3166 country codes, from http://www.iana.org/cctld/cctld-whois.htm' ; \
+         cat top ; echo '#' ; cat list ; \
+        ) > domains ; \
+       rm -r /tmp/domains.$$$$
 
 .include <bsd.prog.mk>



Home | Main Index | Thread Index | Old Index