From d48bb1938aa810fca92f1f02d01d593a818da92c Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Fri, 25 Aug 2006 06:57:46 +0000 Subject: feed-browser: show links to all depends/provides/conflicts, show packages not only by Name: but also by Provides: --- contrib/feed-browser/index.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'contrib') diff --git a/contrib/feed-browser/index.php b/contrib/feed-browser/index.php index a23a713c36..3b1230ce22 100644 --- a/contrib/feed-browser/index.php +++ b/contrib/feed-browser/index.php @@ -288,7 +288,8 @@ function searchsection($section) function pkgdetails ($package) { $result = db_query("SELECT * FROM packages,feeds - WHERE packages.p_name='$package' AND feeds.f_name = packages.p_feed + WHERE (packages.p_name='$package' OR packages.p_provides='$package') + AND feeds.f_name = packages.p_feed ORDER BY packages.p_version DESC, feeds.f_name ASC, packages.p_arch DESC "); // display first result @@ -410,20 +411,17 @@ function pkgdetails ($package) function addlinks ($input) { // split input elements up - $elements = preg_split ('/[\s,]+/', $input); + $elements = explode (', ', $input); $offset = 0; foreach ($elements as $element) { - // skip version information and empty elements (shouldn't happend) - if (!eregi('^([0-9a-z\-]*)$', $element) OR empty($element)) - { - continue; - } + // strip version number + $element = ereg_replace('^(.*)( \((.*)\))+$', '\\1', $element); // do we have this package in the db? - $result = db_query ("SELECT DISTINCT p_name FROM packages WHERE p_name='{$element}'"); + $result = db_query ("SELECT DISTINCT p_name FROM packages WHERE p_name='{$element}' OR p_provides='{$element}'"); if(isset($result[0]['p_name'])) { @@ -443,7 +441,6 @@ function addlinks ($input) } } - return $input; } -- cgit v1.2.3