commit:     ac62beddba2f03695f0d2a223c6f6463713b4e41
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 28 08:32:09 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Mon Apr 29 17:31:28 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac62bedd

texlive-common.eclass: add newline between tlpobj entries in tlpdb

We previously created the texlive.tlpdb by concatenating all tlpobj
files. This means that the entries will be right after another.

As it turns out, some TeX Live tools require a newline (e.g., tlmgr)
between the entries, while others do not (e.g., texdoc). And the
"official" tlpdb also has the entries separated by newlines. Therefore
this changes texlive-common_update_tlpdb() to also add them.

Thanks to ulm for showing how this can be done with sed.

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Thanks-to: Ulrich Müller <ulm <AT> gentoo.org>

 eclass/texlive-common.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass
index b32ea2af1121..15d475799a88 100644
--- a/eclass/texlive-common.eclass
+++ b/eclass/texlive-common.eclass
@@ -270,9 +270,11 @@ texlive-common_update_tlpdb() {
        touch "${new_tlpdb}" || die
 
        if [[ -d "${tlpobj}" ]]; then
+               # The "sed -s '$G' below concatenates all tlpobj files separated
+               # by a newline.
                find "${tlpobj}" -maxdepth 1 -type f -name "*.tlpobj" -print0 |
                        sort -z |
-                       xargs -0 --no-run-if-empty cat >> "${new_tlpdb}"
+                       xargs -0 --no-run-if-empty sed -s '$G' >> "${new_tlpdb}"
                assert "generating tlpdb failed"
        fi
 

Reply via email to