summaryrefslogtreecommitdiffstats
path: root/roundcubemail-bundled.php
diff options
context:
space:
mode:
Diffstat (limited to 'roundcubemail-bundled.php')
-rw-r--r--roundcubemail-bundled.php29
1 files changed, 19 insertions, 10 deletions
diff --git a/roundcubemail-bundled.php b/roundcubemail-bundled.php
index 2acae7b..c963e9e 100644
--- a/roundcubemail-bundled.php
+++ b/roundcubemail-bundled.php
@@ -16,24 +16,33 @@ if (!is_array($pkgs)) {
exit(3);
}
-$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'])) {
+ $res = [];
foreach($pkgs['dependencies'] as $pkg) {
$n = strtolower($pkg['name'] ?? $pkg['lib']);
$n = str_replace('.js', '', $n);
- printf("Provides: bundled(js-%s) = %s\n", $n, $pkg['version']);
- if (isset($pkg['license'])) {
- $lic[] = $pkg['license'];
- }
+ $lic = ($pkg['license'] ?? "Unkown");
+ if (!isset($res[$lic])) $res[$lic] = [];
+ $res[$lic][] = sprintf("Provides: bundled(js-%s) = %s", $n, $pkg['version']);
+ }
+ ksort($res);
+ foreach($res as $lic => $lib) {
+ sort($lib);
+ printf("# License %s\n%s\n", $lic, implode("\n", $lib));
}
} else {
echo "unkown content\n";
exit(4);
}
-sort($lic);
-printf("\nLicense: %s\n", implode(' and ', array_unique($lic)));