From owner-p4-projects@FreeBSD.ORG Sun Jul 24 10:14:40 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2F42E1065670; Sun, 24 Jul 2011 10:14:40 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFD27106564A for ; Sun, 24 Jul 2011 10:14:39 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id CC9228FC14 for ; Sun, 24 Jul 2011 10:14:39 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OAEdNY008558 for ; Sun, 24 Jul 2011 10:14:39 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p6OAEd7G008555 for perforce@freebsd.org; Sun, 24 Jul 2011 10:14:39 GMT (envelope-from rene@FreeBSD.org) Date: Sun, 24 Jul 2011 10:14:39 GMT Message-Id: <201107241014.p6OAEd7G008555@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 196623 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 10:14:40 -0000 http://p4web.freebsd.org/@@196623?ac=10 Change 196623 by rene@rene_acer on 2011/07/24 10:14:30 IFC (and MFen network-servers) Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/Makefile#5 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/committers-guide/article.sgml#41 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#97 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.committers.sgml#63 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/port-mentor-guidelines/Makefile#1 branch .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/port-mentor-guidelines/article.sgml#1 branch .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/fdp-primer/tools/chapter.sgml#5 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/eresources/chapter.sgml#23 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml#28 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sgml#109 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/share/sgml/authors.ent#57 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/share/sgml/mailing-lists.ent#21 integrate .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/eresources/chapter.sgml#38 integrate .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/install/chapter.sgml#26 integrate .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/network-servers/chapter.sgml#46 edit .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/share/sgml/mailing-lists.ent#28 integrate .. //depot/projects/docproj_nl/share/pgpkeys/pgpkeys-developers.sgml#56 integrate .. //depot/projects/docproj_nl/share/pgpkeys/pgpkeys.ent#53 integrate .. //depot/projects/docproj_nl/share/pgpkeys/zi.key#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR/MIMEIterator.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR/Section.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR/Section/Email.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR/Section/FieldStart.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR/Section/MIME.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR/Section/Patch.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR/Section/StateChange.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR/Section/Text.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/GnatsPR/SectionIterator.pm#1 branch .. //depot/projects/docproj_nl/www/en/cgi/Makefile#2 integrate .. //depot/projects/docproj_nl/www/en/cgi/cgi-style.pl#8 integrate .. //depot/projects/docproj_nl/www/en/cgi/query-pr.cgi#5 integrate .. //depot/projects/docproj_nl/www/en/developers.sgml#58 integrate .. //depot/projects/docproj_nl/www/en/layout/css/query-pr.css#2 integrate .. //depot/projects/docproj_nl/www/en/search/search.sgml#10 integrate .. //depot/projects/docproj_nl/www/share/mk/web.site.mk#3 integrate .. //depot/projects/docproj_nl/www/share/sgml/news.xml#111 integrate .. //depot/projects/docproj_nl/www/share/sgml/usergroups.xml#25 integrate Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/Makefile#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: doc/en_US.ISO8859-1/articles/Makefile,v 1.62 2011/02/13 17:53:26 manolis Exp $ +# $FreeBSD: doc/en_US.ISO8859-1/articles/Makefile,v 1.63 2011/07/20 17:50:26 tabthorpe Exp $ SUBDIR = SUBDIR+= 5-roadmap @@ -43,6 +43,7 @@ SUBDIR+= new-users SUBDIR+= p4-primer SUBDIR+= pam +SUBDIR+= port-mentor-guidelines SUBDIR+= portbuild SUBDIR+= pr-guidelines SUBDIR+= problem-reports ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/committers-guide/article.sgml#41 (text+ko) ==== @@ -9,7 +9,7 @@ The &os; Documentation Project - $FreeBSD: doc/en_US.ISO8859-1/articles/committers-guide/article.sgml,v 1.300 2011/06/16 19:40:12 simon Exp $ + $FreeBSD: doc/en_US.ISO8859-1/articles/committers-guide/article.sgml,v 1.301 2011/07/18 12:57:33 gjb Exp $ 1999 @@ -1081,7 +1081,8 @@ Add yourself to the Developers section of the Contributors List (doc/en_US.ISO8859-1/articles/contributors/contrib.committers.sgml) and remove yourself from the Additional - Contributors section (doc/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml). + Contributors section (doc/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml). + Please note that entries are sorted by last name. @@ -1096,7 +1097,8 @@ doc/share/pgpkeys (and if you do not have a key, you should create one). Do not forget to commit the updated doc/share/pgpkeys/pgpkeys.ent - and doc/share/pgpkeys/pgpkeys-developers.sgml. + and doc/share/pgpkeys/pgpkeys-developers.sgml. + Please note that entries are sorted by last name. &a.des; has written a shell script (doc/share/pgpkeys/addkey.sh) to make this extremely simple. See the ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#97 (text+ko) ==== @@ -1,4 +1,4 @@ - + + Tools - + The FDP uses a number of different software tools to help manage the FreeBSD documentation, convert it to different output formats, and so on. You will need to use these tools yourself if - you are to work with the FreeBSD documentation. + you are to work with the FreeBSD documentation. All these tools are available as FreeBSD Ports and Packages, greatly simplifying the work you have to do to install - them. - + them. + You will need to install these tools before you work through any of the examples in later chapters. The actual usage of these - tools is covered in later chapters. + tools is covered in later chapters. Use <filename role="package">textproc/docproj</filename> If Possible @@ -87,38 +87,38 @@ Software - + These programs are required before you can usefully work with the FreeBSD documentation, and they will allow you to convert the documentation to HTML, plain text, and RTF formats. They are all included in textproc/docproj. - + Jade (textproc/jade) - + A DSSSL implementation. Used for converting marked up documents to other formats, including HTML and &tex;. - + Tidy (www/tidy) - + An HTML pretty printer, used to reformat some of the automatically generated HTML so that it is easier to follow. - + Links (www/links) - + A text-mode WWW browser that can also convert HTML files to plain text. @@ -128,7 +128,7 @@ peps (graphics/peps) - + Some of the documentation includes images, some of which are stored as EPS files. These must be converted to PNG before most @@ -143,30 +143,30 @@ These are the DTDs and entity sets used by the FDP. They need to be installed before you can work with any of the documentation. - + HTML DTD (textproc/html) - + HTML is the markup language of choice for the World Wide Web, and is used throughout the FreeBSD web site. - + DocBook DTD (textproc/docbook) - + DocBook is designed for marking up technical documentation. All the FreeBSD documentation is written in DocBook. - + ISO 8879 entities (textproc/iso8879) - + 19 of the ISO 8879:1986 character entity sets used by many DTDs. Includes named mathematical symbols, additional @@ -182,12 +182,12 @@ The stylesheets are used when converting and formatting the documentation for display on screen, printing, and so on. - + Modular DocBook Stylesheets (textproc/dsssl-docbook-modular) - + The Modular DocBook Stylesheets are used when converting documentation marked up in DocBook to other formats, such as @@ -208,14 +208,14 @@ Software - + JadeTeX and teTeX (print/jadetex and print/teTeX) - + Jade and teTeX are used to convert DocBook @@ -242,13 +242,13 @@ - + Emacs or - XEmacs + XEmacs (editors/emacs or editors/xemacs) - + Both these editors include a special mode for editing documents marked up according to an SGML DTD. This mode @@ -261,7 +261,7 @@ - + If anyone has recommendations for other software that is useful when manipulating SGML documents, please let &a.doceng; know, so they can be added to this list. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/eresources/chapter.sgml#23 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -406,6 +406,11 @@ + &a.office.name; + Office applications on &os; + + + &a.openoffice.name; Porting OpenOffice.org and &staroffice; to FreeBSD @@ -1409,6 +1414,18 @@ + &a.office.name; + + + Office applications on &os; + + Discussion centers around office applications, + their installation, their development and their support + within &os;. + + + + &a.openoffice.name; ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml#28 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -3873,7 +3873,7 @@ <acronym - role="Doman Name Security Extensions">DNSSEC</acronym> + role="Domain Name Security Extensions">DNSSEC BIND DNS security extensions @@ -4107,8 +4107,8 @@ also possible to rename the keys. For each KSK file do: - &prompt.user; mv Kexample.com+005+nnnnn.key Kexample.com+005+nnnnn.KSK.key -&prompt.user; mv Kexample.com+005+nnnnn.private Kexample.com+005+nnnnn.KSK.private + &prompt.user; mv Kexample.com.+005+nnnnn.key Kexample.com.+005+nnnnn.KSK.key +&prompt.user; mv Kexample.com.+005+nnnnn.private Kexample.com.+005+nnnnn.KSK.private For the ZSK files, substitute KSK for ZSK as necessary. The ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sgml#109 (text+ko) ==== @@ -1,7 +1,7 @@ - SRC_BASE?= /usr/src - -.if !exists(${SRC_BASE}/sys/Makefile) + .if !exists(${SRC_BASE}/sys/Makefile) IGNORE= requires kernel sources to be installed .endif @@ -14027,6 +14025,54 @@ into libm. + 802503 + May 1, 2011 + 8.2-STABLE after upgrade of the gcc to the last + GPLv2 version from the FSF gcc-4_2-branch. + + + 802504 + May 28, 2011 + 8.2-STABLE after introduction of the KPI and + supporting infrastructure for modular congestion + control. + + + 802505 + May 28, 2011 + 8.2-STABLE after introduction of Hhook and Khelp + KPIs. + + + 802506 + May 28, 2011 + 8.2-STABLE after addition of OSD to struct + tcpcb. + + + 802507 + June 6, 2011 + 8.2-STABLE after ZFS v28 import. + + + 802508 + June 8, 2011 + 8.2-STABLE after removal of sv_schedtail + struct sysvec method. + + + 802509 + July 14, 2011 + 8.2-STABLE after merging the SSSE3 support + into binutils. + + + 802510 + July 19, 2011 + 8.2-STABLE after addition of + RFTSIGZMB flag for rfork(2). + + 900000 August 22, 2009 9.0-CURRENT. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/share/sgml/authors.ent#57 (text+ko) ==== @@ -13,7 +13,7 @@ builds for the other languages, and we will poke fun of you in public. - $FreeBSD: doc/en_US.ISO8859-1/share/sgml/authors.ent,v 1.543 2011/06/14 08:16:25 gber Exp $ + $FreeBSD: doc/en_US.ISO8859-1/share/sgml/authors.ent,v 1.544 2011/07/15 21:07:31 zi Exp $ --> aaron@FreeBSD.org"> @@ -1296,6 +1296,8 @@ zec@FreeBSD.org"> +zi@FreeBSD.org"> + zml@FreeBSD.org"> znerd@FreeBSD.org"> ==== //depot/projects/docproj_nl/en_US.ISO8859-1/share/sgml/mailing-lists.ent#21 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -307,6 +307,10 @@ FreeBSD new-bus mailing list"> freebsd-new-bus"> + +Office applications on FreeBSD"> +freebsd-office"> + FreeBSD OpenOffice mailing list"> freebsd-openoffice"> ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/eresources/chapter.sgml#38 (text+ko) ==== @@ -1,7 +1,7 @@ ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/share/sgml/mailing-lists.ent#28 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -1446,6 +1446,11 @@ &pgpkey.vsevolod; + + &a.zi; + &pgpkey.zi; + + &a.rrs; &pgpkey.rrs; ==== //depot/projects/docproj_nl/share/pgpkeys/pgpkeys.ent#53 (text+ko) ==== @@ -1,5 +1,5 @@ - + @@ -361,6 +361,7 @@ + ==== //depot/projects/docproj_nl/www/en/cgi/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: www/en/cgi/Makefile,v 1.34 2007/03/19 05:44:58 dougb Exp $ +# $FreeBSD: www/en/cgi/Makefile,v 1.35 2011/07/20 23:52:12 shaun Exp $ .if exists(../Makefile.conf) .include "../Makefile.conf" @@ -9,12 +9,25 @@ DATA= DATA+= Gnats.pm +DATA+= GnatsPR.pm DATA+= cgi-lib.pl DATA+= cgi-style.pl DATA+= cvsweb.conf DATA+= cvsweb.conf-freebsd DATA+= query-pr-lib.pl +CGI_SUBDIRS= GnatsPR GnatsPR/Section + +CGI_SUBFILES+= GnatsPR/MIMEIterator.pm +CGI_SUBFILES+= GnatsPR/Section.pm +CGI_SUBFILES+= GnatsPR/Section/Email.pm +CGI_SUBFILES+= GnatsPR/Section/FieldStart.pm +CGI_SUBFILES+= GnatsPR/Section/MIME.pm +CGI_SUBFILES+= GnatsPR/Section/Patch.pm +CGI_SUBFILES+= GnatsPR/Section/StateChange.pm +CGI_SUBFILES+= GnatsPR/Section/Text.pm +CGI_SUBFILES+= GnatsPR/SectionIterator.pm + CGI= CGI+= confirm-code.cgi CGI+= cvsweb.cgi ==== //depot/projects/docproj_nl/www/en/cgi/cgi-style.pl#8 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.42 2011/01/08 14:58:27 wosch Exp $ +# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.43 2011/07/23 00:06:42 shaun Exp $ # # Perl routines to encapsulate various elements of HTML page style. @@ -32,6 +32,10 @@ $hsty_date = ''; } +if (!defined($hsty_charset)) { + $hsty_charset = 'iso-8859-1'; +} + # This can be set to either a string containing an inline CSS stylesheet # or to a element that references an external CSS stylesheet, to # make local modifications to the style of a CGI script's output. @@ -212,7 +216,7 @@ $html $title - + +# Copyright (C) 2006-2011, Shaun Amott # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,1177 +26,876 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: www/en/cgi/query-pr.cgi,v 1.69 2009/11/15 18:40:26 remko Exp $ +# $FreeBSD: www/en/cgi/query-pr.cgi,v 1.80 2011/07/23 02:42:59 shaun Exp $ +# +# Useful PRs for testing: # - +# - ports/147261 - RFC 2047 words, attachments, interjected e-mail (inc. +# malformed header) +# - ports/138672 - Lots of attachments, multi-level MIME. +# - ports/132344 - Base64-encoded attachment. # -# Note: this is a script to run on a webserver. If you want to do tests -# on the command-line, use the QUERY_STRING environment variable to -# pass parameters to the script: -# $ QUERY_STRING=pr=bin/106049 ./query-pr.cgi +# TODO: # +# - Charset and transfer encoding transformation. +# - Refine linkifier. +# - Better end-of-diff detection. +# - Inline patches inside MIME parts (probably just the first part). +# - Modernise HTML (may require altering site-wide CSS) +#------------------------------------------------------------------------------ -use strict; +BEGIN { push @INC, '.'; } + +use CGI; + +use GnatsPR; +use GnatsPR::SectionIterator; +use GnatsPR::MIMEIterator; -use MIME::Base64; # ports/converters/p5-MIME-Base64 -use MIME::QuotedPrint; # -use Convert::UU qw(uudecode uuencode); # ports/converters/p5-Convert-UU +#use MIME::EncWords (decode_mimewords); # mail/p5-MIME-EncWords +sub decode_mimewords { wantarray ? @_ : join ' ', @_; } # Temp. substitute for the above require './cgi-style.pl'; require './query-pr-lib.pl'; -use constant HTTP_HEADER => "Content-type: text/html; charset=UTF-8\r\n\r\n"; -use constant HTTP_HEADER_PATCH => "Content-type: text/plain; charset=UTF-8\r\nContent-Disposition: inline; filename=\"%s\"\r\n\r\n"; +use strict; + -use constant SECT_HEADER => 1; -use constant SECT_SFIELDS => 2; -use constant SECT_MFIELDS => 3; +#------------------------------------------------------------------------------ +# Constants +#------------------------------------------------------------------------------ -use constant ENCODING_BASE64 => 1; -use constant ENCODING_QP => 2; +use constant EXIT_NOPRS => 1; +use constant EXIT_DBBUSY => 2; +use constant EXIT_NOPATCH => 3; -use constant PATCH_ANY => 0x0001; -use constant PATCH_DIFF => 0x0002; -use constant PATCH_UUENC => 0x0004; -use constant PATCH_UUENC_BIN => 0x0008; -use constant PATCH_SHAR => 0x0010; -use constant PATCH_BASE64 => 0x0020; -my @fields_single = ( - "Number", "Category", "Synopsis", "Confidential", - "Severity", "Priority", "Responsible", "State", - "Quarter", "Keywords", "Date-Required", "Class", - "Submitter-Id", "Arrival-Date", "Closed-Date", "Last-Modified", - "Originator", "Release", -); +#------------------------------------------------------------------------------ +# Globals +#------------------------------------------------------------------------------ -my @fields_multiple = ( - "Organization", "Environment", "Description", "How-To-Repeat", - "Fix", "Release-Note", "Audit-Trail", "Unformatted", -); +our $valid_category = '[a-z0-9][A-Za-z0-9-_]{1,25}'; +our $valid_pr = '\d{1,8}'; -my $fields_skip = "Confidential|Quarter|Keywords|Date-Required|Submitter-Id"; +our $cvsweb_url = 'http://www.FreeBSD.org/cgi/cvsweb.cgi/'; +our $stylesheet = "$main::hsty_base/layout/css/query-pr.css"; -my $valid_category = '[a-z0-9][A-Za-z0-9-_]{1,25}'; -my $valid_pr = '\d{1,8}'; +our $iscgi = defined $ENV{'SCRIPT_NAME'}; -my $binary_filetypes = '(?:\.gz|\.bz2|\.zip|\.tar)$'; +# Keep this ahead of CGI -my %fmt; +if (!$iscgi && !exists $ENV{'REQUEST_METHOD'}) { + # Makes debugging easier + $ENV{'REQUEST_METHOD'} = 'GET'; +} -my $f = ""; -my $PR = -1; -my $getpatch = -1; -my $mimepatch = ""; -my $inpatch = 0; -my $patchendhint = 0; -my $category; -my @query; -my (%header, %sfields, %mfields); +# Stuff from cgi-style.pl -my $iscgi = defined $ENV{'SCRIPT_NAME'}; +$main::hsty_base ||= ''; +$main::t_style ||= ''; +$main::hsty_charset ||= ''; -my $fromwebform = 0; +$main::hsty_charset = 'utf-8'; -$ENV{'PATH'} = "/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin"; +$main::t_style = +qq{ + +}; -$ENV{'QUERY_STRING'} ||= ""; -$ENV{'SCRIPT_NAME'} ||= $0; +# Global CGI accessor -# Junk from cgi-style.pl -$main::hsty_base ||= ""; -$main::t_style ||= ""; +our $q = new CGI; -my $scriptname = htmlclean($ENV{'SCRIPT_NAME'}); -my $querystring = htmlclean($ENV{'QUERY_STRING'}); -# Do not change $self_url_base, unless you understand what it is for! -# In particular: it is used as a delimiter between comments in the -# Audit-Trail. -my $self_url_base = "http://www.FreeBSD.org/cgi/query-pr.cgi?pr="; -my $cvsweb_url = "http://www.FreeBSD.org/cgi/cvsweb.cgi/"; -my $stylesheet = "$main::hsty_base/layout/css/query-pr.css"; +#------------------------------------------------------------------------------ +# Environment vars +#------------------------------------------------------------------------------ +$ENV{'PATH'} = '/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin'; -#----------------------------------------------------------------------- -# Format strings -#----------------------------------------------------------------------- +$ENV{'SCRIPT_NAME'} ||= $0; -$fmt{'header_thead'} = < -EOF -$fmt{'header_tfoot'} = <
-EOF +#------------------------------------------------------------------------------ +# Begin Code +#------------------------------------------------------------------------------ -$fmt{'header_trow'} = <%%(1):%%(2) -EOF +main(); -$fmt{'sfields_thead'} = < -EOF -$fmt{'sfields_trow'} = <%%(1):%%(2) -EOF +#------------------------------------------------------------------------------ +# Main routine +#------------------------------------------------------------------------------ -$fmt{'sfields_tfoot'} = <
-EOF +sub main +{ + my ($PR, $category, $rawdata, $gnatspr); -$fmt{'mfields_header'} = <%%(1): -
-EOF -$fmt{'mfields_header'} =~ s/\n+$//; + binmode STDOUT, ':utf8'; -$fmt{'mfields_footer'} = < -EOF + if ($q->param('pr')) { + $PR = $q->param('pr'); + } elsif ($q->param('q')) { + $PR = $q->param('q'); + } elsif ($q->param('prp')) { + # Legacy param format + my $prp = $q->param('prp'); -$fmt{'patchblock_thead'} = < - - Download %%(2) - -
-EOF
-$fmt{'patchblock_thead'} =~ s/\n+$//;
+		if ($prp =~ /^(\d+)-(\d+)/) {
+			my $get = $2;
+			$PR = $1;
 
-$fmt{'patchblock_tfoot'} = <
-
-EOF -$fmt{'patchblock_tfoot'} =~ s/\n+$//; -$fmt{'patchblock_tfoot'} =~ s/^\n+//; + $q->param(-name => 'pr', -value => $PR); + $q->param(-name => 'getpatch', -value => $get); + } else { + ErrorExit(); + } + } else { + ErrorExit(EXIT_NOPRS); + } -$fmt{'auditblock_thead'} = < - %%(1) Changed -EOF + if ($PR =~ /^($valid_category)\/($valid_pr)$/) { + $category = $1; + $PR = $2; + } -$fmt{'auditblock_tfoot'} = < -
-EOF + length $PR > 0 + or ErrorExit(); -$fmt{'auditblock_trow'} = <%%(1):%%(2) -EOF + # category may be undef + $rawdata = DoQueryPR($PR, $category); -$fmt{'responseblock_thead'} = < - Reply via E-mail -EOF + # Dump the raw PR data if requested + if ($q->param('f') && $q->param('f') eq 'raw') { + print "Content-type: text/plain; charset=UTF-8\r\n\r\n"; + print $$rawdata; + Exit(); + } -$fmt{'responseblock_tfoot'} = <
-EOF + # Run PR text through the parser + $gnatspr = GnatsPR->new($rawdata); -$fmt{'responseblock_textfoot'} = < -EOF + # User is requesting a patch extraction? + if ($q->param('getpatch')) { + my ($patch, $patchnum); -$fmt{'responseblock_texthead'} = < -EOF + $patchnum = $q->param('getpatch'); + $patchnum =~ s/[^0-9]+//g; -$fmt{'responseblock_trow'} = <%%(1):%%(2) -EOF + $patch = $gnatspr->GetAttachment($patchnum); -$fmt{'unexpectedtext_thead'} = <isbinary ? 'application/octet-stream' : 'text/plain'); -$fmt{'unexpectedtext_tfoot'} = < -EOF + printf 'Content-Length: %s'."\r\n" + . 'Content-Disposition: inline; filename="%s"'."\r\n\r\n", + $patch->size, + $patch->filename; >>> TRUNCATED FOR MAIL (1000 lines) <<<