FS#31055 - [iana-etc] /etc/services missing comments; unable to build using ABS
Attached to Project:
Arch Linux
Opened by Phillip Smith (fukawi2) - Wednesday, 08 August 2012, 04:33 GMT
Last edited by Gaetan Bisson (vesath) - Wednesday, 08 August 2012, 06:44 GMT
Opened by Phillip Smith (fukawi2) - Wednesday, 08 August 2012, 04:33 GMT
Last edited by Gaetan Bisson (vesath) - Wednesday, 08 August 2012, 06:44 GMT
|
Details
Description:
The latest update for iana-etc (2.30-3) has stripped almost all comments from /etc/services. These comments are very useful as textual descriptions of ports, rather than cryptic shortnames. For example, shortname vs text description: "ntp" vs # Network Time Protocol "netbios-ns" vs # NETBIOS Name Service I'm also unable to rebuild myself using ABS. The output file I get now is empty apart from a heading comment: # See also: services(5), http://www.sethwklein.net/projects/iana-etc/ # I suspect it's something related to the Makefile patch that is applied, but I'm not familiar with gawk enough to debug it further. Additional info: iana-etc (2.30-3) x86_64 Steps to reproduce: Install iana-etc 2.30-3, /etc/services.pacnew will be created. |
This task depends upon
FS#30644: upstream has switched to a new XML format and there is no easy way to convert it to /etc/services while keeping the metadata presented meaningfully.Also, building from ABS works fine for me. If you had copy-pasted an error message or two into your bug report, it might have been a little more useful...
- You did not update your ABS tree before trying to build iana-etc.
- You did not see the first line of /etc/services which refers you to /usr/share/iana-etc/port-numbers.iana for the comments/metadata you were looking for.
I did see the comment regarding the XML file, but it's still not very friendly to read, especially if you want to grep for something in particular. It's just not sanely possible to `grep 554/tcp /etc/services` within the XML file.
http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt
cat service-names-port-numbers.txt | grep -Po '\S+\s+\d+\s+(tcp|udp)\s+[^\[]*' | perl -e 'while (<>) { ($sn, $pn, $prot, $c) = split(/\s+/, $_, 4); print "$sn\t$pn/$prot\t#$cmt"; }'
Also, your script outputs garbage here: no newline, mysterious $cmt variable, etc. But the plain text file has fundamental problems anyway, such as multi-line comments appearing before and after service lines (see for instance tcp/90 aka dnsix), etc. It seems to me that IANA generated some HTML from the XML and just fed that to `w3m -dump` or the like... So I would not even try to parse this file.
Of course, I would be interested if you found a simple and robust way to generate a nicer-to-read /etc/services. But nothing better than the current iana-etc came out of the thoughts I spent on this...