Add NetBSD releng related DCGI/CGI (gopher interface to releng.n.o) - gophercgis - Collection of gopher CGI/DCGI for geomyidae (HTM) hg clone https://bitbucket.org/iamleot/gophercgis (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) changeset 42f5cfb9373032ff8b311e4e9ae56b1c83a6c969 (DIR) parent 4506ec0b5991383046a23aa2b925e2c1dda8766c (HTM) Author: Leonardo Taccari <iamleot@gmail.com> Date: Sun, 26 Aug 2018 23:51:10 Add NetBSD releng related DCGI/CGI (gopher interface to releng.n.o) Diffstat: netbsd/req.dcgi | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ netbsd/ticket.cgi | 23 ++++++++++++++++++ 2 files changed, 90 insertions(+), 0 deletions(-) --- diff -r 4506ec0b5991 -r 42f5cfb93730 netbsd/req.dcgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netbsd/req.dcgi Sun Aug 26 23:51:10 2018 +0200 @@ -0,0 +1,67 @@ +#!/bin/sh + + +CGI_TICKET="/cgi/netbsd/ticket.cgi" + + +branch="$2" +case "${branch}" in + pkgsrc | 7 | 8 ) + ;; + *) + exit 1 + ;; +esac + + +# +# Parse the <table> containing tickets information +# +filter_table() +{ + + awk ' + /<td align=left>/ && /show=/ { + match($0, /show=[0-9]+"/) + ticket = substr($0, RSTART + 5, RLENGTH - 6) + + sub(/^.*show=[0-9]+">/, "") + sub(/<\/a><\/td>$/, "") + subject = $0 + } + + /<td / && /prio=/ { + match($0, /prio=[^"]+"/) + priority = substr($0, RSTART + 5, RLENGTH - 6) + } + + /<td / && /owner=/ { + match($0, /owner=[^"]+"/) + owner = substr($0, RSTART + 6, RLENGTH - 7) + } + + /<td / && /user=/ { + match($0, /user=[^"]+"/) + requester = substr($0, RSTART + 5, RLENGTH - 6) + } + + ticket && priority && requester && subject { + title = "#" ticket " - " subject " " "(" requester ")" + printf("[0|%s|'"${CGI_TICKET}?${branch}/"'%s|server|port]\n", + title, ticket) + + ticket = priority = requester = subject = owner = "" + } + ' + +} + +echo "" +echo "Pullup Ticket List - NetBSD ${branch}" +echo "" + +url="http://releng.netbsd.org/cgi-bin/req-${branch}.cgi" +/usr/bin/ftp -V -o - "${url}" | + filter_table + +echo "" diff -r 4506ec0b5991 -r 42f5cfb93730 netbsd/ticket.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netbsd/ticket.cgi Sun Aug 26 23:51:10 2018 +0200 @@ -0,0 +1,23 @@ +#!/bin/sh + +branch="${2%%/*}" +ticket="${2##*/}" + +case "${branch}" in + pkgsrc| 7 | 8 ) + ;; + *) + exit 1 + ;; +esac + +case "${ticket}" in + [0-9]*) + ;; + *) + exit 1 + ;; +esac + +url="http://releng.netbsd.org/cgi-bin/req-${branch}.cgi?show=${ticket}" +/usr/bin/ftp -V -o - "${url}"