diff options
Diffstat (limited to 'phpMyAdmin-bundled.php')
-rw-r--r-- | phpMyAdmin-bundled.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/phpMyAdmin-bundled.php b/phpMyAdmin-bundled.php index 5f2cb89..ee018ef 100644 --- a/phpMyAdmin-bundled.php +++ b/phpMyAdmin-bundled.php @@ -18,9 +18,16 @@ if (!is_array($pkgs)) { $lic = []; if (isset($pkgs['packages'])) { - foreach($pkgs['packages'] as $pkg) { - printf("Provides: bundled(php-%s) = %s\n", str_replace(['/', '_'], ['-', '-'], $pkg['name']), $pkg['version']); - $lic = array_merge($lic, $pkg['license']); + $res = []; + foreach($pkgs["packages"] as $pkg) { + $lic = implode(" and ", $pkg["license"]); + if (!isset($res[$lic])) $res[$lic] = []; + $res[$lic][] = sprintf("Provides: bundled(php-%s) = %s", str_replace(["/", "_"], ["-", "-"], $pkg["name"]), $pkg["version"]); + } + ksort($res); + foreach($res as $lic => $lib) { + sort($lib); + printf("# License %s\n%s\n", $lic, implode("\n", $lib)); } } else if (isset($pkgs['dependencies'])) { foreach($pkgs['dependencies'] as $pkg) { @@ -35,5 +42,3 @@ if (isset($pkgs['packages'])) { echo "unkown content\n"; exit(4); } -sort($lic); -printf("\nLicense: %s\n", implode(' and ', array_unique($lic))); |