Package: dspdfviewer / 1.15.1+git20230427.d432d8d-1

0001-fix-ftbfs-with-plus-in-version-number.patch Patch series | download
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
30
31
32
33
34
35
From: Danny Edel <mail@danny-edel.de>
Date: Tue, 5 Apr 2016 16:08:32 +0200
Subject: fix ftbfs with plus in version number

The TestCommandLine{Version/Help} tests used the version number as a
*regex* (not just as a string) to check the output of the program.  In a
backports upload, this version number will contain a plus sign (suffix ~bpo8+1), which doesn't match itself.
---
 testing/CMakeLists.txt | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt
index 977cfff..e71d83e 100644
--- a/testing/CMakeLists.txt
+++ b/testing/CMakeLists.txt
@@ -110,11 +110,18 @@ add_test(NAME TestCommandLineVersion
 add_test(NAME TestCommandLineHelp
 	COMMAND dspdfviewer --help
 )
+
+string(REGEX REPLACE "([.*+()?])" "\\\\\\1"
+	SANITIZED_VERSION ${DSPDFVIEWER_VERSION}
+)
+
+message(STATUS "Version number regex: ${SANITIZED_VERSION}")
+
 set_tests_properties(
 	TestCommandLineVersion
 	TestCommandLineHelp
 	PROPERTIES
-		PASS_REGULAR_EXPRESSION ${DSPDFVIEWER_VERSION}
+		PASS_REGULAR_EXPRESSION ${SANITIZED_VERSION}
 )
 
 # Only build and run the swap screen test on Qt5