summaryrefslogtreecommitdiffstats
path: root/autobuild
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2025-04-26 10:00:35 +0000
committerPascal Terjan <pterjan@mageia.org>2025-04-26 10:00:35 +0000
commita839ee5e5ce65a1be7c438e4a112dc208b987dd1 (patch)
treeccb6b33506e1ea12cfd8b8b91658dedc42f3a873 /autobuild
parenta68a95c67e3b31cb0fa2184691e53b8d7e434125 (diff)
downloadpkgsubmit-master.tar
pkgsubmit-master.tar.gz
pkgsubmit-master.tar.bz2
pkgsubmit-master.tar.xz
pkgsubmit-master.zip
Fix history linksHEADmaster
Diffstat (limited to 'autobuild')
-rw-r--r--autobuild/history.php26
1 files changed, 18 insertions, 8 deletions
diff --git a/autobuild/history.php b/autobuild/history.php
index c74b0b9..4f8b91c 100644
--- a/autobuild/history.php
+++ b/autobuild/history.php
@@ -11,14 +11,24 @@ if (!$package_id) {
echo "<h1>History of package \"$package\"</h1>\n";
$result = $db->query("SELECT date(datetime(Start, 'unixepoch')) as run, ResultValues.Name FROM Runs, Results, ResultValues WHERE Runs.Id = Results.Run AND Results.Result = ResultValues.Id AND Results.Package = '$package_id' ORDER BY Start DESC");
while ($entry = $result->fetchArray(SQLITE3_ASSOC)) {
- $run = $entry['run'];
- $build_result = $entry['Name'];
- echo "<a href='results.php?run=$run' >$run</a> ";
- if ($link = glob("cauldron/*/core/$run/$package-*.src.rpm/")) {
- echo "<a href='$link[0]'>$build_result</a><br/>\n";
- } else {
- echo "$build_result<br/>\n";
- }
+ $run = $entry['run'];
+ $build_result = $entry['Name'];
+ echo "<a href='results.php?run=$run' >$run</a> ";
+ $link_exists = false;
+ if ($link = glob("cauldron/*/core/$run/$package-*/")) {
+ # Handle the case when a package is a prefix of several packages
+ $p = preg_quote($package);
+ foreach ($link as $l) {
+ if (preg_match("/$p-[^-]*-[^-]*$/", $l)) {
+ echo "<a href='$link[0]'>$build_result</a><br/>\n";
+ $link_exists = true;
+ break;
+ }
+ }
+ }
+ if (!$link_exists) {
+ echo "$build_result<br/>\n";
+ }
}
?>