Add link to the sources of a port at the bottom of the description page
This commit is contained in:
parent
7b590c20f9
commit
98aa89eea4
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=2147
2 changed files with 24 additions and 6 deletions
|
|
@ -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/</</g;
|
||||
s%(http://[^\s"\)\>,;]+)%<A HREF="$1">$1</A>%g;
|
||||
s%([\w\-\.]+\@[\w\-\.]+\.[a-z]+)%<A HREF="mailto:$1">$1</A>%g;'
|
||||
echo "</pre>";
|
||||
|
||||
echo "</pre></BODY></HTML>"
|
||||
# add link to sources
|
||||
case "$url" in
|
||||
*pub/FreeBSD/FreeBSD-current/ports/*/*/pkg/DESCR)
|
||||
echo -n "<HR><a href=\"pds.cgi?"
|
||||
echo "$url" | perl -npe 's%.*/(ports/[^/]+/[^/]+)/pkg/DESCR\s*%$1%'
|
||||
echo "\">Sources</a>"
|
||||
;;
|
||||
esac
|
||||
echo "</BODY></HTML>"
|
||||
else
|
||||
printf "Location: $url\n";
|
||||
printf "Content-type: text/plain\n\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue