public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/reuse] epel10: Add profile.d script to select chardet library
Date: Wed, 19 Aug 2026 12:50:35 GMT	[thread overview]
Message-ID: <178714383537.1.10181849825156474745.rpms-reuse-c9dc1845ba80@fedoraproject.org> (raw)

            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

                 reply	other threads:[~2026-08-19 12:50 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=178714383537.1.10181849825156474745.rpms-reuse-c9dc1845ba80@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