Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-02-12 11:06:07 +0300
committerJoas Schilling <nickvergessen@owncloud.com>2016-02-17 10:47:25 +0300
commit100b357c688868dc4104c05dba3677cf2b650b2e (patch)
tree6ee2a203395efffaf157527a51b041ce95f1a531 /build/license.php
parent049e3473b2d0c4461d68ccb65b52d28b166cfb79 (diff)
Check the mailmap file of core as well
Diffstat (limited to 'build/license.php')
-rw-r--r--build/license.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/build/license.php b/build/license.php
index 9a2495683c2..d7ac4e0a143 100644
--- a/build/license.php
+++ b/build/license.php
@@ -20,7 +20,8 @@
*/
class Licenses
{
- protected $paths = array();
+ protected $paths = [];
+ protected $mailMap = [];
public $authors = [];
public function __construct() {
@@ -196,12 +197,38 @@ With help from many libraries and frameworks including:
'Not Committed Yet <not.committed.yet>',
'Jenkins for ownCloud <owncloud-bot@tmit.eu>']);
});
+
+ if ($gitRoot) {
+ $authors = array_map([$this, 'checkCoreMailMap'], $authors);
+ $authors = array_unique($authors);
+ }
+
$authors = array_map(function($author){
$this->authors[$author] = $author;
return " * @author $author";
}, $authors);
return implode(PHP_EOL, $authors);
}
+
+ private function checkCoreMailMap($author) {
+ if (empty($this->mailMap)) {
+ $content = file_get_contents(__DIR__ . '/../.mailmap');
+ $entries = explode("\n", $content);
+ foreach ($entries as $entry) {
+ if (strpos($entry, '> ') === false) {
+ $this->mailMap[$entry] = $entry;
+ } else {
+ list($use, $actual) = explode('> ', $entry);
+ $this->mailMap[$actual] = $use . '>';
+ }
+ }
+ }
+
+ if (isset($this->mailMap[$author])) {
+ return $this->mailMap[$author];
+ }
+ return $author;
+ }
}
$licenses = new Licenses;