From e685de8b5f8417e6795fdc9ff60da1f2bbca7634 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 6 Jun 2016 18:19:29 +0200 Subject: [PATCH 1/8] no more CLA and switch to AGPLv3 or later --- build/license.php | 66 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 9 deletions(-) diff --git a/build/license.php b/build/license.php index 493c7dafd9858..bed3854925ff2 100644 --- a/build/license.php +++ b/build/license.php @@ -27,6 +27,27 @@ class Licenses public function __construct() { $this->licenseText = <<. + * + */ +EOD; + $this->licenseTextLegacy = <<licenseText = str_replace('@YEAR@', date("Y"), $this->licenseText); + $this->licenseTextLegacy = str_replace('@YEAR@', date("Y"), $this->licenseTextLegacy); } /** @@ -118,10 +139,15 @@ function handleFile($path, $gitRoot) { echo "MIT licensed file: $path" . PHP_EOL; return; } - $source = $this->eatOldLicense($source); - $authors = $this->getAuthors($path, $gitRoot); - $license = str_replace('@AUTHORS@', $authors, $this->licenseText); + if ($this->isOwnCloudLicensed($source)) { + $authors = $this->getAuthors($path, $gitRoot, true); + $license = str_replace('@AUTHORS@', $authors, $this->licenseTextLegacy); + } else { + $authors = $this->getAuthors($path, $gitRoot); + $license = str_replace('@AUTHORS@', $authors, $this->licenseText); + } + $source = $this->eatOldLicense($source); $source = "authors[$author] = $author; - return " * @author $author"; - }, $authors); + if ($legacyFiles) { + $authors = array_map(function($author){ + $this->authors[$author] = $author; + return " * @author $author"; + }, $authors); + } else { + $authors = array_map(function($author){ + $this->authors[$author] = $author; + return " * @copyright Copyright (c) " . date("Y") . ", $author"; + }, $authors); + } + + return implode(PHP_EOL, $authors); } From 4e52b845ea4c99e6abca1747b2793856202a8551 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 13 Jul 2016 17:45:21 +0200 Subject: [PATCH 2/8] - keep copyright notice and only update the authors list - check if all changes to a file happened after the fork, this allows the authors to check if the file can be relicensed to AGPLv3 or later --- build/license.php | 99 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 81 insertions(+), 18 deletions(-) diff --git a/build/license.php b/build/license.php index bed3854925ff2..1712899d6866b 100644 --- a/build/license.php +++ b/build/license.php @@ -22,11 +22,14 @@ class Licenses { protected $paths = []; protected $mailMap = []; + protected $checkFiles = []; public $authors = []; public function __construct() { $this->licenseText = <<licenseTextLegacy = <<handleFile($folder, $gitRoot); + $this->printFilesToCheck(); return; } @@ -113,6 +118,8 @@ function exec($folder, $gitRoot = false) { /** @var SplFileInfo $file */ $this->handleFile($file, $gitRoot); } + + $this->printFilesToCheck(); } function writeAuthorsFile() { @@ -139,13 +146,15 @@ function handleFile($path, $gitRoot) { echo "MIT licensed file: $path" . PHP_EOL; return; } + $copyrightNotices = $this->getCopyrightNotices($path, $source); + $authors = $this->getAuthors($path, $gitRoot); if ($this->isOwnCloudLicensed($source)) { - $authors = $this->getAuthors($path, $gitRoot, true); $license = str_replace('@AUTHORS@', $authors, $this->licenseTextLegacy); + $this->checkCopyrightState($path, $gitRoot); } else { - $authors = $this->getAuthors($path, $gitRoot); $license = str_replace('@AUTHORS@', $authors, $this->licenseText); } + $license = str_replace('@COPYRIGHT@', $copyrightNotices, $license); $source = $this->eatOldLicense($source); $source = "getTimestamp(); + + $buildDir = getcwd(); + if ($gitRoot) { + chdir($gitRoot); + $path = substr($path, strlen($gitRoot)); + } + $out = shell_exec("git --no-pager blame --line-porcelain $path | sed -n 's/^author-time //p'"); + if ($gitRoot) { + chdir($buildDir); + } + $timestampChanges = explode(PHP_EOL, $out); + $timestampChanges = array_slice($timestampChanges, 0, count($timestampChanges)-1); + foreach ($timestampChanges as $timestamp) { + if ((int)$timestamp < $deadlineTimestamp) { + return; + } + } + + //all changes after the deadline + $this->checkFiles[] = $path; + + } + + private function printFilesToCheck() { + if (!empty($this->checkFiles)) { + print "\n"; + print "For following files all lines changes since the Nextcloud fork." . PHP_EOL; + print "Please check if these files can be moved over to AGPLv3 or later" . PHP_EOL; + print "\n"; + foreach ($this->checkFiles as $file) { + print $file . PHP_EOL; + } + print "\n"; + } + } + + private function getAuthors($file, $gitRoot) { // only add authors that changed code and not the license header $licenseHeaderEndsAtLine = trim(shell_exec("grep -n '*/' $file | head -n 1 | cut -d ':' -f 1")); $buildDir = getcwd(); @@ -244,19 +315,11 @@ private function getAuthors($file, $gitRoot, $legacyFiles = false) { $authors = array_unique($authors); } - if ($legacyFiles) { - $authors = array_map(function($author){ - $this->authors[$author] = $author; - return " * @author $author"; - }, $authors); - } else { - $authors = array_map(function($author){ - $this->authors[$author] = $author; - return " * @copyright Copyright (c) " . date("Y") . ", $author"; - }, $authors); - } - - + $authors = array_map(function($author){ + $this->authors[$author] = $author; + return " * @author $author"; + }, $authors); + return implode(PHP_EOL, $authors); } From 5419b74ef0769bcfd080c44b8b25414a8e153bd2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 21 Jul 2016 17:08:43 +0200 Subject: [PATCH 3/8] Fix the license script --- build/license.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/license.php b/build/license.php index 1712899d6866b..4091afe2fb59e 100644 --- a/build/license.php +++ b/build/license.php @@ -124,7 +124,7 @@ function exec($folder, $gitRoot = false) { function writeAuthorsFile() { ksort($this->authors); - $template = "ownCloud is written by: + $template = "Nextcloud is written by: @AUTHORS@ With help from many libraries and frameworks including: @@ -277,7 +277,7 @@ private function checkCopyrightState($path, $gitRoot) { private function printFilesToCheck() { if (!empty($this->checkFiles)) { print "\n"; - print "For following files all lines changes since the Nextcloud fork." . PHP_EOL; + print "For following files all lines changed since the Nextcloud fork." . PHP_EOL; print "Please check if these files can be moved over to AGPLv3 or later" . PHP_EOL; print "\n"; foreach ($this->checkFiles as $file) { @@ -349,6 +349,7 @@ private function checkCoreMailMap($author) { $licenses->exec($argv[1], isset($argv[2]) ? $argv[1] : false); } else { $licenses->exec([ + '../apps/admin_audit', '../apps/comments', '../apps/dav', '../apps/encryption', @@ -362,8 +363,10 @@ private function checkCoreMailMap($author) { '../apps/provisioning_api', '../apps/systemtags', '../apps/testing', + '../apps/theming', '../apps/updatenotification', '../apps/user_ldap', + '../build/integration/features/bootstrap', '../core', '../lib', '../ocs', From 70a1d5bc26d116b10d32d21cbd52a610156ca768 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 21 Jul 2016 18:01:31 +0200 Subject: [PATCH 4/8] only search the license header for @copyright statements --- build/license.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/license.php b/build/license.php index 4091afe2fb59e..11675f21a0722 100644 --- a/build/license.php +++ b/build/license.php @@ -228,9 +228,10 @@ private function eatOldLicense($source) { private function getCopyrightNotices($path, $file) { $licenseHeaderEndsAtLine = (int)trim(shell_exec("grep -n '*/' $path | head -n 1 | cut -d ':' -f 1")); - $lineByLine = explode(PHP_EOL, $file, $licenseHeaderEndsAtLine); + $lineByLine = explode(PHP_EOL, $file, $licenseHeaderEndsAtLine + 1); $copyrightNotice = []; - foreach ($lineByLine as $line) { + $licensePart = array_slice($lineByLine, 0, $licenseHeaderEndsAtLine); + foreach ($licensePart as $line) { if (strpos($line, '@copyright') !== false) { $copyrightNotice[] = $line; } From 34a24d813d7803b81bb478ac1b5255362814632b Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Thu, 26 May 2016 19:52:00 +0200 Subject: [PATCH 5/8] Add new mailmap file --- .mailmap | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.mailmap b/.mailmap index 3fdaa301b1637..b96269235cf4f 100644 --- a/.mailmap +++ b/.mailmap @@ -16,8 +16,8 @@ Andreas Schönebeck Andreas Ergenzinger AndreasErgenzinger Andrew Brown André Gaul -Arthur Schiwon Arthur Schiwon -Arthur Schiwon blizzz +Arthur Schiwon Arthur Schiwon +Arthur Schiwon blizzz Artur Duque de Souza Axel Roenn Bagera @@ -30,14 +30,15 @@ Benjamin Diele Benjamin Liles Bernhard Posselt Bernhard Posselt Bernhard Posselt Bernhard Posselt +Bernhard Posselt Bernhard Posselt Bernhard Reiter Birk Borkason -Björn Schießle Bjoern Schiessle -Björn Schießle Björn Schießle -Björn Schießle Björn Schießle -Björn Schießle Björn Schiessle -Björn Schießle Bjoern Schießle -Björn Schießle Bjoern Schiessle +Björn Schießle Bjoern Schiessle +Björn Schießle Björn Schießle +Björn Schießle Björn Schießle +Björn Schießle Björn Schiessle +Björn Schießle Bjoern Schießle +Björn Schießle Bjoern Schiessle BlackEagle Boris Rybalkin Borjan Tchakaloff @@ -61,6 +62,8 @@ Christian Berendt Christian Kampka Christian Koch Christian Reiner Christian Reiner +Christoph Wurst Christoph Wurst +Christoph Wurst Christoph Wurst Christopher Bunn Christopher Schäpers Christopher Christopher Schäpers kondou @@ -123,11 +126,11 @@ Florian Vichot Florin Peter Florin Peter Florin Peter FlorinPeter Francesco Piraneo G. -Frank Karlitschek Frank Karlitschek -Frank Karlitschek Frank Karlitschek -Frank Karlitschek Frank Karlitschek -Frank Karlitschek Frank Karlitschek -Frank Karlitschek Frank Karlitschek +Frank Karlitschek Frank Karlitschek +Frank Karlitschek Frank Karlitschek +Frank Karlitschek Frank Karlitschek +Frank Karlitschek Frank Karlitschek +Frank Karlitschek Frank Karlitschek François Kubler Frédéric Fortier Frédéric Fortier Frederik Gladhorn @@ -206,8 +209,8 @@ Sebastian Döll libasys lolozere Lorenzo M. Catucci -Lukas Reschke Lukas Reschke -Lukas Reschke Lukas Reschke +Lukas Reschke Lukas Reschke +Lukas Reschke Lukas Reschke Luke Policinski Lyonel Vincent macjohnny @@ -309,6 +312,7 @@ Robin McCorkell Robin McCorkell Robin McCorkell Rodrigo Hjort Roeland Jago Douma Roeland Jago Douma +Roeland Jago Douma Roeland Douma rok Roland Hager Roland van Laar @@ -368,6 +372,7 @@ TheSFReader Thibaut GRIDEL thomas Thomas Müller Thomas Mueller +Thomas Müller Thomas Müller Thomas Olsen Thomas Schmidt Thomas Tanghus From d6a00efd382f1acc5a3343121ec31447f9cffe6c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 4 Jul 2016 15:19:47 +0200 Subject: [PATCH 6/8] Change nickvergessen mailmap entry (#25349) --- .mailmap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index b96269235cf4f..41d9ad6e582eb 100644 --- a/.mailmap +++ b/.mailmap @@ -182,7 +182,8 @@ Jesús Macias Jesus Macias jknockaert Joan Joar Wandborg -Joas Schilling Joas Schilling +Joas Schilling Joas Schilling +Joas Schilling Joas Schilling joel hansson Johan Björk Johannes Twittmann From 540978d2b0f42fbe67f18484a8dc802406d299c5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 21 Jul 2016 17:32:03 +0200 Subject: [PATCH 7/8] Fix more mailmap entries --- .mailmap | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.mailmap b/.mailmap index 41d9ad6e582eb..82805b664c0b2 100644 --- a/.mailmap +++ b/.mailmap @@ -39,6 +39,7 @@ Björn Schießle Björn Schießle Björn Schiessle Björn Schießle Bjoern Schießle Björn Schießle Bjoern Schiessle +Björn Schießle Björn Schießle BlackEagle Boris Rybalkin Borjan Tchakaloff @@ -302,13 +303,13 @@ Riccardo Iaconelli Richard Clarkson rnveach Robert Jäckel -Robin Appelman icewind1991 -Robin Appelman icewind1991 -Robin Appelman Robin -Robin Appelman Robin -Robin Appelman Robin Appelman -Robin Appelman Robin Appelman -Robin Appelman Robin Appelman +Robin Appelman icewind1991 +Robin Appelman icewind1991 +Robin Appelman Robin +Robin Appelman Robin +Robin Appelman Robin Appelman +Robin Appelman Robin Appelman +Robin Appelman Robin Appelman Robin McCorkell Robin McCorkell Robin McCorkell Robin McCorkell Rodrigo Hjort From c445cc4ad9c9043b679af47ecfec81cdb221b04a Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 21 Jul 2016 14:48:26 +0200 Subject: [PATCH 8/8] Fix e-mail in mailmap --- .mailmap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 82805b664c0b2..f160206ac9cb8 100644 --- a/.mailmap +++ b/.mailmap @@ -313,8 +313,8 @@ Robin Appelman Robin Appelman Robin McCorkell Robin McCorkell Robin McCorkell Robin McCorkell Rodrigo Hjort -Roeland Jago Douma Roeland Jago Douma -Roeland Jago Douma Roeland Douma +Roeland Jago Douma Roeland Jago Douma +Roeland Jago Douma Roeland Douma rok Roland Hager Roland van Laar