From 98aa89eea43e19409822af50d1f13a48a199edcf Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Sat, 8 Nov 1997 14:21:32 +0000 Subject: [PATCH] Add link to the sources of a port at the bottom of the description page --- data/cgi/url.cgi | 15 ++++++++++++--- en/cgi/url.cgi | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/data/cgi/url.cgi b/data/cgi/url.cgi index fd34c280ce..28d1f1b164 100755 --- a/data/cgi/url.cgi +++ b/data/cgi/url.cgi @@ -4,12 +4,12 @@ # # url.cgi - make plain text URLs clickable # -# $Id: url.cgi,v 1.2 1997-11-04 13:00:05 wosch Exp $ +# $Id: url.cgi,v 1.3 1997-11-08 14:21:32 wosch Exp $ PATH=/bin:/usr/bin:/usr/local/bin; export PATH url="$QUERY_STRING" -case $url in +case "$url" in http://*.freebsd.* | http://localhost/* );; *) printf "Content-type: text/plain\n\n" printf "Wrong url: \"$url\"\n" @@ -24,8 +24,17 @@ then perl -npe 's/,;]+)%$1%g; s%([\w\-\.]+\@[\w\-\.]+\.[a-z]+)%$1%g;' + echo ""; - echo "" + # add link to sources + case "$url" in + *pub/FreeBSD/FreeBSD-current/ports/*/*/pkg/DESCR) + echo -n "
Sources" + ;; + esac + echo "" else printf "Location: $url\n"; printf "Content-type: text/plain\n\n"; diff --git a/en/cgi/url.cgi b/en/cgi/url.cgi index fd34c280ce..28d1f1b164 100755 --- a/en/cgi/url.cgi +++ b/en/cgi/url.cgi @@ -4,12 +4,12 @@ # # url.cgi - make plain text URLs clickable # -# $Id: url.cgi,v 1.2 1997-11-04 13:00:05 wosch Exp $ +# $Id: url.cgi,v 1.3 1997-11-08 14:21:32 wosch Exp $ PATH=/bin:/usr/bin:/usr/local/bin; export PATH url="$QUERY_STRING" -case $url in +case "$url" in http://*.freebsd.* | http://localhost/* );; *) printf "Content-type: text/plain\n\n" printf "Wrong url: \"$url\"\n" @@ -24,8 +24,17 @@ then perl -npe 's/,;]+)%$1%g; s%([\w\-\.]+\@[\w\-\.]+\.[a-z]+)%$1%g;' + echo ""; - echo "" + # add link to sources + case "$url" in + *pub/FreeBSD/FreeBSD-current/ports/*/*/pkg/DESCR) + echo -n "
Sources" + ;; + esac + echo "" else printf "Location: $url\n"; printf "Content-type: text/plain\n\n";