[Info-vax] Perl (for OpenSSL) v. me

Craig A. Berry craigberry at nospam.mac.com
Sun Feb 7 10:59:48 EST 2016


On 2/7/16 1:58 AM, Steven Schweda wrote:
>>     I'll give that a try (and report back).
>
>     Manually installing the Text::Template kit worked well enough.
>
>     The new OpenSSL configuration process failed pretty miserably,
> however.  Apparently, abs2rel() isn't doing anything useful on VMS.
> Below is a reduced script which shows some absolute paths and some
> relative paths derived from the absolute paths.  Compare the results on
> a handy Mac with the same thing on VMS:
>
> mba$ perl --version
>
> This is perl 5, version 18, subversion 2 (v5.18.2) built for
>   darwin-thread-multi-2level
> [...]
>
> alp $ perl --version
>
> This is perl 5, version 22, subversion 1 (v5.22.1) built for VMS_AXP
> [...]
>
> mba$ cat ../os.pl
> use strict;
> use File::Basename;
> use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs catpath splitpath/;
> use Cwd qw/:DEFAULT realpath/;
>
> my $srcdir = catdir(realpath(dirname($0)));
> my $blddir = catdir(realpath("."));
> my $dofile = abs2rel(catfile($srcdir, "util/dofile.pl"));
>
> my $srcdir_rel = abs2rel($srcdir);
> my $blddir_rel = abs2rel($blddir);
> my $dofile_rel = abs2rel($dofile);
>
> print "srcdir: $srcdir\n";
> print "blddir: $blddir\n";
> print "dofile: $dofile\n";
>
> print "srcdir_rel: $srcdir_rel\n";
> print "blddir_rel: $blddir_rel\n";
> print "dofile_rel: $dofile_rel\n";
> mba$
>
>     Results:
>
> mba$ perl ../os.pl
> srcdir: /Users/sms
> blddir: /Users/sms/itrc
> dofile: ../util/dofile.pl
> srcdir_rel: ..
> blddir_rel: .
> dofile_rel: ../util/dofile.pl
>
> alp $ perl ../os.pl             ! ("[-]os.pl" works the same.)
> srcdir: DISK$VMS083ALP:[SMS]
> blddir: DISK$VMS083ALP:[SMS.itrc]
> dofile: DISK$VMS083ALP:[SMS.util]dofile.pl
> srcdir_rel: DISK$VMS083ALP:[SMS]
> blddir_rel: DISK$VMS083ALP:[SMS.itrc]
> dofile_rel: DISK$VMS083ALP:[SMS.util]dofile.pl
>
>     The relative paths on the UNIX-like system look ok, but these
> not-very-relative-looking VMS paths get fiddled with further, and
> end up transformed into completely fictional stuff which thoroughly
> fouls the OpenSSL configuration stuff.  M. Levitte suggests that Perl
> 5.10.1 worked for someone on VMS.  I haven't tried anything older than
> 5.22.1, so I know nothing.  Knowing nothing, I can't say that the Perl
> code actually makes sense, but if abs2rel() is supposed to do more than
> nothing, then something's wrong here.

abs2rel works fine if you give a path to which your current working
directory is relative using the same flavor of the device name you would
see from SHOW DEFAULT:

$ show def
   D0:[CRAIG.TEST]
$ perl -"MFile::Spec::Functions=abs2rel" -e "print 
abs2rel('D0:[craig.test.util]dofile.pl');"
[.util]dofile.pl

The problem with os.pl is that realpath is returning a device name based
on the volume label (DVI$_LOGVOLNAM I believe it's called), but that's
not what your current working directory is using. You can get your
example to work correctly by setting your current working directory
using LOGVOLNAM:

$ set def DISK$I64SYS:[craig.test]
$ perl os.pl
srcdir: disk$i64sys:[craig.test]
blddir: DISK$I64SYS:[craig.TEST]
dofile: [.util]dofile.pl
srcdir_rel: []
blddir_rel: []
dofile_rel: [.util]dofile.pl

If there is a bug, it looks like it's in realpath:

$ perl -"MCwd=realpath" -e "print realpath('d0:[craig.test]');
disk$i64sys:[craig.test]

I will try to put that on my list of things to look at.




More information about the Info-vax mailing list