File: 0018-use-Debian-changelog-to-discover-a-version-to-show.patch

package info (click to toggle)
openqa 5.1764349525.ffb594867-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,264 kB
  • sloc: perl: 57,599; sql: 26,462; javascript: 8,466; xml: 2,229; sh: 1,705; makefile: 443; python: 249
file content (29 lines) | stat: -rw-r--r-- 991 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Roland Clobus <rclobus@rclobus.nl>
Date: Sat, 8 Feb 2025 23:03:59 +0100
Subject: use Debian changelog to discover a version to show

This is (a slightly modified version of) the patch from Roland's
bug report #1077069

[git-debrebase split: mixed commit: upstream part]
---
 lib/OpenQA/Utils.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/OpenQA/Utils.pm b/lib/OpenQA/Utils.pm
index 8a8763a..8dfc070 100644
--- a/lib/OpenQA/Utils.pm
+++ b/lib/OpenQA/Utils.pm
@@ -666,7 +666,11 @@ sub detect_current_version ($path) {
 
     if (-e $changelog_file) {
         my $changelog = $changelog_file->slurp;
-        if ($changelog && $changelog =~ /Update to version (\d+\.\d+\.(\b[0-9a-f]{5,40}\b))\:/mi) {
+        if (
+            $changelog
+            && (   $changelog =~ /Update to version (\d+\.\d+\.(\b[0-9a-f]{5,40}\b))\:/mi
+                || $changelog =~ /^openqa \(([^)]+)/mi))
+        {
             $current_version = $1;
         }
     }