From 462435a44b800d96bd723f436754b02d87bec29e Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Fri, 10 May 2013 17:54:11 +0200 Subject: correctly add provides and remove version/abi numbers This is a bit hackish. inside apk_tools deps can link to abi version or pkgver In our apk_browser this is not yet implemented. --- apk_browser.module | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apk_browser.module b/apk_browser.module index 5568016..ec54659 100644 --- a/apk_browser.module +++ b/apk_browser.module @@ -415,10 +415,19 @@ function apk_browser_apkindex_reader($apk_string) { $apackage = preg_split("`\n`", $package); foreach ($apackage as $apk_line) { switch ($apk_line[0]) { - //depend and install_if lines + /* + * Check all package names in install_if depends and provides + * put them in arrays and remove version/abi numbers. + * removing version/abi is a bit hackish. + */ case "D": case "i": - $result[$key][$apk_line[0]] = explode(" ", substr($apk_line, 2)); + case "p": + $pkgnames = explode(" ", substr($apk_line, 2)); + foreach ($pkgnames as $pkgname) { + $pkgname = explode('=', $pkgname); + $result[$key][$apk_line[0]][] = $pkgname[0]; + } break; //other apk variables default: -- cgit v1.2.3