Bug 2126535

Summary: language.dat symlink replaced by post rpm scripts
Product: [Fedora] Fedora Reporter: Leon Fauster <leonfauster>
Component: texliveAssignee: Tom "spot" Callaway <spotrh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: caznaranl, spotrh, than
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-19 12:29:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leon Fauster 2022-09-13 18:37:57 UTC
Description of problem:

Discussion appeared here (EPEL):
https://bugzilla.redhat.com/show_bug.cgi?id=2074197#c16

Solved for EPEL (in preparation):
https://bugzilla.redhat.com/show_bug.cgi?id=2115134#c5

Therefore here the bug report to be corrected upstream.


TLDR Version:

This linkage

[1] /usr/share/texlive/texmf-dist/tex/generic/config/language.dat -> /etc/texlive/tex/generic/config/language.dat

will be broken when language texlive packages execute there scripts, example:

[2] sed -i '/esperanto.*/d' %{_texdir}/texmf-dist/tex/generic/config/language.dat

---

[1]https://src.fedoraproject.org/rpms/texlive/blob/main/f/texlive.spec#_154859
[2] https://src.fedoraproject.org/rpms/texlive/blob/main/f/texlive.spec#_79711


How reproducible:

The texlive package provides in the spec file following (texlive-hyphen-base):

pushd %{buildroot}%{_texdir}/texmf-dist/tex/generic/config/
ln -s ../../../../../../..%{_sysconfdir}/texlive/tex/generic/config/language.dat language.dat

and 

%config(noreplace) %{_sysconfdir}/texlive/tex/generic/config/language.dat

so every texlive-hyphen-${LANGUAGE} package with and sed script line will destroy the above linkage.


After installation of texlive-hyphen-german (post script with just "sed -i") the symlink is substituted and diff shows:

$ diff   /usr/share/texlive/texmf-dist/tex/generic/config/language.dat /etc/texlive/tex/generic/config/language.dat
59,61d58
< german loadhyph-de-1901.tex
< ngerman loadhyph-de-1996.tex
< swissgerman loadhyph-de-ch-1901.tex



Furthermore the config adaption coming from post scripts and landing in the /usr/share/texlive/ namespace (speak all adaption)
will be overwritten if someone for example do a yum reinstall texlive-hyphen-base because only the 
%{_sysconfdir}/texlive/tex/generic/config/language.dat is tagged has %config(noreplace).



Additional info:

A quick look into fedora shows round about 106 of such post scripts lines (so a general problem).

A solution could be the usage of "sed --follow-symlinks" or the usage of the path in the %{_sysconfdir} namespace

esperanto example:

sed --follow-symlinks -i '/esperanto.*/d' %{_texdir}/texmf-dist/tex/generic/config/language.dat
or
sed -i '/esperanto.*/d' %{_sysconfdir}/texlive/tex/generic/config/language.dat

Comment 1 Than Ngo 2022-09-19 12:29:19 UTC
it is fixed in texlive-2021-61.fc38. The fix for f37 will follow.

Thanks