diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-09-04 17:04:21 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-09-04 17:04:21 +0000 |
commit | 32a5e12669c01d4bce6c28835eb24bd410d7e5a9 (patch) | |
tree | 4154eeab0805c143e2abf3c4d8cdcefd9a477c4f /lib.php | |
parent | b6a1bffd90a5f5fd38bb7208bc79e210ff6030ae (diff) | |
download | pkgsubmit-32a5e12669c01d4bce6c28835eb24bd410d7e5a9.tar pkgsubmit-32a5e12669c01d4bce6c28835eb24bd410d7e5a9.tar.gz pkgsubmit-32a5e12669c01d4bce6c28835eb24bd410d7e5a9.tar.bz2 pkgsubmit-32a5e12669c01d4bce6c28835eb24bd410d7e5a9.tar.xz pkgsubmit-32a5e12669c01d4bce6c28835eb24bd410d7e5a9.zip |
new get_submitted_packages()
Diffstat (limited to 'lib.php')
-rw-r--r-- | lib.php | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -19,6 +19,26 @@ */ /** + * List all packages submitted to the BS. + * + * @param string $upload_dir + * + * @return array +*/ +function get_submitted_packages($upload_dir) +{ + chdir($upload_dir); + + $matches = array(); + $all_files = shell_exec("find \( -name '*.rpm' -o -name '*.src.rpm.info' -o -name '*.lock' -o -name '*.done' -o -name '*.upload' \) -ctime -$max_modified -printf \"%p\t%T@\\n\""); + $re = "!^\./(\w+)/((\w+)/(\w+)/(\w+)/(\d+)\.(\w+)\.(\w+)\.(\d+))_?(.*)(\.src\.rpm(?:\.info)?|\.lock|\.done|\.upload)\s+(\d+\.\d+)$!m"; + $r = preg_match_all($re, + $all_files, + $matches, + PREG_SET_ORDER); +} + +/** * Return a human-readable label for this package build status. * * @param array $pkg package information |