Date: Mon, 23 Dec 2002 11:03:14 -0600 (CST) From: Mark Linimon <linimon@lonesome.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: www/46500: new shell script to display PRs by port in HTML Message-ID: <200212231703.gBNH3EuR054526@lonesome.lonesome.com>
next in thread | raw e-mail | index | archive | help
>Number: 46500 >Category: www >Synopsis: new shell script to display PRs by port in HTML >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-www >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Dec 23 09:10:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Mark Linimon >Release: FreeBSD-4.7 >Organization: FreeBSD >Environment: System: FreeBSD lonesome.lonesome.com 4.7-STABLE FreeBSD 4.7-STABLE #0: Fri Nov 8 23:46:29 CST 2002 root@lonesome.lonesome.com:/usr/src/sys/compile/MULTIMEDIA i386 >Description: Here's a convenient script for creating an HTML page that attempts to list all open port PRs by portname. This would be a nice addition to the bento pages, but could be more generally useful. It only needs a local GNATS installation (in /usr/gnats) and a local /usr/ports/INDEX to run. Since it uses the underlying GNATS text search to correlate with portname, it won't be 100% accurate. A disclaimer is included on the HTML output. But, it should be a good start for quickly finding out if someone else has a PR in for a port you're looking at. Also, for the same reason, the script runs somewhat slowly, so it wouldn't be suitable for use as a cgi. I don't know if this would best be put into /usr/ports/Tools/scripts, or /usr/www/tools/prstats, or somewhere else. >How-To-Repeat: N/A >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # postportprs # echo x - postportprs sed 's/^X//' >postportprs << 'END-of-postportprs' X#! /bin/sh X# $FreeBSD$ X# For each port in /usr/ports/INDEX, generate a link to each of its current PRs X# and publish the result as a web page. Xindex="/usr/ports/INDEX" Xecho "<html><head><title>Current FreeBSD Problem Reports by portname</title></head>" Xecho "<body>" Xecho "<p>Report generated on `date`.</p>" Xecho "<p><font size=\"-1\">" Xecho "For explanatory information, see the <a href=\"#note\">note</a> below." Xecho "</font></p>" Xecho "<table cellpadding=\"2\" cellspacing=\"0\" border=\"1\">" Xecho "<tr><th>category/portname</th><th>current PRs</th>" Xfor i in `sed -e "s@|/usr/ports/@!@1" $index | sed -e "s@|.*@@" | sed -e "s@^.*!@@" | sort` Xdo X pr=`query-pr -c ports -x -t "$i" -q 2> /dev/null | sed -e "s/^[ ]*//;s/ .*//"` X if [ "$pr" != "" ] ; then X echo -n "<tr><td>$i</td><td>" X for pr in `query-pr -c ports -x -t "$i" -q 2> /dev/null | sed -e "s/^[ ]*//;s/ .*//"` X do X echo -n "<a href=\"http://www.freebsd.org/cgi/query-pr.cgi?pr=$pr\">$pr</a> " X done X echo "</td></tr>" X echo X fi Xdone Xecho "</table>" Xecho "<p><font size=\"-1\">" Xecho "<a name=\"note\">" Xecho "Note: this page is based on simple GNATS queries, which give" Xecho "false indications in the following two cases:" Xecho "<ul>" Xecho "<li>All PRs for ports named <code>quux/foobar</code> will incorrectly" Xecho "be duplicated under ports named <code>quux/foo</code>. This also" Xecho "is true for new port creation requests for <code>quux/foobar</code>.</li>" Xecho "<li>Any PRs that do not include the text string value for the correct" Xecho "<<code>category</code>>/<<code>portname</code>>" Xecho "at least <i>somewhere</i> within them will not be listed.</li>" Xecho "</ul></font></p>" Xecho "</body>" Xecho "</html>" X# END-of-postportprs exit >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-www" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212231703.gBNH3EuR054526>