summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-04-20 15:07:15 +0200
committerRemi Collet <remi@php.net>2022-04-20 15:07:15 +0200
commita0b3e3732e5e648f3a1620a4782208f8865556d5 (patch)
tree349fde1afe56aa3dd786f7da71d1751f0cf5ce7c
parent8d567b1169cd32c43d90e9f576796d9e9b0535ff (diff)
sort bundled libraries list by license
-rw-r--r--composer.spec14
1 files changed, 9 insertions, 5 deletions
diff --git a/composer.spec b/composer.spec
index 9e247a1..22da6b4 100644
--- a/composer.spec
+++ b/composer.spec
@@ -161,6 +161,7 @@ Requires: php-composer(fedora/autoloader)
# System certificates
Requires: ca-certificates
# Bundled libraries
+# License MIT
Provides: bundled(php-composer-ca-bundle) = 1.3.1
Provides: bundled(php-composer-metadata-minifier) = 1.0.0
Provides: bundled(php-composer-pcre) = 2.0.0
@@ -300,13 +301,16 @@ php -r '
echo "cant decode json file\n";
exit(3);
}
- $lic = [];
+ $res = [];
foreach($pkgs["packages"] as $pkg) {
- printf("Provides: bundled(php-%s) = %s\n", str_replace(["/", "_"], ["-", "-"], $pkg["name"]), $pkg["version"]);
- $lic = array_merge($lic, $pkg["license"]);
+ $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"]);
+ }
+ foreach($res as $lic => $lib) {
+ sort($lib);
+ printf("# License %s\n%s\n", $lic, implode("\n", $lib));
}
- sort($lic);
- printf("\nLicense: %s\n\n", implode(" and ", array_unique($lic)));
'
%endif