public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Parag Nemade <panemade AT redhat DOT com>
To: git-commits@fedoraproject.org
Subject: [rpms/langpacks] rawhide: Revert "Embed python script to avoid an error on rpmautospec"
Date: Tue, 06 Oct 2026 16:00:15 GMT [thread overview]
Message-ID: <179130241511.1.3700370091202678962.rpms-langpacks-096580f77266@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/langpacks
Branch : rawhide
Commit : 096580f772662921f70c52f3c5bf617d73538d97
Author : Parag Nemade <panemade AT redhat DOT com>
Date : 2026-10-06T21:14:37+05:30
Stats : +11/-11 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/langpacks/c/096580f772662921f70c52f3c5bf617d73538d97?branch=rawhide
Log:
Revert "Embed python script to avoid an error on rpmautospec"
This reverts commit 56eddfced77e2b7a097d12a2ba6dc49191af3ad0.
---
diff --git a/langpacks.spec b/langpacks.spec
index 827bca9..ad03f14 100644
--- a/langpacks.spec
+++ b/langpacks.spec
@@ -6,6 +6,7 @@ Summary: Langpacks meta-package
License: GPL-2.0-or-later
BuildArch: noarch
BuildRequires: python3 fontconfig
+Source4: normlang.py
# to split up the AppStream file
BuildRequires: libappstream-glib >= 0.5.10
@@ -1556,17 +1557,9 @@ for i = 1, #langpacks_package_list do
-- dependency list for langpacks-fonts-<lang>
local extra_deps = {}
local lang = langpacks_package_list[i]["lang"]
- -- The Python one-liner is expanded to include argtypes and handle potential NULL (None) returns safely
- local py_cmd = string.format([[python3 -c "import ctypes, sys; fc = ctypes.CDLL('libfontconfig.so.1'); fc.FcLangNormalize.argtypes = [ctypes.c_char_p]; fc.FcLangNormalize.restype = ctypes.c_char_p; res = fc.FcLangNormalize(sys.argv[1].encode('utf-8')); print(res.decode('utf-8') if res else '')" '%s' 2>&1]], lang)
-
- local fp = io.popen(py_cmd)
- local orth = fp:read("*a")
- fp:close()
-
- -- Strip the trailing newline that Python's print() adds
- if orth then
- orth = orth:gsub("%s+$", "")
- end
+ rpm.define("langcode " .. lang .. "\n")
+ local orth = rpm.expand("%(python3 %{SOURCE4} %{langcode})")
+ rpm.undefine("langcode")
local lowerorth = string.lower(orth)
local normlang = string.gsub(string.lower(lang), "_", "-")
local langname = langpacks_package_list[i]["langname"]
diff --git a/normlang.py b/normlang.py
new file mode 100644
index 0000000..38de6ce
--- /dev/null
+++ b/normlang.py
@@ -0,0 +1,7 @@
+import ctypes
+import sys
+
+fontconfig = ctypes.CDLL("libfontconfig.so.1")
+fontconfig.FcLangNormalize.argtypes = [ctypes.c_char_p]
+fontconfig.FcLangNormalize.restype = ctypes.c_char_p
+print(fontconfig.FcLangNormalize(sys.argv[1].encode('utf-8')).decode('utf-8'))
reply other threads:[~2026-10-06 16:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179130241511.1.3700370091202678962.rpms-langpacks-096580f77266@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox