From 9fbebe6820e7da4bf316a729090884685499de69 Mon Sep 17 00:00:00 2001 From: Vladimir Romanov Date: Mon, 19 Oct 2026 00:29:47 +0300 Subject: [PATCH] sysinfo: Also replace `-` with `_` at `dns_to_rdns` function `appstream validate` failed if `cid-rdns-contains-hyphen` but `as_utils_dns_to_rdns` doesn't convert `org.my-example` to `my_example` so there is dead-end if `HOME_URL` equals to `https://alt-atomic.org --- src/as-utils.c | 1 + tests/test-basics.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/as-utils.c b/src/as-utils.c index a27860d8..2d91a4db 100644 --- a/src/as-utils.c +++ b/src/as-utils.c @@ -2262,6 +2262,7 @@ as_utils_dns_to_rdns (const gchar *url, const gchar *suffix) new_cid = g_string_new (suffix); for (i = 0; parts[i] != NULL; i++) { if (g_strcmp0 (parts[i], "www") != 0) { + g_strdelimit (parts[i], "-", '_'); g_string_prepend_c (new_cid, '.'); g_string_prepend (new_cid, parts[i]); } diff --git a/tests/test-basics.c b/tests/test-basics.c index 2feabb45..38f83836 100644 --- a/tests/test-basics.c +++ b/tests/test-basics.c @@ -1304,6 +1304,10 @@ test_rdns_convert (void) tmp = as_utils_dns_to_rdns ("https://example.com", "MyApp"); g_assert_cmpstr (tmp, ==, "com.example.MyApp"); g_free (tmp); + + tmp = as_utils_dns_to_rdns ("https://my-example.org", "My-App"); + g_assert_cmpstr (tmp, ==, "org.my_example.My-App"); + g_free (tmp); } /**