summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-14 11:23:52 +0200
committerErich Eckner <git@eckner.net>2018-04-14 11:23:52 +0200
commit2096b05a54237735b676ffe495eed7d7b07126f6 (patch)
tree43ba0dd423dced61f3b4b12131c5c8cdcd06b62e /packages
parent7c2cf88e2180cec54ade61ecf961bcbdac783b65 (diff)
downloadarchweb32-2096b05a54237735b676ffe495eed7d7b07126f6.tar.xz
packages/pkginfo.php: truncate version info from install_targets
Diffstat (limited to 'packages')
-rw-r--r--packages/pkginfo.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/packages/pkginfo.php b/packages/pkginfo.php
index 39c6dfd..bf5b406 100644
--- a/packages/pkginfo.php
+++ b/packages/pkginfo.php
@@ -115,17 +115,24 @@
return $dep["install_target"];
};
- $dep_it = array_map("dependency_extract_name", array_filter( $dependencies, "dependency_is_runtime"));
+ function truncate_version($name) {
+ return preg_replace("[<=>].*$","",$name);
+ }
+
+ $dep_it = array_filter( $dependencies, "dependency_is_runtime");
+ $dep_it = array_map("dependency_extract_name", $dep_it);
+ $dep_it = array_map("truncate_version", $dep_it);
+ $js_dep = array_map("truncate_version", $json_content["Depends On"]);
$dep_errors = implode(
", ",
array_diff(
- array_merge($dep_it,$json_content["Depends On"]),
- array_intersect($dep_it,$json_content["Depends On"])
+ array_merge($dep_it,$js_dep),
+ array_intersect($dep_it,$js_dep)
)
);
-// if ($dep_errors != "")
-// die_500("Dependencies differ: " . $dep_errors);
+ if ($dep_errors != "")
+ die_500("Dependencies differ: " . $dep_errors);
// query dependent packages