From 65d6c836b67093e9495e6643efd9d040e024977c Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Mon, 26 Dec 2011 13:40:34 +0000 Subject: parse package name, in case a full file name is provided --- maintdb.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'maintdb.php') diff --git a/maintdb.php b/maintdb.php index 26ee1e5..7998558 100644 --- a/maintdb.php +++ b/maintdb.php @@ -72,6 +72,19 @@ if (null !== $uid) { } } elseif (null !== $pkg) { $uid = null; + + // just in case, only keep the package name + // x11-driver-video-ati-6.14.1-4.mga1.src.rpm => x11-driver-video-ati + $ptemp = explode('-', $pkg); + $pkg = array(); + foreach ($ptemp as $pi) { + if (is_numeric($pi[0])) + break; + + $pkg[] = $pi; + } + $pkg = implode('-', $pkg); + if (preg_match_all(sprintf('/%s (.*)\n?/', $pkg), $s, $res)) { $return = array( 'packages' => array( -- cgit v1.2.1