Escaping globs and quoting in rpm spec files is tricky and requires a
bit of dancing. In addition to that it changes from time to time.
Adding (simple) regression test for different types of filename
patterns. Cover brackets and parentheses in first iteration

[Yocto #13746]

Signed-off-by: Pavel Zhukov <[email protected]>
---
 .../recipes-test/testrpm/files/testfile.txt    |  1 +
 .../recipes-test/testrpm/testrpm_0.0.1.bb      | 18 ++++++++++++++++++
 meta/lib/oeqa/selftest/cases/rpmtests.py       | 14 ++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 meta-selftest/recipes-test/testrpm/files/testfile.txt
 create mode 100644 meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb
 create mode 100644 meta/lib/oeqa/selftest/cases/rpmtests.py

diff --git a/meta-selftest/recipes-test/testrpm/files/testfile.txt 
b/meta-selftest/recipes-test/testrpm/files/testfile.txt
new file mode 100644
index 00000000000..c4d7630c1e1
--- /dev/null
+++ b/meta-selftest/recipes-test/testrpm/files/testfile.txt
@@ -0,0 +1 @@
+== This file serves the purposes of SRC_URI only
diff --git a/meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb 
b/meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb
new file mode 100644
index 00000000000..5e8761ab554
--- /dev/null
+++ b/meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Test recipe for testing rpm generated by oe-core"
+LIC_FILES_CHKSUM = 
"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+LICENSE = "MIT"
+
+SRC_URI = "file://testfile.txt"
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_compile(){
+       echo "testdata" > ${B}/"file with [brackets].txt"
+       echo "testdata" > ${B}/"file with (parentheses).txt"
+}
+
+do_install(){
+       install ${B}/* ${D}/
+}
+
+FILES:${PN} = "*"
diff --git a/meta/lib/oeqa/selftest/cases/rpmtests.py 
b/meta/lib/oeqa/selftest/cases/rpmtests.py
new file mode 100644
index 00000000000..902d7dca3da
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rpmtests.py
@@ -0,0 +1,14 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake
+
+class BitbakeTests(OESelftestTestCase):
+
+    def test_rpm_filenames(self):
+        test_recipe = "testrpm"
+        bitbake(test_recipe)
-- 
2.35.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#169629): 
https://lists.openembedded.org/g/openembedded-core/message/169629
Mute This Topic: https://lists.openembedded.org/mt/93123926/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to