aports/community/texmf-dist/0003-tlmgr.patch
Marian Buschsieweke 5bd139926c community/texmf-dist: patch tlmgr.pl
Patch tlmgr to always use kpsewhich to locate the TeXLive root,
even if kpsewhich is not on in the same folder as kpsewhich. The baked
in assumption is that, unless in bootstrap mode, kpsewhich is always
located in the same folder.
2024-07-18 20:21:47 +00:00

40 lines
1.5 KiB
Diff

This patch drops the logic to detect if tlmgr is run in bootstrapping mode,
which assumes that tlmgr.pl is installed next to kpsewhich. However, we
(intentionally) hide it a bit so that users use apk to install texmf-dist
subpackages, rather than mixing distro provided and side-loaded packages.
--- a/texmf-dist/scripts/texlive/tlmgr.pl 2024-02-23 00:13:07.000000000 +0100
+++ b/texmf-dist/scripts/texlive/tlmgr.pl 2024-06-07 19:30:00.553109055 +0200
@@ -44,30 +44,7 @@ END {
BEGIN {
$^W = 1;
- # make subprograms (including kpsewhich) have the right path:
- my $kpsewhichname;
- if ($^O =~ /^MSWin/i) {
- # on w32 $0 and __FILE__ point directly to tlmgr.pl; they can be relative
- $Master = __FILE__;
- $Master =~ s!\\!/!g;
- $Master =~ s![^/]*$!../../..!
- unless ($Master =~ s!/texmf-dist/scripts/texlive/tlmgr\.pl$!!i);
- $bindir = "$Master/bin/windows";
- $kpsewhichname = "kpsewhich.exe";
- # path already set by wrapper batchfile
- } else {
- $Master = __FILE__;
- $Master =~ s,/*[^/]*$,,;
- $bindir = $Master;
- $Master = "$Master/../..";
- # make subprograms (including kpsewhich) have the right path:
- $ENV{"PATH"} = "$bindir:$ENV{PATH}";
- $kpsewhichname = "kpsewhich";
- }
- if (-r "$bindir/$kpsewhichname") {
- # not in bootstrapping mode => kpsewhich exists, so use it to get $Master
- chomp($Master = `kpsewhich -var-value=TEXMFROOT`);
- }
+ chomp($Master = `kpsewhich -var-value=TEXMFROOT`);
# if we have no directory in which to find our modules,
# no point in going on.