summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-09-12 13:06:57 +0000
committerRomain d'Alverny <rda@mageia.org>2012-09-12 13:06:57 +0000
commit5f0a2054f48d19257383850ddd5f3814e21f5e32 (patch)
treee5a01bb54f180117046aed46671357b1983ed8a1
parent7193fdf842d5fa4bc8984a17b8977330044d712d (diff)
downloadpkgsubmit-5f0a2054f48d19257383850ddd5f3814e21f5e32.tar
pkgsubmit-5f0a2054f48d19257383850ddd5f3814e21f5e32.tar.gz
pkgsubmit-5f0a2054f48d19257383850ddd5f3814e21f5e32.tar.bz2
pkgsubmit-5f0a2054f48d19257383850ddd5f3814e21f5e32.tar.xz
pkgsubmit-5f0a2054f48d19257383850ddd5f3814e21f5e32.zip
list files for rejected status (log files layout is inconsistent across various statuses)
-rw-r--r--log_files.php41
1 files changed, 30 insertions, 11 deletions
diff --git a/log_files.php b/log_files.php
index 4c301cf..7f33a9e 100644
--- a/log_files.php
+++ b/log_files.php
@@ -28,24 +28,43 @@ $path = realpath($upload_dir . $key);
$job = explode('/', $key);
$job = end($job);
-if (!is_dir($path)) {
+if (false !== strpos($key, 'rejected')) {
+ $valid = file_exists($path);
+ $type = 'rejected';
+ $job = str_replace('.youri', '', $job);
+ $path = str_replace('.youri', '', $path);
+} else {
+ $valid = is_dir($path);
+ $type = 'regular';
+}
+
+if (!$valid) {
header('Status: 404 Not Found');
header('HTTP/1.0 404 Not Found');
die('Sorry, not found');
}
-$list = glob_recursive_tree($path . '/*');
+$list = array();
+
+if ($type == 'rejected') {
+
+ $list = glob($path . '.*');
-$others = array(
- '.youri',
- '_i586.done',
- '_x86_64.done'
-);
+} else {
-foreach ($others as $suffix) {
- $f = $path . $suffix;
- if (file_exists($f)) {
- $list[] = $f;
+ $list = glob_recursive_tree($path . '/*');
+
+ $others = array(
+ '.youri',
+ '_i586.done',
+ '_x86_64.done'
+ );
+
+ foreach ($others as $suffix) {
+ $f = $path . $suffix;
+ if (file_exists($f)) {
+ $list[] = $f;
+ }
}
}