Request for Review: Generate /etc/services from the IANA registry

Eric van Gyzen eric at vangyzen.net
Tue Sep 11 15:10:17 UTC 2018


On 9/11/18 10:04 AM, Steffen Nurpmeso wrote:
> Alan Somers wrote in <CAOtMX2iHph_mS9PBkSaSs+dsjVa9niScQ9-Q-efr5pavf_9tZ\
> w at mail.gmail.com>:
>   |Don't worry Steffen.  Python won't be a build requirement for FreeBSD \
>   |even after Eric's patch.  His Python script will only need to be run \
>   |whenever IANA
>   |updates its database, and the results will be checked into source contro\
>   |l.  So for a normal user, there is no change to "make buildworld && make
>   |installworld".
> 
> I cannot, unfortunately.  I use binary updates and even
> preinstalled VM images (thanks for that, by the way).

So there will be no impact on you at all, except that /etc/services will 
have a lot more services.  As Alan said, Python and XML will only be 
added to the developer workflow.

>   |As for Python vs Awk, I too tried to do this with Awk.  However, Awk \
>   |can't easily handle things like IANA's representation of aliases, and \
>   |it can't
>   |easily format the list in the same order as our current list.  Python \
>   |is truly a better choice.
> 
> I absolutely fail to see what you mean.  The script (which is in
> actual use, mind you) generates the desired output except that
> comments get lost, but this could be added upon interest, of
> course.  It (or a derivative) would have been a good candidate for
> /usr/share/misc/ in elder times i guess, too.

That awk script depends on the formatting of the XML file.  It will 
break if the IANA decides to format it differently.  Granted, this is 
unlikely, but it's possible.

Also, that script would become much more complex if it supported local 
additions and overrides, which are unfortunately necessary in our case.

Eric


More information about the freebsd-current mailing list