[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Directory names hard-coded in Texinfo Perl scripts
From: |
Eli Zaretskii |
Subject: |
Re: Directory names hard-coded in Texinfo Perl scripts |
Date: |
Sun, 19 Dec 2021 14:39:22 +0200 |
> From: Gavin Smith <gavinsmith0123@gmail.com>
> Date: Sun, 19 Dec 2021 11:20:00 +0000
> Cc: Eli Zaretskii <eliz@gnu.org>, Texinfo <bug-texinfo@gnu.org>
>
> On Sun, Dec 19, 2021 at 10:56 AM Gavin Smith <gavinsmith0123@gmail.com> wrote:
> > I can try to make this work (it may be as simple as reinstating the
> > above lines) but can't promise anything as this is an extra
> > complication above what is normally done with installed programs.
>
> Done in commit c0c07af5f1. It appears to work ok with a quick test. I
> didn't look into if/how locale translation files would be found, but
> no error messages were printed regarding these. Please try the change
> and see if it works.
Thanks!
Nikolay, could you please apply the patch below both to bin/makeinfo
and to bin/texi2any, and see if that resolves the problem? (The patch
is to texi2any.pl, which is not a file that is installed, but the same
code fragments are present in the above 2 files which _are_ installed,
so you will need to apply the patch by hand, or force Patch to apply
it to those 2 specific files via command-line options.)
If you say this fixes the problem, I will upload a fixed distribution
to ezwinports.
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index fa7cc7a..bfec6f5 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -77,8 +77,19 @@ BEGIN
Texinfo::ModulePath::init(undef, undef, 'updirs' => 1);
} else {
# Look for modules in their installed locations.
-
my $lib_dir = File::Spec->catdir($datadir, $package);
+
+ # try to make package relocatable, will only work if
+ # standard relative paths are used
+ if (! -f File::Spec->catfile($lib_dir, 'Texinfo', 'Parser.pm')
+ and -f File::Spec->catfile($command_directory, $updir, 'share',
+ $package, 'Texinfo', 'Parser.pm')) {
+ $lib_dir = File::Spec->catdir($command_directory, $updir,
+ 'share', $package);
+ $packagedir = File::Spec->catdir($command_directory, $updir,
+ 'lib', $package);
+ }
+
unshift @INC, $lib_dir;
require Texinfo::ModulePath;
- Re: Directory names hard-coded in Texinfo Perl scripts, (continued)
- Re: Directory names hard-coded in Texinfo Perl scripts, Eli Zaretskii, 2021/12/17
- Re: Directory names hard-coded in Texinfo Perl scripts, Gavin Smith, 2021/12/18
- Re: Directory names hard-coded in Texinfo Perl scripts, Eli Zaretskii, 2021/12/18
- Re: Directory names hard-coded in Texinfo Perl scripts, Nikolay Kudryavtsev, 2021/12/19
- Re: Directory names hard-coded in Texinfo Perl scripts, Gavin Smith, 2021/12/19
- Re: Directory names hard-coded in Texinfo Perl scripts, Gavin Smith, 2021/12/19
- Re: Directory names hard-coded in Texinfo Perl scripts,
Eli Zaretskii <=
- Re: Directory names hard-coded in Texinfo Perl scripts, Nikolay Kudryavtsev, 2021/12/20
- Re: Directory names hard-coded in Texinfo Perl scripts, Nikolay Kudryavtsev, 2021/12/20
- Re: Directory names hard-coded in Texinfo Perl scripts, Eli Zaretskii, 2021/12/20
- Re: Directory names hard-coded in Texinfo Perl scripts, Nikolay Kudryavtsev, 2021/12/21
- Re: Directory names hard-coded in Texinfo Perl scripts, Eli Zaretskii, 2021/12/21
- Re: Directory names hard-coded in Texinfo Perl scripts, Patrice Dumas, 2021/12/21
- Re: Directory names hard-coded in Texinfo Perl scripts, Eli Zaretskii, 2021/12/21
- Re: Directory names hard-coded in Texinfo Perl scripts, Eli Zaretskii, 2021/12/19