From c98de829c48da80dcdcd6db88b4575369950e2dc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 21 Jul 2016 17:08:43 +0200 Subject: [PATCH 1/2] 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 b64c6d6993ca30882f7c7e06344e1b7de34ca817 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 21 Jul 2016 18:01:31 +0200 Subject: [PATCH 2/2] 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; }