------------------------------------------------------------ revno: 13547 [merge] revision-id: squid3@treenet.co.nz-20140825112554-qtpd8q3ali2mot2w parent: squid3@treenet.co.nz-20140825045357-rrkypd1tbe917c3o parent: squid3@treenet.co.nz-20140825042247-kxeet7hesvoi4579 author: The Squid Software Foundation, Alex Rousskov , Amos Jeffries committer: Amos Jeffries branch nick: trunk timestamp: Mon 2014-08-25 04:25:54 -0700 message: Boilerplate copyright/license adjustment preparation Squid-3 is now being administered by the Squid Software Foundation, a non-profit organisation created for the purpose of providing governance and representation for the Squid Project and community of contributors. http://www.squid-cache.org/Foundation/ As such the Squid source code collection is being prefixed with a new copyright blurb: * Copyright (C) 1996-2014 The Squid Software Foundation and contributors * * Squid software is distributed under GPLv2+ license and includes * contributions from numerous individuals and organizations. * Please see the COPYING and CONTRIBUTORS files for details. Existing copyright claims on specific source code files are being preserved in-situ following this collection blurb. With some exceptions where existing copyright owners have explicitly given permission for their specific claim statements to be moved to the CONTRIBUTORS file and assist removal of the inconsistent and now often incorrect Harvest and Squid Project blurb(s). This patch publishes the script and boilerplate text used to perform this change of copyright marking for public review. Also, adds some administrative polishing in preparation for the blurb adjustments. This is a Squid Software Foundation project. ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140825112554-qtpd8q3ali2mot2w # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: c3314b52aff9837ad00382d4319c14107e5c6d97 # timestamp: 2014-08-25 11:54:02 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140825045357-\ # rrkypd1tbe917c3o # # Begin patch === modified file 'CONTRIBUTORS' --- CONTRIBUTORS 2014-05-02 10:29:08 +0000 +++ CONTRIBUTORS 2014-08-23 10:39:15 +0000 @@ -1,5 +1,6 @@ -Special thanks go to people who have volunteered their time, effort, -and ideas to make this software available. +This file contains a list of Squid contributors: people and organizations that +have volunteered their time, effort, code, and ideas to make Squid software. +Thank you! 'noloader' Adam Ciarcinski @@ -200,6 +201,7 @@ Ralf Wildenhues Ralph Loader Regardt van de Vyver + Regents of the University of California (UCSD) Reinhard Sojka Rene Geile Reuben Farrelly @@ -231,6 +233,7 @@ Svenx Taavi Talvik Taketo Kabe + The Measurement Factory Thomas De Schampheleire Thomas Hozza Thomas Ristic === removed file 'COPYRIGHT' --- COPYRIGHT 2007-12-14 04:53:23 +0000 +++ COPYRIGHT 1970-01-01 00:00:00 +0000 @@ -1,25 +0,0 @@ -By accepting this notice, you agree to be bound by the following -agreements: - -This software product, SQUID, is developed by a team of individuals, -and copyrighted (C) 2001 by the Regents of the University of -California, with all rights reserved. UCSD administered the NLANR -Cache grants, NCR 9616602 and NCR 9521745 under which most of this -code was developed. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License (version 2) as -published by the Free Software Foundation. It is distributed in the -hope that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to: - - The Free Software Foundation - 59 Temple Place - Suite 330 - Boston, MA 02111, USA - -Or contact info@squid-cache.org === modified file 'CREDITS' --- CREDITS 2014-03-06 05:41:17 +0000 +++ CREDITS 2014-08-23 10:39:15 +0000 @@ -1,35 +1,11 @@ +This file contains copyright and licensing information for 3rd party software +imported into Squid. Squid software itself is copyrighted by The Squid +Software Foundation and contributors. Please see the COPYING and CONTRIBUTORS +files for details. + ============================================================================== - -SQUID Internet Object Cache http://www.squid-cache.org --------------------------------------------------------- - - Squid is the result of efforts by numerous individuals from the - Internet community. Development is led by Duane Wessels of the - National Laboratory for Applied Network Research and funded by - the National Science Foundation. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301, USA. - -Squid is derived from the ``cached'' software from the ARPA-funded -Harvest research project. The Harvest home page is -http://harvest.cs.colorado.edu/. - -Squid is originally derived from the Harvest Information Discovery and -Access System. The Harvest copyright text follows to acknowledge the origin: - +Squid is derived from the ``cached'' software developed by the ARPA-funded +research project called The Harvest Information Discovery and Access System: /* * Copyright (c) 1994, 1995. All rights reserved. === modified file 'Makefile.am' --- Makefile.am 2014-03-31 04:46:50 +0000 +++ Makefile.am 2014-08-23 10:39:15 +0000 @@ -38,7 +38,6 @@ ChangeLog \ CONTRIBUTORS \ COPYING \ - COPYRIGHT \ CREDITS \ INSTALL \ QUICKSTART \ === modified file 'README' --- README 2007-12-14 04:56:10 +0000 +++ README 2014-08-23 10:39:15 +0000 @@ -1,6 +1,12 @@ -SQUID Web Proxy Cache http://www.squid-cache.org/ --------------------------------------------------------- +SQUID Web Proxy Cache http://www.squid-cache.org/ +------------------------------------------------------------------------- + +Copyright (C) 1996-2013 The Squid Software Foundation and contributors + +Squid software is distributed under GPLv2+ license and includes +contributions from numerous individuals and organizations. +Please see the COPYING and CONTRIBUTORS files for details. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,12 +19,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - -Squid is derived from the ``cached'' software from the ARPA-funded -Harvest research project. Squid includes software copyrighted -by others. See the COPYRIGHT file for details. + along with this program. If not, see http://www.gnu.org/licenses/. Please use our mailing lists for questions, feedback and bug fixes: === modified file 'SPONSORS.list' --- SPONSORS.list 2013-10-26 02:28:12 +0000 +++ SPONSORS.list 2014-08-23 10:39:15 +0000 @@ -1,6 +1,5 @@ -In addition to the numerous volunteer developers (see CONTRIBUTORS), -the following organizations have provided non-financial support for -the Squid Project: +The following organizations have supported the Squid Project by providing +their resources or funding various Squid development activities: @Squid-3.4: LaunchPad - http://launchpad.net/ === added file 'scripts/boiler-mgr.pl' --- scripts/boiler-mgr.pl 1970-01-01 00:00:00 +0000 +++ scripts/boiler-mgr.pl 2014-08-25 04:22:47 +0000 @@ -0,0 +1,332 @@ +#!/usr/bin/perl -w + +# Adds or adjusts the source file boilerplate, such as a Copyright statement. +# The boilerplate is meant to remain constant from one source file to another. +# +# The old boilerplate is assumed to be the first /* comment */ in a source +# file, before the first #include statement other than #include "squid.h". +# Common old boilerplates are removed, with copyright-related claims contained +# in them logged on stdout for recording in CONTRIBUTORS or some such. +# Copyright and (C) (but not AUTHOR-like) lines are left in sources except +# when we have a permission to move them to CONTRIBUTORS. +# +# The new boilerplate comment is placed at the very beginning of the file, +# followed by old copyright lines, "inspired by" lines, and DEBUG section +# comments (if any were found in the old boilerplate). +# +# The script tries hard to detect files with unusual old boilerplates. When +# detected, the script warns about the problem and leaves the file "as is". + +use strict; +use warnings; + +die("usage: $0 ...\n") unless @ARGV >= 2; +my ($BoilerName, @FileNames) = @ARGV; + +my $CorrectBoiler = `cat $BoilerName` or + die("cannot load boilerplate from $BoilerName: $!, stopped"); +$CorrectBoiler = &trimL(&trimR($CorrectBoiler)) . "\n\n"; + +# the first /* comment */ +my $reComment = qr{ + /\*.*?\*/ +}xs; + +# Debugging section inside a boilerplate comment. +my $reDebug = qr{ + ^[\s*]*(DEBUG:.*?)$ +}mx; + +# Same as $reDebug, but does not match empty DEBUG: statements. +my $reDebugFull = qr{ + ^[\s*]*(DEBUG:[^\S\n]*\S.*?)\s*$ +}mx; + +# Copyright-related claims inside a boilerplate comment +my $reClaims = qr{ + ( + (?: + AUTHOR\b(?:.|\n)*?\*[/\s]*$| # all authors until an "empty" line + ORIGINAL\s+AUTHOR\b| # or not the latest author + COPYRIGHT\b(?!\sfile)| # or copyright (except "COPYRIGHT file") + Portions\scopyright| # or partial copyright + (?| + + Amos.Jeffries||| + Treehouse.Networks.Ltd.| + GPL.version.2,..C.2007-2013| + + Henrik.Nordstrom|| + MARA.Systems.AB| +}xi; +# XXX: We have not gotten permission for some of the entries yet: +# +# Robert.Collins|| +# +# the.Regents.of.the.University.of + + +# inspirations are not copyright claims but should be preserved +my $reInspiration = qr/^[\s*]*(inspired by previous work.*?)$/mi; + +# The most common GPL text, with some address variations. +my $strGpl = + "This program is free software; you can redistribute it and/or modify". + "([^*]|[*][^/])+". # not a /* comment */ closure + "Foundation, Inc., [^\\n]+MA\\s+[-\\d]+, USA\\."; +my $reGpl = qr{$strGpl}s; + +# Two most common Squid (C) statements. +my $strSqCopyStart1 = + "SQUID Web Proxy Cache\\s+http://www.squid-cache.org/"; +my $strSqCopyStart2 = + "SQUID Internet Object Cache\\s+http://squid.nlanr.net/Squid/"; +my $strSqCopyEnd = + "([^*]|[*][^/])+". + "numerous individuals". + "([^*]|[*][^/])+". + "file for full details."; +my $reSquidCopy = qr{($strSqCopyStart1|$strSqCopyStart2)$strSqCopyEnd}s; + + +my $FileName; # for Warn()ings +my %ReportedClaims; # to minimize noise in claims reporting +$| = 1; # report claims ASAP (but on STDOUT) + +# process each file in-place; do not touch files on known failures +foreach my $fname (@FileNames) { + + $FileName = $fname; + my $code = &readFile($fname) or next; + my $virginCode = $code; + + &Warn("Correct boilerplate already present, skipping:", $code), next if + $code =~ /\Q$CorrectBoiler\E/s; + + my $boiler; + + if ($code =~ m/$reComment/) { + my $beforeComment = $`; + my $comment = $&; + + # Is the matched comment a boilerplate? + if ($comment !~ m/\n/) { + # A single line comment is not a boilerplate. + } elsif ($beforeComment =~ m/^\s*\#\s*include\s+(?!"squid.h")/m) { + # A comment after include is not a boilerplate, + # but we make an exception for #include "squid.h" common in lib/ + } elsif ($comment =~ m@^/\*\*\s@){ + # A Doxygen comment is not a boilerplate. + } elsif ($comment =~ m/internal declarations|stub file|unit test/i) { + # These relatively common comments are not boilerplates. + } elsif (&digestable($comment)) { + # Something we can safely replace. + $boiler = $comment; + } else { + &Warn("Unrecognized boilerplate, skipping:", $comment); + next; + } + } + + my $extras = ''; # DEBUG section, inspired by ..., etc. + + if (defined $boiler) { + my $copyClaims = ''; # formatted Copyright claims extraced from sources + my $preserveClaims = 0; # whether to preserve them or not + + if (my @rawClaims = ($boiler =~ m/$reClaims/g)) { + my @claims = map { &claimList($_) } @rawClaims; + my $count = 0; + foreach my $claim (@claims) { + $claim =~ s/\n+/ /gs; # streamline multiline claims + $claim =~ s@\*/?@ @g; # clean comment leftovers + $claim =~ s/$reClaimPrefix/ /g; # remove common prefixes + # this one is sucked in from the old standard boilerplate + $claim =~ s/by the Regents of the University of//; + $claim =~ s/\s\s+/ /gs; # clean excessive whitespace + $claim =~ s/^\s+|\s+$//gs; # remove excessive whitespace + next unless length $claim; + + # preserve Copyright claims + if ($claim =~ m/Copyright|\(c\)/i) { + $copyClaims .= sprintf(" * %s\n", $claim); + + # Ignore certain claims, assuming we have their permission. + my $c = $claim; + $c =~ s/^\s*(Copyright)?[:\s]*([(c)]+)?\s*([0-9,-]+)?\s*(by)?\s*//i; # prefix + $c =~ s/$reClaimsOkToMove/ /g; + $c =~ s/[,]//g; # markup leftovers + + # But if one claim is preserved, all must be preserved. + $preserveClaims = 1 if $c =~ /\S/; +warn($c) if $c =~ /\S/; + } + + next if exists $ReportedClaims{$claim}; + print("$fname: INFO: Found new claim(s):\n") unless $count++; + print("Claim: $claim\n"); + $ReportedClaims{$claim} = $fname; + } + } + + if ($preserveClaims) { + die("Internal error: $copyClaims") unless length($copyClaims); + my $prefix = " * Portions of this code are copyrighted and released under GPLv2+ by:"; + my $suffix = " * Please add new claims to the CONTRIBUTORS file instead."; + $extras .= sprintf("/*\n%s\n%s%s\n */\n\n", + $prefix, $copyClaims, $suffix); + } + + if ($boiler =~ m/$reInspiration/) { + $extras .= sprintf("/* %s */\n\n", ucfirst($1)); + } + + if ($boiler =~ m/$reDebugFull/) { + $extras .= "/* $1 */\n\n"; + } + + $code =~ s/\s*$reComment\s*/\n\n/ or + die("internal error: failed to remove expected comment, stopped"); + &digestable($&) or + die("internal error: unsafe comment removal, stopped"); + + } else { # no boilerplate found + #&Warn("Cannot find old boilerplate, adding new boilerplate.", $code); + } + + # Some files have license declarations way down in the code so we may not + # find a boilerplate at all or find an "empty" boilerplate preceeding them. + my $license = + "Copyright|". + "This program is free software|". + "Permission to use|". + "Redistribution and use"; + if ($code =~ m@/\*.*?($license).*?\*/@is) { + # If we replaced what we thought is an old boiler, do not use $` for + # context because it is based on modified $code and will often mislead. + my $context = defined $boiler ? $& : ($` . $&); + &Warn("Suspected boilerplate in an unusual location, skipping:", + $context); + next; + } + + $code = $CorrectBoiler . $extras . &trimL($code); + &writeFile($fname, $code) unless $code eq $virginCode; + undef $FileName; +} + +exit(0); + +sub readFile() { + my ($fname) = @_; + + if (!-f $fname) { + &Warn("Skipping directory or a special file."); + return undef(); + } + + my $code = ''; + open(IF, "<$fname") or die("cannot open $fname: $!, stopped"); + while () { + $code .= $_; + } + close(IF); + + &Warn("empty file") unless length $code; + return $code; +} + +sub writeFile() { + my ($fname, $code) = @_; + open(OF, ">$fname") or die("cannot open $fname for writing: $!, stopped"); + + print(OF $code) or die("cannot write to $fname: $!, stopped"); + + close(OF) or die("cannot finish updating $fname: $!, stopped"); +} + +# split multiclaim claims into an array of single claims +sub claimList() { + my $multiClaim = shift; + + $multiClaim =~ s/$reDebug//g; # may pretend to continue AUTHORs list + $multiClaim =~ s/$reInspiration//g; # does not affect (C) claims + + # remove \n that is not used to separate two claims + $multiClaim =~ s/(Based.upon.original.+code.by\s*)\n/$1 /g; + + return split(/\n/, $multiClaim); + # return grep { /\S/ } split($reClaimSplitter, $multiClaim); +} + +# checks whether a comment contains nothing but the stuff we can either +# safely remove, replace, or move (e.g., DEBUG sections and copyright claims) +sub digestable() { + my $comment = shift; + + # Remove common text to detect an otherwise empty boilerplate. + $comment =~ s/$reDebug//; + $comment =~ s/$reClaims//g; + $comment =~ s/^[\s*]*(Created on.*?)$//mig; + $comment =~ s/^[\s*]*(Windows support\s*)$//mig; + $comment =~ s/^[\s*]*(History added by .*)$//mig; + $comment =~ s/$reGpl//; + $comment =~ s/$reSquidCopy//; + $comment =~ s/$reInspiration//g; + $comment =~ s/\* Stubs for.*?$//m; # e.g., Stubs for calls to stuff defined in... + $comment =~ s/\$Id(:.*)?\$//g; # CVS tags + $comment =~ s/-{60,}//g; # decorations such as -----------...--------- + $comment =~ s/\b\w+\.(h|c|cc|cci)\b//; # Next to last step: a file name. + $comment =~ s@[\s*/]@@sg; # Last step: whitespace and comment characters. + return !length($comment); +} + +# removes all opening whitespace +sub trimL() { + my ($code) = @_; + $code =~ s/^\n[\n\s]*//s; + return $code; +} + +# removes all trailing whitespace +sub trimR() { + my ($code) = @_; + $code =~ s/\n[\n\s]*$//s; + return $code; +} + +sub Warn() { + my ($msg, $context) = @_; + + if (defined $context) { + my $MaxLen = 1000; + $context =~ s/$reGpl/... [GPL] .../; + $context =~ s/$reSquidCopy/... [Standard Squid "numerous individuals" text] .../; + $context = substr($context, 0, $MaxLen); + $context = &trimR($context); + $context .= "\n\n"; + } else { + $context = ''; + } + $msg = sprintf("%s: WARNING: %s\n%s", $FileName, $msg, $context) if defined $FileName; + warn($msg); +} === added file 'scripts/boilerplate.h' --- scripts/boilerplate.h 1970-01-01 00:00:00 +0000 +++ scripts/boilerplate.h 2014-08-25 04:20:56 +0000 @@ -0,0 +1,7 @@ +/* + * Copyright (C) 1996-2014 The Squid Software Foundation and contributors + * + * Squid software is distributed under GPLv2+ license and includes + * contributions from numerous individuals and organizations. + * Please see the COPYING and CONTRIBUTORS files for details. + */ === modified file 'scripts/formater.pl' --- scripts/formater.pl 2012-08-28 12:45:52 +0000 +++ scripts/formater.pl 2014-08-23 10:39:15 +0000 @@ -7,7 +7,7 @@ # by the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # -# The ldap_manager library is distributed in the hope that it will be useful, +# Distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See LICENSE or http://www.gnu.org/licenses/gpl.html for details . +# See COPYING or http://www.gnu.org/licenses/gpl.html for details. # === modified file 'src/HttpHeaderStat.h' --- src/HttpHeaderStat.h 2012-08-28 13:00:30 +0000 +++ src/HttpHeaderStat.h 2014-08-25 11:25:54 +0000 @@ -1,16 +1,9 @@ -/* - * HttpHeaderStat.h - * - * Created on: Dec 9, 2011 - * Author: kinkie - */ - #ifndef HTTPHEADERSTAT_H_ #define HTTPHEADERSTAT_H_ -/* per header statistics */ - #include "StatHist.h" + +/// per header statistics class HttpHeaderStat { public: === modified file 'src/acl/AclAddress.h' --- src/acl/AclAddress.h 2013-10-25 00:13:46 +0000 +++ src/acl/AclAddress.h 2014-08-23 10:39:15 +0000 @@ -1,6 +1,3 @@ -#ifndef ACLADDRESS_H_ -#define ACLADDRESS_H_ -#include "Acl.h" /* * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -29,6 +26,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ +#ifndef ACLADDRESS_H_ +#define ACLADDRESS_H_ + #include "acl/Acl.h" #include "ip/Address.h" === modified file 'src/ssl/gadgets.h' --- src/ssl/gadgets.h 2014-02-21 10:46:19 +0000 +++ src/ssl/gadgets.h 2014-08-23 10:39:15 +0000 @@ -1,7 +1,3 @@ -/* - * 2009/01/17 - */ - #ifndef SQUID_SSL_GADGETS_H #define SQUID_SSL_GADGETS_H