summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-12-26 13:40:34 +0000
committerRomain d'Alverny <rda@mageia.org>2011-12-26 13:40:34 +0000
commit65d6c836b67093e9495e6643efd9d040e024977c (patch)
tree0a2874794e1bd5ff3e8b098c6706a2ea1f898c03
parent2a3860778f587c7eaa0ebeb1baa45931e78ab115 (diff)
downloadpkgsubmit-65d6c836b67093e9495e6643efd9d040e024977c.tar
pkgsubmit-65d6c836b67093e9495e6643efd9d040e024977c.tar.gz
pkgsubmit-65d6c836b67093e9495e6643efd9d040e024977c.tar.bz2
pkgsubmit-65d6c836b67093e9495e6643efd9d040e024977c.tar.xz
pkgsubmit-65d6c836b67093e9495e6643efd9d040e024977c.zip
parse package name, in case a full file name is provided
-rw-r--r--maintdb.php13
1 files changed, 13 insertions, 0 deletions
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(