public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/reuse] epel10: Add profile.d script to select chardet library
@ 2026-08-19 12:50 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-19 12:50 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/reuse
            Branch : epel10
            Commit : c9dc1845ba80442f0c9b5270ff9558c59800ca62
            Author : Jan Staněk <jstanek@redhat.com>
            Date   : 2025-10-21T11:04:00+02:00
            Stats  : +18/-0 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/reuse/c/c9dc1845ba80442f0c9b5270ff9558c59800ca62?branch=epel10

            Log:
            Add profile.d script to select chardet library

This is to workaround around lingering issues with python-file-magic
and the upstream expectations of python-magic.
See the linked issues for details.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2402682
Upstream-Issue: https://github.com/fsfe/reuse-tool/issues/1261

---
diff --git a/reuse-chardet.csh b/reuse-chardet.csh
new file mode 100644
index 0000000..84c4e60
--- /dev/null
+++ b/reuse-chardet.csh
@@ -0,0 +1,6 @@
+# select charset detection module for reuse
+# This is a workaround around issue https://github.com/fsfe/reuse-tool/issues/1261,
+# and will be removed once it is resolved
+
+if ($?REUSE_ENCODING_MODULE) exit
+setenv REUSE_ENCODING_MODULE charset_normalizer

diff --git a/reuse-chardet.sh b/reuse-chardet.sh
new file mode 100644
index 0000000..2e3139e
--- /dev/null
+++ b/reuse-chardet.sh
@@ -0,0 +1,5 @@
+# select charset detection module for reuse
+# This is a workaround around issue https://github.com/fsfe/reuse-tool/issues/1261,
+# and will be removed once it is resolved
+
+if test -z "$REUSE_ENCODING_MODULE"; then export REUSE_ENCODING_MODULE=charset_normalizer; fi

diff --git a/reuse.spec b/reuse.spec
index c508cf1..d21053a 100644
--- a/reuse.spec
+++ b/reuse.spec
@@ -7,6 +7,10 @@ Summary:        A tool for compliance with the REUSE recommendations
 License:        Apache-2.0 AND CC0-1.0 AND CC-BY-SA-4.0 AND GPL-3.0-or-later
 Url:            https://github.com/fsfe/reuse-tool
 Source0:        %pypi_source
+# workaround for python-file-magic issues
+# https://github.com/fsfe/reuse-tool/issues/1261
+Source1:        reuse-chardet.sh
+Source2:        reuse-chardet.csh
 
 Patch:  0001-remove-dependency-on-python-magic.patch
 
@@ -60,6 +64,8 @@ popd
 
 install -p -m0644 -Dt "${RPM_BUILD_ROOT}%{_mandir}/man1" docs/manpages/*.1
 
+install -p -m0644 -Dt "${RPM_BUILD_ROOT}%{_sysconfdir}/profile.d/" '%{SOURCE1}' '%{SOURCE2}'
+
 %check
 # Note: just running %%{pytest} does not work, since the path manipulation
 # by that macro and `--doctest-modules` confuse the import machinery too much.
@@ -72,6 +78,7 @@ install -p -m0644 -Dt "${RPM_BUILD_ROOT}%{_mandir}/man1" docs/manpages/*.1
 %{_bindir}/reuse
 %{_mandir}/man1/reuse.1*
 %{_mandir}/man1/reuse-*.1*
+%{_sysconfdir}/profile.d/reuse-chardet.*
 
 %changelog
 %autochangelog

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-19 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-19 12:50 [rpms/reuse] epel10: Add profile.d script to select chardet library 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox