diff --git a/data/cgi/pds.cgi b/data/cgi/pds.cgi index da0df90b3b..93d6097cc2 100755 --- a/data/cgi/pds.cgi +++ b/data/cgi/pds.cgi @@ -1,112 +1,113 @@ #!/usr/bin/perl # Copyright (c) 1997-1998 Wolfram Schneider , Berlin. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # pds.cgi - FreeBSD Ports download sources cgi script # print a list of source files for a port # -# $Id: pds.cgi,v 1.2 1998-04-19 13:40:42 wosch Exp $ +# $Id: pds.cgi,v 1.3 1998-05-15 09:24:20 wosch Exp $ $hsty_base = ''; +$hsty_email = 'ports@freebsd.org'; require "./cgi-lib.pl"; require "./cgi-style.pl"; $file = $ENV{'QUERY_STRING'}; $file2="$file/Makefile"; $cvsroot = "/home/ncvs"; $co = '/usr/bin/co'; $make = '/usr/bin/make'; # set DISTDIR to a dummy directory. $ENV{'DISTDIR'} = "/tmp/___pds.cgi___" . $<; sub footer { return qq{

\nHelp\n} . &html_footer; } print &short_html_header("FreeBSD Ports download script"); print "

\n"; if ($file !~ m%^ports/[^/]+/[^/]+$%) { print qq{wrong module name: "$file"\n} . &footer; exit; } if (! -f "$cvsroot/$file2,v") { print qq{file "$file2" does no exists.\n} . &footer; exit; } if ($file =~ /\.\./) { print qq{$file2 does not exist\n} . &footer; exit; } print "

Sources for $file

\n\n"; open(MAKE, "$co -q -p $cvsroot/$file2 | $make -I /home/fenner/mk -f - bill-fetch |") || do { print "Sorry, cannot run make\n" . &footer; exit; }; local(@sources); while() { push(@sources, $_); } close MAKE; if ($#sources < 0) { print "Sorry, did not found the sources for $file\n" . &footer; exit; } foreach (@sources) { print qq{$1
\n} if m%((http|ftp)://\S+)%; } local($md5file) = "$cvsroot/$file/files/md5,v"; if (-f $md5file) { open(CO, "-|") || exec ($co, '-q', '-p', $md5file) || do { print "Cannot read MD5 checksum file for $file\n" . &footer; exit; }; local(@checksums); while() { push(@checksums, $_) if $_; } close CO; if ($#checksums >= 0) { print "

MD5 Checksum for $file

\n\n"; print "
\n";
         print @checksums;
         print "
\n"; } } print &footer; exit; diff --git a/data/cgi/url.cgi b/data/cgi/url.cgi index 3ea3379106..2cf9f88b9c 100755 --- a/data/cgi/url.cgi +++ b/data/cgi/url.cgi @@ -1,84 +1,85 @@ #!/usr/local/bin/perl -T # # Copyright (c) Oct 1997 Wolfram Schneider . Berlin. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # url.cgi - make plain text URLs clickable # -# $Id: url.cgi,v 1.5 1998-04-01 18:48:32 wosch Exp $ +# $Id: url.cgi,v 1.6 1998-05-15 09:24:21 wosch Exp $ require LWP::UserAgent; $hsty_base = ''; +$hsty_email = 'ports@freebsd.org'; require "./cgi-lib.pl"; require "./cgi-style.pl"; $ua = new LWP::UserAgent; $ua -> max_size(20*1024); $file = $ENV{'QUERY_STRING'}; $uri = "$file"; if ($file !~ m%^http://[a-z_\-0-9]+\.freebsd\.(com|org)%i) { &CgiError(("Wrong url", "Only http://*.freebsd.* is allowed.\n")); exit(0); } $request = new HTTP::Request('GET', "$uri"); $response = $ua->request($request); if ($response -> is_success) { if ($response -> content_type eq "text/plain") { print &short_html_header("bla"); print "\n
\n
\n";
 	
 	my($content) = $response -> content;
 	$content =~ s/,;]+)%$1%gi;
 	print $content;
 	print "
\n"; # Add 'source' link for freebsd ports if ($file =~ m%pub/FreeBSD/FreeBSD-current/(ports/[^/]+/[^/]+)/pkg/DESCR$%) { print qq{
Sources\n}; print qq{| Help\n}; print qq{
\n}; } print &html_footer; exit; } else { # no plain text, do a redirect print "Location: $uri\n"; print "Content-type: text/plain\n\n"; } } else { # quick and dirty hack for non existings urls print "Location: $uri\n"; print "Content-type: text/plain\n\n"; } diff --git a/en/cgi/pds.cgi b/en/cgi/pds.cgi index da0df90b3b..93d6097cc2 100755 --- a/en/cgi/pds.cgi +++ b/en/cgi/pds.cgi @@ -1,112 +1,113 @@ #!/usr/bin/perl # Copyright (c) 1997-1998 Wolfram Schneider , Berlin. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # pds.cgi - FreeBSD Ports download sources cgi script # print a list of source files for a port # -# $Id: pds.cgi,v 1.2 1998-04-19 13:40:42 wosch Exp $ +# $Id: pds.cgi,v 1.3 1998-05-15 09:24:20 wosch Exp $ $hsty_base = ''; +$hsty_email = 'ports@freebsd.org'; require "./cgi-lib.pl"; require "./cgi-style.pl"; $file = $ENV{'QUERY_STRING'}; $file2="$file/Makefile"; $cvsroot = "/home/ncvs"; $co = '/usr/bin/co'; $make = '/usr/bin/make'; # set DISTDIR to a dummy directory. $ENV{'DISTDIR'} = "/tmp/___pds.cgi___" . $<; sub footer { return qq{

\nHelp\n} . &html_footer; } print &short_html_header("FreeBSD Ports download script"); print "

\n"; if ($file !~ m%^ports/[^/]+/[^/]+$%) { print qq{wrong module name: "$file"\n} . &footer; exit; } if (! -f "$cvsroot/$file2,v") { print qq{file "$file2" does no exists.\n} . &footer; exit; } if ($file =~ /\.\./) { print qq{$file2 does not exist\n} . &footer; exit; } print "

Sources for $file

\n\n"; open(MAKE, "$co -q -p $cvsroot/$file2 | $make -I /home/fenner/mk -f - bill-fetch |") || do { print "Sorry, cannot run make\n" . &footer; exit; }; local(@sources); while() { push(@sources, $_); } close MAKE; if ($#sources < 0) { print "Sorry, did not found the sources for $file\n" . &footer; exit; } foreach (@sources) { print qq{$1
\n} if m%((http|ftp)://\S+)%; } local($md5file) = "$cvsroot/$file/files/md5,v"; if (-f $md5file) { open(CO, "-|") || exec ($co, '-q', '-p', $md5file) || do { print "Cannot read MD5 checksum file for $file\n" . &footer; exit; }; local(@checksums); while() { push(@checksums, $_) if $_; } close CO; if ($#checksums >= 0) { print "

MD5 Checksum for $file

\n\n"; print "
\n";
         print @checksums;
         print "
\n"; } } print &footer; exit; diff --git a/en/cgi/url.cgi b/en/cgi/url.cgi index 3ea3379106..2cf9f88b9c 100755 --- a/en/cgi/url.cgi +++ b/en/cgi/url.cgi @@ -1,84 +1,85 @@ #!/usr/local/bin/perl -T # # Copyright (c) Oct 1997 Wolfram Schneider . Berlin. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # url.cgi - make plain text URLs clickable # -# $Id: url.cgi,v 1.5 1998-04-01 18:48:32 wosch Exp $ +# $Id: url.cgi,v 1.6 1998-05-15 09:24:21 wosch Exp $ require LWP::UserAgent; $hsty_base = ''; +$hsty_email = 'ports@freebsd.org'; require "./cgi-lib.pl"; require "./cgi-style.pl"; $ua = new LWP::UserAgent; $ua -> max_size(20*1024); $file = $ENV{'QUERY_STRING'}; $uri = "$file"; if ($file !~ m%^http://[a-z_\-0-9]+\.freebsd\.(com|org)%i) { &CgiError(("Wrong url", "Only http://*.freebsd.* is allowed.\n")); exit(0); } $request = new HTTP::Request('GET', "$uri"); $response = $ua->request($request); if ($response -> is_success) { if ($response -> content_type eq "text/plain") { print &short_html_header("bla"); print "\n
\n
\n";
 	
 	my($content) = $response -> content;
 	$content =~ s/,;]+)%$1%gi;
 	print $content;
 	print "
\n"; # Add 'source' link for freebsd ports if ($file =~ m%pub/FreeBSD/FreeBSD-current/(ports/[^/]+/[^/]+)/pkg/DESCR$%) { print qq{
Sources\n}; print qq{| Help\n}; print qq{
\n}; } print &html_footer; exit; } else { # no plain text, do a redirect print "Location: $uri\n"; print "Content-type: text/plain\n\n"; } } else { # quick and dirty hack for non existings urls print "Location: $uri\n"; print "Content-type: text/plain\n\n"; }