SELFAUTOPARENT for redistributors

Norbert Preining norbert at preining.info
Fri May 29 08:05:15 CEST 2020


Hi Boris,

several of your scripts (not sure whether all of them are from you, but
it looks like, share the following code:
BEGIN {
    # find files relative to our installed location within TeX Live
    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
    if (length($TLMaster)) {
        unshift @INC, "$TLMaster/texmf-dist/scripts/bibtexperllibs";
    }
}
This is **really** bad because it breaks as soon as these scripts are
not used within TeX Live proper, in particular if the scripts are in
directories without the arch component.

You could do
BEGIN {
    # find files relative to our installed location within TeX Live
    chomp(my $TMDIST = `kpsewhich -var-value=TEXMFDIST`); # texmf-dist tree
    if (length($TMDIST)) {
        unshift @INC, "$TMDIST/scripts/bibtexperllibs";
    }
}
This would work both in TeX Live as well as for distributors.

Thanks for your consideration.

Norbert

> bbl2bib:    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
> biburl2doi:    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
> ltx2crossrefxml:     chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
> bibzbladd:    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
> bibdoiadd:    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
> bibmradd:    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root
> pedigree:    chomp(my $TLMaster = `kpsewhich -var-value=SELFAUTOPARENT`); # TL root

--
PREINING Norbert                              https://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13


More information about the tex-live mailing list.