[arch-commits] Commit in iana-etc/trunk (PKGBUILD)

Gaëtan Bisson bisson at archlinux.org
Fri Nov 22 23:12:27 UTC 2019


    Date: Friday, November 22, 2019 @ 23:12:27
  Author: bisson
Revision: 369616

upstream update, switch upstream files to arch-hosted versioned copy

Modified:
  iana-etc/trunk/PKGBUILD

----------+
 PKGBUILD |   32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-11-22 22:43:33 UTC (rev 369615)
+++ PKGBUILD	2019-11-22 23:12:27 UTC (rev 369616)
@@ -2,7 +2,7 @@
 # Maintainer: Gaetan Bisson <bisson at archlinux.org>
 
 pkgname=iana-etc
-pkgver=20191030
+pkgver=20191122
 pkgrel=1
 pkgdesc='/etc/protocols and /etc/services provided by IANA'
 url='https://www.iana.org/protocols'
@@ -9,29 +9,27 @@
 arch=('any')
 license=('custom:none')
 backup=('etc/'{protocols,services})
-source=('https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml'
-        'https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml'
+source=("https://sources.archlinux.org/other/packages/iana-etc/service-names-port-numbers-${pkgver}.xml"
+        "https://sources.archlinux.org/other/packages/iana-etc/protocol-numbers-${pkgver}.xml"
         'LICENSE')
-sha256sums=('ae01c72a93b49308ad528ede262e80d80e5120646793253ce3272434cb21d3f9'
+sha256sums=('2535270891e99febb368bf66c0e99550523db8123411652a33a77a94db9b6cd9'
             '4992fbc5453d0feb48492e6abda96bf9285ff4d2516f6924a0f92f773dc4cea2'
             'dd37e92942d5a4024f1c77df49d61ca77fc6284691814903a741785df61f78cb')
 
-# Please note that upstream silently updates those files in place every so
-# often, which causes checksum mismatch. Report this by flagging the package as
-# out-of-date. Cheers.
+# Original but unversioned IANA files:
+# https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml
+# https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml
 
-pkgver() {
+package() {
 	cd "${srcdir}"
-	awk -F"[<>]" '/updated/{print$3;nextfile}' * |
-	sort -n | tail -n 1 | tr -d -
-}
 
-package() {
-	cd "${srcdir}"
+	_ports="service-names-port-numbers-${pkgver}.xml"
+	_protocols="protocol-numbers-${pkgver}.xml"
+
 	install -d "${pkgdir}/etc"
 	install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/iana-etc/LICENSE"
-	install -Dm644 protocol-numbers.xml "${pkgdir}/usr/share/iana-etc/protocol-numbers.iana"
-	install -Dm644 service-names-port-numbers.xml "${pkgdir}/usr/share/iana-etc/port-numbers.iana"
+	install -Dm644 ${_ports} "${pkgdir}/usr/share/iana-etc/port-numbers.iana"
+	install -Dm644 ${_protocols} "${pkgdir}/usr/share/iana-etc/protocol-numbers.iana"
 
 	gawk -F"[<>]" '
 BEGIN { print "# Full data: /usr/share/iana-etc/protocol-numbers.iana\n" }
@@ -39,7 +37,7 @@
 (/<value/) { v=$3 }
 (/<name/ && $3!~/ /) { n=$3 }
 (/<\/record/ && n && v!="") { printf "%-12s %3i %s\n", tolower(n),v,n }
-' protocol-numbers.xml > "${pkgdir}/etc/protocols"
+' ${_protocols} > "${pkgdir}/etc/protocols"
 
 	gawk -F"[<>]" '
 BEGIN { print "# Full data: /usr/share/iana-etc/port-numbers.iana\n" }
@@ -49,6 +47,6 @@
 (/<protocol/) { p=$3 }
 (/Unassigned/ || /Reserved/ || /historic/) { c=1 }
 (/<\/record/ && n && u && p && !c) { printf "%-15s %5i/%s\n", n,u,p }
-' service-names-port-numbers.xml > "${pkgdir}/etc/services"
+' ${_ports} > "${pkgdir}/etc/services"
 
 }



More information about the arch-commits mailing list