Skip to contentSkip to conversation

libtoml11/files/run-ptest: cleanup

PATCH New Adam Duskett 1 participant 8 messages Feb 17

lore
Share & tools
lore
#0 lore raw

PATCH 1/8 libtoml11/files/run-ptest: cleanup

Shellcheck -oall warnings fixed:
- exit 1 if cd tests failes (SC2164)

- Double quote ./${atest} to prevent globbing and word splitting. (SC2086)

- Check the test exit code directly intead of using $? (SC2181)

Other fixes:
- The shebang sould traditionally be /usr/bin/env sh in case sh is not located in /bin.

- Do not remove tests.log for every test.

---
 meta-oe/recipes-devtools/libtoml11/files/run-ptest | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
meta-oe/recipes-devtools/libtoml11/files/run-ptest +6 -5
index 9bc480aa7f..4da9e68cc5 100755
@@ -1,10 +1,11 @@
-#!/bin/sh
+#!/usr/bin/env sh
+
+cd tests || exit 1
+
+rm -rf tests.log
 
-cd tests
 for atest in test_* ; do
-    rm -rf tests.log
-    ./${atest} > tests.log 2>&1
-    if [ $? = 0 ] ; then
+    if ./"${atest}" >> tests.log 2>&1; then
         echo "PASS: ${atest}"
     else
         echo "FAIL: ${atest}"
Signature · 1 line
2.53.0
#1 lore raw

PATCH 2/8 libtoml11/files/0001-Remove-whitespace-in-operator.patch: change upstream-status

Change "Submitted" in 0001-Remove-whitespace-in-operator.patch to "Backport" with the appropraite link to the relevant commit hash.

---
 .../libtoml11/files/0001-Remove-whitespace-in-operator.patch    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-devtools/libtoml11/files/0001-Remove-whitespace-in-operator.patch +1 -1
index c8c9922d55..9516ee5cb1 100644
@@ -11,7 +11,7 @@ include/toml11/impl/../fwd/literal_fwd.hpp:22:26: error: identifier '_toml' prec
 |       |               ~~~~~~~~~~~^~~~~
 |       |               operator""_toml
 
-Upstream-Status: Submitted [https://github.com/ToruNiina/toml11/pull/285]
+Upstream-Status: Backport [https://github.com/ToruNiina/toml11/commit/dee78f822d8a5b985e565e5c1ef42a59557aa8fc]
 Signed-off-by: Khem Raj <[email protected]>
 ---
  include/toml11/fwd/literal_fwd.hpp   | 2 +-
Signature · 1 line
2.53.0
#2 lore raw

PATCH 3/8 libtoml11: use gitsm for SRC_URI

In reply to Adam Duskett

Using gitsm also allows for the revmoval of SRCREV_json and SRCREV_doctest.

---
 meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb +1 -7
index 38786b79ed..d07e49c4fe 100644
@@ -12,17 +12,11 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=44d1fcf70c7aa6991533c38daf7befa3"
 PE = "1"
 
 SRCREV = "be08ba2be2a964edcdb3d3e3ea8d100abc26f286"
-SRCREV_json = "8c391e04fe4195d8be862c97f38cfe10e2a3472e"
-SRCREV_doctest = "ae7a13539fb71f270b87eb2e874fbac80bc8dda2"
 
-SRC_URI = "git://github.com/ToruNiina/toml11;branch=main;protocol=https \
-           git://github.com/nlohmann/json;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/tests/extlib/json;name=json;branch=develop;protocol=https \
-           git://github.com/doctest/doctest;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/tests/extlib/doctest;name=doctest;branch=master;protocol=https \
+SRC_URI = "gitsm://github.com/ToruNiina/toml11.git;protocol=https;branch=main \
            file://0001-Remove-whitespace-in-operator.patch \
            file://run-ptest \
 "
-SRCREV_FORMAT = "json_doctest"
-
 
 inherit cmake ptest
 
Signature · 1 line
2.53.0
#3 lore raw

PATCH 4/8 libtoml11: check PTEST_ENABLED instead of DISTRO_FEATURES

In reply to Adam Duskett

Checking for PTEST_ENABLED 1 is the preferred method for enabling and disabling ptests for packages.

---
 meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb +1 -1
index d07e49c4fe..4b9eccf88d 100644
@@ -21,7 +21,7 @@ SRC_URI = "gitsm://github.com/ToruNiina/toml11.git;protocol=https;branch=main \
 inherit cmake ptest
 
 EXTRA_OECMAKE += "-DTOML11_PRECOMPILE=ON \
-                  -DTOML11_BUILD_TESTS=${@bb.utils.contains("DISTRO_FEATURES", "ptest", "ON", "OFF", d)} \
+                  -DTOML11_BUILD_TESTS=${@bb.utils.contains("PTEST_ENABLED", "1", "ON", "OFF", d)} \
 "
 
 ALLOW_EMPTY:${PN} = "1"
Signature · 1 line
2.53.0
#4 lore raw

PATCH 5/8 libtoml11: Add a bugtracker url

In reply to Adam Duskett
---
 meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb +1 -0
index 4b9eccf88d..60c97b1c2c 100644
@@ -3,6 +3,7 @@ DESCRIPTION = "toml11 is a feature-rich TOML language library for \
                C++11/14/17/20."
 
 HOMEPAGE = "https://github.com/ToruNiina/toml11"
+BUGTRACKER = "https://github.com/ToruNiina/toml11/issues"
 
 SECTION = "libs"
 
Signature · 1 line
2.53.0
#5 lore raw

PATCH 6/8 libtoml11: add a cve_product

In reply to Adam Duskett
---
 meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb +1 -0
index 60c97b1c2c..5815a5e574 100644
@@ -4,6 +4,7 @@ DESCRIPTION = "toml11 is a feature-rich TOML language library for \
 
 HOMEPAGE = "https://github.com/ToruNiina/toml11"
 BUGTRACKER = "https://github.com/ToruNiina/toml11/issues"
+CVE_PRODUCT = "libtoml11"
 
 SECTION = "libs"
 
Signature · 1 line
2.53.0
#6 lore raw

PATCH 7/8 libtoml11: add a BBCLASSEXTEND

In reply to Adam Duskett

A native version of libtoml11 may be needed for recipes such as dnf5 in the future. Add it now.

---
 meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb +2 -0
index 5815a5e574..d31ca06e77 100644
@@ -32,3 +32,5 @@ do_install_ptest () {
     install -d ${D}${PTEST_PATH}/tests
     cp -r ${B}/tests/test_* ${D}${PTEST_PATH}/tests
 }
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.53.0
#7 lore raw

PATCH 8/8 libtoml11: move SRCREV below SRC_URI

In reply to Adam Duskett

According to the recipe style guide, SRCREV should be placed below SRC_URI.

---
 meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
meta-oe/recipes-devtools/libtoml11/libtoml11_4.4.0.bb +5 -5
index d31ca06e77..7e097e4612 100644
@@ -13,12 +13,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=44d1fcf70c7aa6991533c38daf7befa3"
 
 PE = "1"
 
-SRCREV = "be08ba2be2a964edcdb3d3e3ea8d100abc26f286"
-
-SRC_URI = "gitsm://github.com/ToruNiina/toml11.git;protocol=https;branch=main \
-           file://0001-Remove-whitespace-in-operator.patch \
-           file://run-ptest \
+SRC_URI = "\
+    gitsm://github.com/ToruNiina/toml11.git;protocol=https;branch=main;tag=v${PV} \
+    file://0001-Remove-whitespace-in-operator.patch \
+    file://run-ptest \
 "
+SRCREV = "be08ba2be2a964edcdb3d3e3ea8d100abc26f286"
 
 inherit cmake ptest
 
Signature · 1 line
2.53.0