Skip to content

Commit

Permalink
[Courgette] Fix BSDiff License Headers; Remove Entries in checklicens…
Browse files Browse the repository at this point in the history
…e.py

Previously bsdiff_create.cc and qsufsort.h do not start with proper
copyright notices, and were added as exceptions in checklicense.py. This
CL cleans up license headers for BSDiff-related files, which allows the
exceptions to be removed.

BUG=98095

Review-Url: https://codereview.chromium.org/2046633003
Cr-Commit-Position: refs/heads/master@{#399908}
  • Loading branch information
samuelhuang authored and Commit bot committed Jun 15, 2016
1 parent a924814 commit d02d305
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 133 deletions.
20 changes: 10 additions & 10 deletions courgette/third_party/bsdiff/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ incompatible with the original and it cannot be compiled outside the Chromium
source tree or the Courgette project.

List of changes made to original code:
- wrapped functions in 'courgette' namespace
- renamed .c files to .cc
- added bsdiff.h header file
- changed the code to use streams.h from courgette
- changed the encoding of numbers to use the 'varint' encoding
- reformatted code to be closer to Google coding standards
- renamed variables
- added comments
- extracted qsufsort into qsufsort.h in 'courgette::qsuf' namespace
- added unit tests for qsufsort
- Wrapped functions in 'courgette' namespace.
- Renamed .c files to .cc files.
- Added bsdiff.h header file.
- Changed the code to use streams.h from courgette.
- Changed the encoding of numbers to use the 'varint' encoding.
- Reformatted code to be closer to Google coding standards.
- Renamed variables.
- Added comments.
- Extracted qsufsort into qsufsort.h in 'courgette::qsuf' namespace.
- Added unit tests for qsufsort.
75 changes: 40 additions & 35 deletions courgette/third_party/bsdiff/bsdiff.h
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
/*-
* Copyright 2003,2004 Colin Percival
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted providing 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 ``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 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.
*
* Changelog:
* 2005-04-26 - Define the header as a C structure, add a CRC32 checksum to
* the header, and make all the types 32-bit.
* --Benjamin Smedberg <[email protected]>
* 2009-03-31 - Change to use Streams. Move CRC code to crc.{h,cc}
* Changed status to an enum, removed unused status codes.
* --Stephen Adams <[email protected]>
* 2013-04-10 - Added wrapper to apply a patch directly to files.
* --Joshua Pawlicki <[email protected]>
*/
// Copyright 2003, 2004 Colin Percival
// All rights reserved
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted providing 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 ``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 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.
//
// For the terms under which this work may be distributed, please see
// the adjoining file "LICENSE".
//
// Changelog:
// 2005-04-26 - Define the header as a C structure, add a CRC32 checksum to
// the header, and make all the types 32-bit.
// --Benjamin Smedberg <[email protected]>
// 2009-03-31 - Change to use Streams. Move CRC code to crc.{h,cc}
// Changed status to an enum, removed unused status codes.
// --Stephen Adams <[email protected]>
// 2013-04-10 - Added wrapper to apply a patch directly to files.
// --Joshua Pawlicki <[email protected]>

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COURGETTE_THIRD_PARTY_BSDIFF_BSDIFF_H_
#define COURGETTE_THIRD_PARTY_BSDIFF_BSDIFF_H_
Expand Down
63 changes: 32 additions & 31 deletions courgette/third_party/bsdiff/bsdiff_apply.cc
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
/*-
* Copyright 2003,2004 Colin Percival
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted providing 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 ``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 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.
*
* Changelog:
* 2009-03-31 - Change to use Streams. Move CRC code to crc.{h,cc}
* --Stephen Adams <[email protected]>
* 2013-04-10 - Add wrapper method to apply a patch to files directly.
* --Joshua Pawlicki <[email protected]>
*/
// Copyright 2003, 2004 Colin Percival
// All rights reserved
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted providing 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 ``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 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.
//
// For the terms under which this work may be distributed, please see
// the adjoining file "LICENSE".
//
// Changelog:
// 2009-03-31 - Change to use Streams. Move CRC code to crc.{h,cc}
// --Stephen Adams <[email protected]>
// 2013-04-10 - Add wrapper method to apply a patch to files directly.
// --Joshua Pawlicki <[email protected]>

// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
Expand Down
77 changes: 50 additions & 27 deletions courgette/third_party/bsdiff/bsdiff_create.cc
Original file line number Diff line number Diff line change
@@ -1,30 +1,53 @@
/*
bsdiff.c -- Binary patch generator.
Copyright 2003 Colin Percival
For the terms under which this work may be distributed, please see
the adjoining file "LICENSE".
ChangeLog:
2005-05-05 - Use the modified header struct from bspatch.h; use 32-bit
values throughout.
--Benjamin Smedberg <[email protected]>
2005-05-18 - Use the same CRC algorithm as bzip2, and leverage the CRC table
provided by libbz2.
--Darin Fisher <[email protected]>
2007-11-14 - Changed to use Crc from Lzma library instead of Bzip library
--Rahul Kuchhal
2009-03-31 - Change to use Streams. Added lots of comments.
--Stephen Adams <[email protected]>
2010-05-26 - Use a paged array for V and I. The address space may be too
fragmented for these big arrays to be contiguous.
--Stephen Adams <[email protected]>
2015-08-03 - Extract qsufsort portion to a separate file.
--Samuel Huang <[email protected]>
2015-08-12 - Interface change to qsufsort search().
--Samuel Huang <[email protected]>
*/
// Copyright 2003, 2004 Colin Percival
// All rights reserved
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted providing 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 ``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 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.
//
// For the terms under which this work may be distributed, please see
// the adjoining file "LICENSE".
//
// ChangeLog:
// 2005-05-05 - Use the modified header struct from bspatch.h; use 32-bit
// values throughout.
// --Benjamin Smedberg <[email protected]>
// 2005-05-18 - Use the same CRC algorithm as bzip2, and leverage the CRC table
// provided by libbz2.
// --Darin Fisher <[email protected]>
// 2007-11-14 - Changed to use Crc from Lzma library instead of Bzip library
// --Rahul Kuchhal
// 2009-03-31 - Change to use Streams. Added lots of comments.
// --Stephen Adams <[email protected]>
// 2010-05-26 - Use a paged array for V and I. The address space may be too
// fragmented for these big arrays to be contiguous.
// --Stephen Adams <[email protected]>
// 2015-08-03 - Extract qsufsort portion to a separate file.
// --Samuel Huang <[email protected]>
// 2015-08-12 - Interface change to search().
// --Samuel Huang <[email protected]>

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.


#include "courgette/third_party/bsdiff/bsdiff.h"

Expand Down
70 changes: 46 additions & 24 deletions courgette/third_party/bsdiff/qsufsort.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,49 @@
/*
qsufsort.h -- Suffix array generation.
Copyright 2003 Colin Percival
For the terms under which this work may be distributed, please see
the adjoining file "LICENSE".
ChangeLog:
2005-05-05 - Use the modified header struct from bspatch.h; use 32-bit
values throughout.
--Benjamin Smedberg <[email protected]>
2010-05-26 - Use a paged array for V and I. The address space may be too
fragmented for these big arrays to be contiguous.
--Stephen Adams <[email protected]>
2015-08-03 - Extract QSufSort to a separate file as template.
--Samuel Huang <[email protected]>
2015-08-19 - Optimize split() and search(), add comments.
--Samuel Huang <[email protected]>
2016-04-27 - Change split() to use Bentley & McIlroy's pivot selection
algorithm, which QSufSort originally used. Reference:
http://www.larsson.dogma.net/qsufsort.c
--Samuel Huang <[email protected]>
*/
// Copyright 2003, 2004 Colin Percival
// All rights reserved
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted providing 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 ``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 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.
//
// For the terms under which this work may be distributed, please see
// the adjoining file "LICENSE".
//
// ChangeLog:
// 2005-05-05 - Use the modified header struct from bspatch.h; use 32-bit
// values throughout.
// --Benjamin Smedberg <[email protected]>
// 2010-05-26 - Use a paged array for V and I. The address space may be too
// fragmented for these big arrays to be contiguous.
// --Stephen Adams <[email protected]>
// 2015-08-03 - Extract QSufSort to a separate file as template.
// --Samuel Huang <[email protected]>
// 2015-08-19 - Optimize split(), add comments.
// --Samuel Huang <[email protected]>
// 2016-04-27 - Change split() to use Bentley & McIlroy's pivot selection
// algorithm, which QSufSort originally used. Reference:
// http://www.larsson.dogma.net/qsufsort.c
// --Samuel Huang <[email protected]>

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COURGETTE_THIRD_PARTY_BSDIFF_QSUFSORT_H_
#define COURGETTE_THIRD_PARTY_BSDIFF_QSUFSORT_H_
Expand Down
6 changes: 0 additions & 6 deletions tools/checklicenses/checklicenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,6 @@ def PrintUsage():
'chrome/common/extensions/docs/server2/third_party': [
'UNKNOWN',
],
'courgette/third_party/bsdiff/bsdiff_create.cc': [ # http://crbug.com/98095
'UNKNOWN',
],
'courgette/third_party/bsdiff/qsufsort.h': [ # http://crbug.com/98095
'UNKNOWN',
],
'native_client': [ # http://crbug.com/98099
'UNKNOWN',
],
Expand Down

0 comments on commit d02d305

Please sign in to comment.