source: clfs-embedded/patches/iana-etc-2.30-update-2.patch@ 2ac72a8

Last change on this file since 2ac72a8 was 3e2104b, checked in by Andrew Bradford <andrew@…>, 11 years ago

Fix iana-etc patch and 'make get'

Use Arch Linux patch.

  • Property mode set to 100644
File size: 4.4 KB
RevLine 
[3e2104b]1Submitted By: Andrew Bradford <andrew@bradfordembedded.com>
2Date: 2013-10-22
3Initial Package Version: 2.30
4Origin: Arch Linux
5Upstream Status: Not Applied
6Description: Patch provides the changes to Makefile required to enable 'make get'
7
8diff -Naur old/Makefile new/Makefile
9--- old/Makefile 2008-03-06 05:02:40.000000000 +1100
10+++ new/Makefile 2012-07-23 03:20:19.009174483 +1000
11@@ -42,11 +42,11 @@
12 protocol-numbers.iana port-numbers.iana
13
14 protocol-numbers.iana:
15- $(AWK) -f get.gawk -v file=protocol-numbers >protocol-numbers.iana
16+ $(AWK) -f get.gawk -v file=protocol-numbers/protocol-numbers.xml >protocol-numbers.iana
17 rm -f protocol-numbers
18
19 port-numbers.iana:
20- $(AWK) -f get.gawk -v file=port-numbers >port-numbers.iana
21+ $(AWK) -f get.gawk -v file=service-names-port-numbers/service-names-port-numbers.xml >port-numbers.iana
22 rm -f port-numbers
23
24 protocol-numbers:
25diff -Naur old/get.gawk new/get.gawk
26--- old/get.gawk 2008-03-06 05:04:18.000000000 +1100
27+++ new/get.gawk 2012-07-23 03:20:19.009174483 +1000
28@@ -26,7 +26,7 @@
29 NR++
30
31 if (in_content) { print }
32- if (/^$/) { in_content=1 }
33+ if (/^\r?$/) { in_content=1 }
34 }
35
36 printf "\n" >"/dev/stderr"
37diff -Naur old/protocols.gawk new/protocols.gawk
38--- old/protocols.gawk 2006-11-15 05:20:26.000000000 +1100
39+++ new/protocols.gawk 2012-07-23 03:22:13.479330458 +1000
40@@ -1,32 +1,13 @@
41-#!/usr/bin/gawk --re-interval -f
42-# the above doesn't work (stupid kernel) but serves as documentation
43-
44-# Copyright (c) 2003-2004, 2006 Seth W. Klein <sk@sethwklein.net>
45-# Licensed under the Open Software License version 3.0
46-# See the file COPYING in the distribution tarball or
47-# http://www.opensource.org/licenses/osl-3.0.txt
48+#!/usr/bin/awk -f
49
50 BEGIN {
51- if (strip == "yes") {
52- strip = 1
53- format = "%s\t%s\t%s\n"
54- header_printed = 1
55- } else {
56- strip = 0
57- print "# See also: protocols(5)" \
58- ", http://www.sethwklein.net/projects/iana-etc/\n#"
59- format = "%-12s %3s %-12s # %s\n"
60- header_printed = 0
61- }
62+ print "# See the full IANA XML file at: /usr/share/iana-etc/protocol-numbers.iana\n"
63+ FS="[<>]"
64 }
65-{ sub(/\r/, "") }
66-match($0, /^[ \t]+([0-9]+)[ \t]{1,5}([^ \t]+)(.*)/, f) {
67- if ( ! header_printed) {
68- printf format, "# protocol", "num", "aliases", "comments"
69- header_printed = 1;
70- }
71- sub(/^[ \t]*/, "", f[3])
72- printf format, tolower(f[2]), f[1], f[2], f[3]
73- next
74+
75+{
76+ if (/<record/) { v=n=0 }
77+ if (/<value/) v=$3
78+ if (/<name/ && !($3~/ /)) n=$3
79+ if (/<\/record/ && (v || n=="HOPOPT") && n) printf "%-12s %3i %s\n", tolower(n),v,n
80 }
81-!strip { print "# " $0 }
82diff -Naur old/services.gawk new/services.gawk
83--- old/services.gawk 2008-03-06 04:51:45.000000000 +1100
84+++ new/services.gawk 2012-07-23 03:22:32.272685489 +1000
85@@ -1,44 +1,15 @@
86-#!/usr/bin/gawk -f
87-
88-# Copyright (c) 2003-2004, 2006, 2008 Seth W. Klein <sk@sethwklein.net>
89-# Licensed under the Open Software License version 3.0
90-# See the file COPYING in the distribution tarball or
91-# http://www.opensource.org/licenses/osl-3.0.txt
92+#!/usr/bin/awk -f
93
94 BEGIN {
95- if (strip == "yes") {
96- strip = 1
97- } else {
98- strip = 0
99- print "# See also: services(5)" \
100- ", http://www.sethwklein.net/projects/iana-etc/\n#"
101- }
102- while (getline <"port-aliases") {
103- sub(/#.*/, "")
104- if (/^[ \t]*$/) { continue }
105- # 1:name 2:protocol 3:aliases
106- match($0, /^[ \t]*([^ \t]+)[ \t]+([^ \t]+)[ \t]+(.*)$/, f)
107- aliases[f[1] " " f[2]] = " " f[3]
108- }
109+ print "# See the full IANA XML file at: /usr/share/iana-etc/port-numbers.iana\n"
110+ FS="[<>]"
111 }
112-{ sub(/\r/, "") }
113-# 1:name 2:ws 3:port 4:range 5:proto 6:comment
114-match($0, /(^[[:alnum:]][^ \t]+)([ \t]+)([0-9]+)(-[0-9]+)?\/([^ \t]+)(.*)/, f) \
115-&& f[3] != "0" {
116-# port 0 means unallocated, per port-numbers
117- name = f[1]
118- whitespace = f[2]
119- port = f[3]
120- protocol = f[5]
121- comment = f[6]
122- if (strip) {
123- whitespace = "\t"
124- comment = ""
125- } else if (length(comment) > 0)
126- sub(/^[ \t]*/, "&# ", comment)
127- print name whitespace port "/" protocol aliases[name " " protocol] comment
128- next
129+
130+{
131+ if (/<record/) { n=u=p=c=0 }
132+ if (/<name/ && !/\(/) n=$3
133+ if (/<number/) u=$3
134+ if (/<protocol/) p=$3
135+ if (/Unassigned/ || /Reserved/ || /historic/) c=1
136+ if (/<\/record/ && n && u && p && !c) printf "%-15s %5i/%s\n", n,u,p # services
137 }
138-# comment out, prettily
139-!/^#/ { sub(/^ /, "#") || sub(/^/, "# ") }
140-!strip { print }
Note: See TracBrowser for help on using the repository browser.