diff --git a/.mailmap b/.mailmap index 3fdaa301b1637..f160206ac9cb8 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,16 @@ 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 +Björn Schießle Björn Schießle BlackEagle Boris Rybalkin Borjan Tchakaloff @@ -61,6 +63,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 +127,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 @@ -179,7 +183,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 @@ -206,8 +211,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 @@ -298,17 +303,18 @@ 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 -Roeland Jago Douma Roeland Jago Douma +Roeland Jago Douma Roeland Jago Douma +Roeland Jago Douma Roeland Douma rok Roland Hager Roland van Laar @@ -368,6 +374,7 @@ TheSFReader Thibaut GRIDEL thomas Thomas Müller Thomas Mueller +Thomas Müller Thomas Müller Thomas Olsen Thomas Schmidt Thomas Tanghus diff --git a/build/license.php b/build/license.php index 493c7dafd9858..11675f21a0722 100644 --- a/build/license.php +++ b/build/license.php @@ -22,14 +22,39 @@ class Licenses { protected $paths = []; protected $mailMap = []; + protected $checkFiles = []; public $authors = []; 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); } /** @@ -68,6 +93,7 @@ function exec($folder, $gitRoot = false) { if (is_file($folder)) { $this->handleFile($folder, $gitRoot); + $this->printFilesToCheck(); return; } @@ -92,11 +118,13 @@ function exec($folder, $gitRoot = false) { /** @var SplFileInfo $file */ $this->handleFile($file, $gitRoot); } + + $this->printFilesToCheck(); } function writeAuthorsFile() { ksort($this->authors); - $template = "ownCloud is written by: + $template = "Nextcloud is written by: @AUTHORS@ With help from many libraries and frameworks including: @@ -118,10 +146,17 @@ function handleFile($path, $gitRoot) { echo "MIT licensed file: $path" . PHP_EOL; return; } - $source = $this->eatOldLicense($source); + $copyrightNotices = $this->getCopyrightNotices($path, $source); $authors = $this->getAuthors($path, $gitRoot); - $license = str_replace('@AUTHORS@', $authors, $this->licenseText); + if ($this->isOwnCloudLicensed($source)) { + $license = str_replace('@AUTHORS@', $authors, $this->licenseTextLegacy); + $this->checkCopyrightState($path, $gitRoot); + } else { + $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 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) { + 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")); @@ -209,6 +320,7 @@ private function getAuthors($file, $gitRoot) { $this->authors[$author] = $author; return " * @author $author"; }, $authors); + return implode(PHP_EOL, $authors); } @@ -238,6 +350,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', @@ -251,8 +364,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',