From 2096b05a54237735b676ffe495eed7d7b07126f6 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 14 Apr 2018 11:23:52 +0200 Subject: packages/pkginfo.php: truncate version info from install_targets --- packages/pkginfo.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'packages') 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 -- cgit v1.2.3-70-g09d2