From owner-freebsd-current@freebsd.org Tue Sep 11 14:18:35 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4368F1092205 for ; Tue, 11 Sep 2018 14:18:35 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8DEB78409 for ; Tue, 11 Sep 2018 14:18:34 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: by sdaoden.eu (Postfix, from userid 1000) id D03691604A; Tue, 11 Sep 2018 16:18:25 +0200 (CEST) Date: Tue, 11 Sep 2018 16:20:00 +0200 From: Steffen Nurpmeso To: Eric van Gyzen Cc: freebsd-current@freebsd.org Subject: Re: Request for Review: Generate /etc/services from the IANA registry Message-ID: <20180911142000.unrYV%steffen@sdaoden.eu> In-Reply-To: <59cd421e-f5d4-855a-83ec-65726f792555@vangyzen.net> References: <8b7930bc-1086-05d3-c019-052368ddf097@vangyzen.net> <59cd421e-f5d4-855a-83ec-65726f792555@vangyzen.net> Mail-Followup-To: Eric van Gyzen , freebsd-current@freebsd.org User-Agent: s-nail v14.9.11-45-g9c6690b7 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Sep 2018 14:18:35 -0000 Eric van Gyzen wrote in <59cd421e-f5d4-855a-83ec-65726f792555@vangyzen.net>: |On 9/10/18 12:04 PM, Eric van Gyzen wrote: |> Would anyone like to review this change to generate /etc/services from= =20 |> the IANA registry? |>=20 |> =C2=A0=C2=A0=C2=A0=C2=A0https://reviews.freebsd.org/D17106 | |If that review made your browser unhappy, try this one instead: Yes it did. | https://reviews.freebsd.org/D17115 I mean, i have nothing to do with FreeBSD except that i use it since 4.7 (though some yours only indirectly as Mac OS X), and i am in opposition to quite some directions taken, but who am i, that is ok, i have a very narrow use case. But this is one of the things i really do not understand, bringing XML and Python stuff needlessly into FreeBSD seems very odd. For example, ArchLinux and CRUX Linux use a simple portable awk script to generate services and protocols, and all you need to count the number of services is a normal Unix pipeline which strips comments and then calls wc -l. I'll paste the script below this. Thank you. And ciao already here #!/bin/sh - #@ Update protocols and services from IANA. #@ Taken from ArchLinux script written by Gaetan Bisson. Adjusted for CRUX. awk=3Dawk curl=3Dcurl url_pn=3Dhttps://www.iana.org/assignments/protocol-numbers/protocol-numbers= .xml url_snpn=3Dhttps://www.iana.org/assignments/service-names-port-numbers/\ service-names-port-numbers.xml datetime=3D`date +'%FT%T%z'` download() { echo 'Downloading protocols' ${curl} -o protocols.xml ${url_pn} [ ${?} -eq 0 ] || exit 20 echo 'Downloading services' ${curl} -o services.xml ${url_snpn} [ ${?} -eq 0 ] || exit 21 } process() { echo 'Processing protocols' ${awk} -F "[<>]" -v URL=3D"${url_pn}" -v DT=3D"${datetime}" ' BEGIN{ print "# /etc/protocols, created " DT print "# Source: " URL } / protocols.new [ ${?} -eq 0 ] || exit 30 echo 'Processing services' ${awk} -F "[<>]" -v URL=3D"${url_snpn}" -v DT=3D"${datetime}" ' BEGIN{ print "# /etc/services, created " DT print "# Source: " URL } / services.new [ ${?} -eq 0 ] || exit 31 } update() { mv protocols.new protocols [ ${?} -eq 0 ] || exit 40 mv services.new services [ ${?} -eq 0 ] || exit 41 rm -f protocols.xml services.xml } download process #update --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)