|
|
|
|
|
|
| Author |
Message |
Craig A. Berry *nix forums Guru Wannabe
Joined: 27 May 2005
Posts: 143
|
Posted: Thu Jul 20, 2006 11:29 pm Post subject:
RE: Installing Net::SSH2 on OpenVMS
|
|
|
At 2:40 PM -0400 7/20/06, Boyd, Robert L wrote:
| Quote: | Craig,
Thanks for the suggestion - I downloaded VMS::SYSTEM and tried to build
it but it fails to compile with the following errors. It looks like the
last time this kit was worked on was back in the late 90's. Any
suggestions about how to get it to compile?
Robert
$Perl makefile.pl
$mmk
CC/DECC
/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/List/Machine/Show=
Expan /NOANSI_ALIAS/float=ieee/ieee=denorm_results/D
efine=("VERSION=""1.04""","XS_VERSION=""1.04""")/Include=(perl_root:[lib
.VMS_AXP.5_8_6.CORE])/List/Machine/Show=Expan SYSTEM.c + SY
S$LIBRARY:SYS$LIB_C/LIBRARY
return(&sv_undef);
..........^
%CC-E-UNDECLARED, In this statement, "sv_undef" is not declared.
at line number 1042 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
|
The module is in need of some updating to comply with current Perl
requirements, but in the meantime you just might get it working on
your system by running the Makefile.PL like so:
$ perl Makefile.PL "POLLUTE=1"
--
________________________________________
Craig A. Berry
mailto:craigberry@mac.com
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser |
|
| Back to top |
|
 |
Robert L Boyd *nix forums beginner
Joined: 17 Jul 2006
Posts: 5
|
Posted: Thu Jul 20, 2006 6:40 pm Post subject:
RE: Installing Net::SSH2 on OpenVMS
|
|
|
Craig,
Thanks for the suggestion - I downloaded VMS::SYSTEM and tried to build
it but it fails to compile with the following errors. It looks like the
last time this kit was worked on was back in the late 90's. Any
suggestions about how to get it to compile?
Robert
$Perl makefile.pl
$mmk
CC/DECC
/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/List/Machine/ShowExpan /NOANSI_ALIAS/float=ieee/ieee=denorm_results/D
efine=("VERSION=""1.04""","XS_VERSION=""1.04""")/Include=(perl_root:[lib
..VMS_AXP.5_8_6.CORE])/List/Machine/Show=Expan SYSTEM.c + SY
S$LIBRARY:SYS$LIB_C/LIBRARY
return(&sv_undef);
...........^
%CC-E-UNDECLARED, In this statement, "sv_undef" is not declared.
at line number 1042 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
if (strEQ(SysInfoList[i].SysInfoName, SvPV(infoname, na))) {
.........^
%CC-E-UNDECLARED, In this statement, "na" is not declared.
at line number 1204 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
ST(0) = &sv_undef;
..............^
%CC-E-UNDECLARED, In this statement, "sv_undef" is not declared.
at line number 1212 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
ST(0) = &sv_undef;
................^
%CC-E-UNDECLARED, In this statement, "sv_undef" is not declared.
at line number 1217 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
ST(0) = &sv_undef;
..................^
%CC-E-UNDECLARED, In this statement, "sv_undef" is not declared.
at line number 1289 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
ST(0) = &sv_yes;
......................^
%CC-E-UNDECLARED, In this statement, "sv_yes" is not declared.
at line number 1330 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
ST(0) = &sv_no;
......................^
%CC-E-UNDECLARED, In this statement, "sv_no" is not declared.
at line number 1332 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
ST(0) = &sv_undef;
....................^
%CC-E-UNDECLARED, In this statement, "sv_undef" is not declared.
at line number 1335 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
ST(0) = &sv_undef;
..................^
%CC-E-UNDECLARED, In this statement, "sv_undef" is not declared.
at line number 1340 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
strlen(OurDataList[i].ItemName), &sv_yes, 0);
......................................................^
%CC-E-UNDECLARED, In this statement, "sv_yes" is not declared.
at line number 1502 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
strlen(OurDataList[i].ItemName), &sv_no, 0);
......................................................^
%CC-E-UNDECLARED, In this statement, "sv_no" is not declared.
at line number 1505 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
ST(0) = &sv_undef;
..............^
%CC-E-UNDECLARED, In this statement, "sv_undef" is not declared.
at line number 1520 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
bit_test(AllPurposeHV, PRC$M_TCB, "TCB", BitmapValue);
.....^
%CC-E-UNDECLARED, In this statement, "sv_yes" is not declared.
at line number 1548 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
bit_test(AllPurposeHV, PRC$M_TCB, "TCB", BitmapValue);
.....^
%CC-E-UNDECLARED, In this statement, "sv_no" is not declared.
at line number 1548 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
ST(0) = &sv_undef;
..............^
%CC-E-UNDECLARED, In this statement, "sv_undef" is not declared.
at line number 1574 in file
SYS$SYSDEVICE:[SOFTWARE.LIB.VMS.SYSTEM]system.xs;1
%MMK-F-ERRUPD, error status %X10B91262 occurred when updating target
SYSTEM.OBJ
-----Original Message-----
From: "Craig A. Berry" <craigberry@mac.com>@DUKEPOWER
Sent: Wednesday, July 19, 2006 11:52 PM
To: Boyd, Robert L
Cc: vmsperl@perl.org
Subject: RE: Installing Net::SSH2 on OpenVMS
Robert,
I see that you are all over the net today with essentially the same
question on comp.os.vms and the ITRC forum. It appears that you have
found out the same thing that was my understanding, which is that to
get the name of your Alpha architecture, you pretty much have to roll
your own number to name translation, i.e.,
$ write sys$output f$getsyi("cputype")
8
is not immediately obvious, without reading the include files, that
this is an EV67 system. In principle, the VMS::System Perl extension
could retrieve this just as well as DCL can, though I haven't used
that recently.
Let us know if you get SSH2 running and if there are any necessary
changes to the extension.
At 1:46 PM -0400 7/19/06, Boyd, Robert L wrote:
| Quote: | I'm trying to do the build of SSH2 and running into a problem. It's
looking for a c include file gmp.h. My research so far leads me to
believe this is part of the GMP kit. I'm attempting to build GMP under
the GNV environment and running into trouble with the configure script.
Config.guess is blowing up while attempting to sort out exactly which
model of Alpha I'm running on. The code looks as if it's never really
been tested on VMS. There's pieces that look like they're VMS aware,
but the part that gets down to distinguishing EV4/EV5/EV56... is not
fleshed out.
Do any of you out there have any experience with this kind of thing?
Or do you know another way for me to get gmp.h? Or is there another
way to do what I want?
Have any of you built the SSH2 kit on Alpha?
Thanks for any leads/hints/solutions!
Robert Boyd
|
--
________________________________________
Craig A. Berry
mailto:craigberry@mac.com
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser |
|
| Back to top |
|
 |
Craig A. Berry *nix forums Guru Wannabe
Joined: 27 May 2005
Posts: 143
|
Posted: Thu Jul 20, 2006 3:51 am Post subject:
RE: Installing Net::SSH2 on OpenVMS
|
|
|
Robert,
I see that you are all over the net today with essentially the same
question on comp.os.vms and the ITRC forum. It appears that you have
found out the same thing that was my understanding, which is that to
get the name of your Alpha architecture, you pretty much have to roll
your own number to name translation, i.e.,
$ write sys$output f$getsyi("cputype")
8
is not immediately obvious, without reading the include files, that
this is an EV67 system. In principle, the VMS::System Perl extension
could retrieve this just as well as DCL can, though I haven't used
that recently.
Let us know if you get SSH2 running and if there are any necessary
changes to the extension.
At 1:46 PM -0400 7/19/06, Boyd, Robert L wrote:
| Quote: | I'm trying to do the build of SSH2 and running into a problem. It's
looking for a c include file gmp.h. My research so far leads me to
believe this is part of the GMP kit. I'm attempting to build GMP under
the GNV environment and running into trouble with the configure script.
Config.guess is blowing up while attempting to sort out exactly which
model of Alpha I'm running on. The code looks as if it's never really
been tested on VMS. There's pieces that look like they're VMS aware,
but the part that gets down to distinguishing EV4/EV5/EV56... is not
fleshed out.
Do any of you out there have any experience with this kind of thing?
Or do you know another way for me to get gmp.h? Or is there another
way to do what I want?
Have any of you built the SSH2 kit on Alpha?
Thanks for any leads/hints/solutions!
Robert Boyd
|
--
________________________________________
Craig A. Berry
mailto:craigberry@mac.com
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser |
|
| Back to top |
|
 |
Robert L Boyd *nix forums beginner
Joined: 17 Jul 2006
Posts: 5
|
Posted: Wed Jul 19, 2006 5:46 pm Post subject:
RE: Installing Net::SSH2 on OpenVMS
|
|
|
I'm trying to do the build of SSH2 and running into a problem. It's
looking for a c include file gmp.h. My research so far leads me to
believe this is part of the GMP kit. I'm attempting to build GMP under
the GNV environment and running into trouble with the configure script.
Config.guess is blowing up while attempting to sort out exactly which
model of Alpha I'm running on. The code looks as if it's never really
been tested on VMS. There's pieces that look like they're VMS aware,
but the part that gets down to distinguishing EV4/EV5/EV56... is not
fleshed out.
Do any of you out there have any experience with this kind of thing?
Or do you know another way for me to get gmp.h? Or is there another
way to do what I want?
Have any of you built the SSH2 kit on Alpha?
Thanks for any leads/hints/solutions!
Robert Boyd |
|
| Back to top |
|
 |
Craig A. Berry *nix forums Guru Wannabe
Joined: 27 May 2005
Posts: 143
|
Posted: Tue Apr 04, 2006 3:25 am Post subject:
Re: [patch@27538] utime patch for VMS
|
|
|
At 5:34 PM -0400 4/2/06, John E. Malmberg wrote:
| Quote: | Craig A. Berry wrote:
At 12:43 PM -0400 4/2/06, John E. Malmberg wrote:
|
| Quote: | The ACP interface that is used for the work around to not having a
built in utime() can not handle EFS file specifications. It needs to
have the on-disk file specification.
But won't do_rmsexpand() take care of that?
Yes, but then you do not pick up setting the DECC$EFS_FILE_TIMESTAMPS values. Using the CRTL utime() picks up both.
|
I've committed #27706, which uses the CRTL utime() for 7.3 and later,
but the existing ACP interface code for anything previous. The
presence of utime.h does not help, as it became available before the
utime() function did. It looks to me like the CRTL utime() does the
same thing the old code does on ODS-2 or ODS-5 without access dates.
On ODS-5 with access dates enabled, we'll get the same behavior any
other C program calling utime() will get. I think we may want to
enable DECC$EFS_FILE_TIMESTAMPS by default in Perl, though that
remains to be tested and checked for consistency with our stat()
implementation.
--
________________________________________
Craig A. Berry
mailto:craigberry@mac.com
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser |
|
| Back to top |
|
 |
John E. Malmberg *nix forums Guru Wannabe
Joined: 30 May 2005
Posts: 264
|
Posted: Sun Apr 02, 2006 9:34 pm Post subject:
Re: [patch@27538] utime patch for VMS
|
|
|
Craig A. Berry wrote:
| Quote: | At 12:43 PM -0400 4/2/06, John E. Malmberg wrote:
Craig A. Berry wrote:
I finally got around to testing this, and there are a few problems with it.
2.) The code as written does not handle a null second argument to
utime() and accvios if it gets one. Null is valid (and quite common
because it means "use the current time") and needs to be handled.
I missed that. Apparently while common, it is not tested in the Perl self tests.
It is tested in [.t.io]fs.t. But since we were never using the new
code unless DECC$EFS_CHARSET was defined, I hadn't seen the
failure.
|
I missed that, at this point I have been mainly testing to make sure I
did not break the default behavior.
| Quote: |
3.) I can't think of any relationship between DECC$EFS_CHARSET and
utime. Perhaps this was supposed to be DECC$EFS_FILE_TIMESTAMPS ?
Even here, though, I don't think we need to do anything differently
because the CRTL utime() is going to do its own feature checking.
The ACP interface that is used for the work around to not having a
built in utime() can not handle EFS file specifications. It needs to
have the on-disk file specification.
But won't do_rmsexpand() take care of that?
|
Yes, but then you do not pick up setting the DECC$EFS_FILE_TIMESTAMPS
values. Using the CRTL utime() picks up both.
I am currently testing a merge the ODS-2 RMSEXPAND with the 0DS-5
version through macros.
-John
wb8tyw@qsl.net
Personal Opinion Only |
|
| Back to top |
|
 |
Craig A. Berry *nix forums Guru Wannabe
Joined: 27 May 2005
Posts: 143
|
Posted: Sun Apr 02, 2006 8:27 pm Post subject:
Re: [patch@27538] utime patch for VMS
|
|
|
At 12:43 PM -0400 4/2/06, John E. Malmberg wrote:
| Quote: | Craig A. Berry wrote:
I finally got around to testing this, and there are a few problems with it.
1.) We can no longer compile on pre-7.3 systems because the call to
the CRTL utime() is done regardless of CRTL version. We need to make
sure that on pre-7.3 systems we use the old home-grown code that
fiddles with the FIB.
I meant to use the HAVE_UTIME_H macro conditionally compile this in.
|
Yeah, that makes sense, so it will track with what's in vmsish.h.
| Quote: |
2.) The code as written does not handle a null second argument to
utime() and accvios if it gets one. Null is valid (and quite common
because it means "use the current time") and needs to be handled.
I missed that. Apparently while common, it is not tested in the Perl self tests.
|
It is tested in [.t.io]fs.t. But since we were never using the new
code unless DECC$EFS_CHARSET was defined, I hadn't seen the
failure.
| Quote: |
3.) I can't think of any relationship between DECC$EFS_CHARSET and
utime. Perhaps this was supposed to be DECC$EFS_FILE_TIMESTAMPS ?
Even here, though, I don't think we need to do anything differently
because the CRTL utime() is going to do its own feature checking.
The ACP interface that is used for the work around to not having a built in utime() can not handle EFS file specifications. It needs to have the on-disk file specification.
|
But won't do_rmsexpand() take care of that?
| Quote: |
I've attached my working patch, but I'm also not sure if we are doing
the UTC translation in the right direction, so I need to study that a
bit more.
The utime() call always expects it's parameters to be in UTC, so when the pragma is set to use local time, the local time needs to be converted to UTC.
|
That sounds right. I don't think we test this aspect of utime() in
the test suite, but we probably should.
--
________________________________________
Craig A. Berry
mailto:craigberry@mac.com
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser |
|
| Back to top |
|
 |
John E. Malmberg *nix forums Guru Wannabe
Joined: 30 May 2005
Posts: 264
|
Posted: Sun Apr 02, 2006 4:43 pm Post subject:
Re: [patch@27538] utime patch for VMS
|
|
|
Craig A. Berry wrote:
| Quote: |
I finally got around to testing this, and there are a few problems with it.
1.) We can no longer compile on pre-7.3 systems because the call to
the CRTL utime() is done regardless of CRTL version. We need to make
sure that on pre-7.3 systems we use the old home-grown code that
fiddles with the FIB.
|
I meant to use the HAVE_UTIME_H macro conditionally compile this in.
| Quote: | 2.) The code as written does not handle a null second argument to
utime() and accvios if it gets one. Null is valid (and quite common
because it means "use the current time") and needs to be handled.
|
I missed that. Apparently while common, it is not tested in the Perl
self tests.
| Quote: | 3.) I can't think of any relationship between DECC$EFS_CHARSET and
utime. Perhaps this was supposed to be DECC$EFS_FILE_TIMESTAMPS ?
Even here, though, I don't think we need to do anything differently
because the CRTL utime() is going to do its own feature checking.
|
The ACP interface that is used for the work around to not having a built
in utime() can not handle EFS file specifications. It needs to have the
on-disk file specification.
| Quote: | I've attached my working patch, but I'm also not sure if we are doing
the UTC translation in the right direction, so I need to study that a
bit more.
|
The utime() call always expects it's parameters to be in UTC, so when
the pragma is set to use local time, the local time needs to be
converted to UTC.
-John
wb8tyw@qsl.net
Personal Opinion Only |
|
| Back to top |
|
 |
John E. Malmberg *nix forums Guru Wannabe
Joined: 30 May 2005
Posts: 264
|
Posted: Thu Mar 16, 2006 1:29 am Post subject:
Re: Blead 26919 on OpenVMS - op/stat.t failures
|
|
|
Craig A. Berry wrote:
| Quote: | At 9:47 PM -0500 1/26/06, John E. Malmberg wrote:
John E. Malmberg wrote:
I just got a reproduced crash with an instrumented vms.c.
The access violation is occurring inside the stat() call in the CRTL. According to the debugger, nothing is wrong with the arguments to function, and I am referring this over to HP.
Thanks for pursuing this. There is a very recent patch that fixes
some cases where Perl variables were not getting null terminated:
|
The preliminary report that I have is that what is happening is that it
appears something prior to the stat() call is writing over the heap by
just enough to corrupt the memory pool. What specifically is not
readily apparent.
Like something overwriting by just one byte. Over allocating the memory
by a longword that is longword aligned hides the problem.
So the hunt is on to first make sure that everything is being allocated
correctly and then to see if anything is writing past where it is
supposed to.
-John
wb8tyw@qsl.net
Personal Opinion Only |
|
| Back to top |
|
 |
Yitzchak Scott-Thoennes *nix forums beginner
Joined: 19 Feb 2006
Posts: 2
|
Posted: Mon Feb 20, 2006 6:10 am Post subject:
Re: [Module::Build] Re: Module::Build status on VMS
|
|
|
On Sun, Feb 19, 2006 at 11:20:23AM -0800, Yitzchak Scott-Thoennes wrote:
| Quote: | Has anyone familiar with DistGen looked at what Craig is doing?
Can anyone offer any assistance?
More comments inline.
On Sun, Feb 05, 2006 at 06:10:58PM -0600, Craig A. Berry wrote:
At 3:39 PM -0800 2/5/06, Yitzchak Scott-Thoennes wrote:
Any progress on this front? Given that this is just for purposes of
running tests, maybe here the hash keys should always be lowercased?
The previous patch to add Module::Build no longer applies cleanly;
http://zipcon.net/~sthoenna/mbaddfull270701.patch
is updated to match bleadperl and what's currently in cvs for MB.
I'll try to look at that again soon -- too many projects in progress
at once. I did some hacking with Tie:CPHash from CPAN and got a bit
farther. A still not fully working diff of DistGen.pm is at the end
of this message. I'm now getting, for example:
$ perl -"I[-.lib]" [-.lib.module.build.t]tilde.t
1..11
Warning: Removing existing directory 'D0:[CRAIG.perl.t._tmp.Simple]'
Changed file 't/basic.t'.
Changed file 'lib/Simple.pm'.
Changed file 'Build.PL'.
Splitting '[]'
Setting directory name '[]' in %names
Splitting '[.t]'
Setting directory name '[.t]' in %names
Setting directory name '[.t]' in %names
Splitting '[.lib]'
Setting directory name '[.lib]' in %names
Setting directory name '[.lib]' in %names
Splitting '[]'
Setting directory name '[]' in %names
Removing 'lib'
Removing 't'
Can't call method "install_base" on an undefined value at [-.lib.module.build.t]tilde.t line 44.
# No tests run!
I think the next hurdle is that File::Find is returning directory
names with no attached distinguishing punctuation (C<lib> or C<t>)
but the names that we've cached do have that punctuation (C<[.lib]
or C<[.t]>). File::Spec->canonpath does not normalize that:
$ perl -"MFile::Spec" -e "print File::Spec->canonpath('[.lib]');"
[.lib]
$ perl -"MFile::Spec" -e "print File::Spec->canonpath('lib');"
lib
So on VMS we'll have to get more aggressive about caching directory
names in the same form that we'll be looking them up. Otherwise we
don't recognize directories that we want to keep and we end up
deleting before they are even used.
--- DistGen.pm;2 Thu Jan 26 18:48:29 2006
+++ DistGen.pm Sun Jan 29 15:58:55 2006
@@ -5,7 +5,7 @@
use vars qw( $VERSION $VERBOSE );
$VERSION = '0.01';
-$VERBOSE = 0;
+$VERBOSE = 1;
use Cwd ();
@@ -14,6 +14,7 @@
use File::Path ();
use File::Spec ();
use IO::File ();
+use Tie::CPHash;
sub new {
my $package = shift;
@@ -29,6 +30,10 @@
);
my $self = bless( \%data, $package );
+ tie %{$self->{filedata}}, 'Tie::CPHash';
+
+ tie %{$self->{pending}{change}}, 'Tie::CPHash';
+
if ( -d $self->dirname ) {
warn "Warning: Removing existing directory '@{[$self->dirname]}'\n";
$self->remove;
@@ -280,6 +285,7 @@
}
my %names;
+ tie %names, 'Tie::CPHash';
foreach my $file ( keys %{$self->{filedata}} ) {
my $filename = $self->_real_filename( $file );
my ($vol, $dirname, $f) = File::Spec->splitpath( $filename );
@@ -288,10 +294,16 @@
$names{$filename} = 0;
+ print "Splitting '$dirname'\n" if $VERBOSE;
my @dirs = File::Spec->splitdir( $dirname );
while ( @dirs ) {
- my $dir = File::Spec->catdir( @dirs );
- $names{$dir} = 0;
+ my $dir = ( scalar(@dirs) == 1
+ ? $dirname
+ : File::Spec->catdir( @dirs ) );
+ if (length $dir) {
+ print "Setting directory name '$dir' in \%names\n" if $VERBOSE;
+ $names{$dir} = 0;
+ }
pop( @dirs );
}
}
@@ -299,11 +311,13 @@
File::Find::finddepth( sub {
my $name = File::Spec->canonpath( $File::Find::name );
+ $name =~ s/\.\z// if $^O eq 'VMS';
+
if ( not exists $names{$name} ) {
Wild stab in the dark:
if (! ( exists $names{$name} ||
$^O eq 'VMS' && -d $name && exists $names{"[.$name]"} ) ) {
It doesn't have to be pretty, it just has to work.
print "Removing '$name'\n" if $VERBOSE;
File::Path::rmtree( $_ );
}
- }, File::Spec->curdir );
+ }, './' );
Why not curdir?
chdir( $here );
}
|
In case it helps move things further along, here's Craig's stuff as a
patch to CVS, with Tie::CPHash added. Passes all tests using cygwin
and windows ActivePerl 5.8.7. I don't see any reason not to apply it.
(I made the last change be for VMS only.)
diff -ruN Module-Build-0.27_0702-orig/MANIFEST Module-Build-0.27_0702/MANIFEST
--- Module-Build-0.27_0702-orig/MANIFEST 2006-02-19 21:11:45.000000000 +0000
+++ Module-Build-0.27_0702/MANIFEST 2006-02-19 21:34:24.921875000 +0000
@@ -33,6 +33,7 @@
t/bundled/Test/Builder.pm
t/bundled/Test/More.pm
t/bundled/Test/Simple.pm
+t/bundled/Tie/CPHash.pm
t/compat.t
t/destinations.t
t/ext.t
diff -ruN Module-Build-0.27_0702-orig/t/bundled/Tie/CPHash.pm Module-Build-0.27_0702/t/bundled/Tie/CPHash.pm
--- Module-Build-0.27_0702-orig/t/bundled/Tie/CPHash.pm 1970-01-01 00:00:00.000000000 +0000
+++ Module-Build-0.27_0702/t/bundled/Tie/CPHash.pm 2006-02-19 21:33:50.562500000 +0000
@@ -0,0 +1,189 @@
+#---------------------------------------------------------------------
+package Tie::CPHash;
+#
+# Copyright 1997 Christopher J. Madsen
+#
+# Author: Christopher J. Madsen <chris_madsen@geocities.com>
+# Created: 08 Nov 1997
+# Version: 1.001 (25-Oct-1998)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the same terms as Perl itself.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
+# GNU General Public License or the Artistic License for more details.
+#
+# Case preserving but case insensitive hash
+#---------------------------------------------------------------------
+
+require 5.000;
+use strict;
+use vars qw(@ISA $VERSION);
+
+@ISA = qw();
+
+#=====================================================================
+# Package Global Variables:
+
+BEGIN
+{
+ # Convert RCS revision number to d.ddd format:
+ $VERSION = sprintf('%d.%03d', '1.001 ' =~ /(\d+)\.(\d+)/);
+} # end BEGIN
+
+#=====================================================================
+# Tied Methods:
+#---------------------------------------------------------------------
+# TIEHASH classname
+# The method invoked by the command `tie %hash, classname'.
+# Associates a new hash instance with the specified class.
+
+sub TIEHASH
+{
+ bless {}, $_[0];
+} # end TIEHASH
+
+#---------------------------------------------------------------------
+# STORE this, key, value
+# Store datum *value* into *key* for the tied hash *this*.
+
+sub STORE
+{
+ $_[0]->{lc $_[1]} = [ $_[1], $_[2] ];
+} # end STORE
+
+#---------------------------------------------------------------------
+# FETCH this, key
+# Retrieve the datum in *key* for the tied hash *this*.
+
+sub FETCH
+{
+ my $v = $_[0]->{lc $_[1]};
+ ($v ? $v->[1] : undef);
+} # end FETCH
+
+#---------------------------------------------------------------------
+# FIRSTKEY this
+# Return the (key, value) pair for the first key in the hash.
+
+sub FIRSTKEY
+{
+ my $a = scalar keys %{$_[0]};
+ &NEXTKEY;
+} # end FIRSTKEY
+
+#---------------------------------------------------------------------
+# NEXTKEY this, lastkey
+# Return the next (key, value) pair for the hash.
+
+sub NEXTKEY
+{
+ my $v = (each %{$_[0]})[1];
+ ($v ? $v->[0] : undef );
+} # end NEXTKEY
+
+#---------------------------------------------------------------------
+# EXISTS this, key
+# Verify that *key* exists with the tied hash *this*.
+
+sub EXISTS
+{
+ exists $_[0]->{lc $_[1]};
+} # end EXISTS
+
+#---------------------------------------------------------------------
+# DELETE this, key
+# Delete the key *key* from the tied hash *this*.
+# Returns the old value, or undef if it didn't exist.
+
+sub DELETE
+{
+ my $v = delete $_[0]->{lc $_[1]};
+ ($v ? $v->[1] : undef);
+} # end DELETE
+
+#---------------------------------------------------------------------
+# CLEAR this
+# Clear all values from the tied hash *this*.
+
+sub CLEAR
+{
+ %{$_[0]} = ();
+} # end CLEAR
+
+#=====================================================================
+# Other Methods:
+#---------------------------------------------------------------------
+# Return the case of KEY.
+
+sub key
+{
+ my $v = $_[0]->{lc $_[1]};
+ ($v ? $v->[0] : undef);
+}
+
+#=====================================================================
+# Package Return Value:
+
+1;
+
+__END__
+
+=head1 NAME
+
+Tie::CPHash - Case preserving but case insensitive hash table
+
+=head1 SYNOPSIS
+
+ require Tie::CPHash;
+ tie %cphash, 'Tie::CPHash';
+
+ $cphash{'Hello World'} = 'Hi there!';
+ printf("The key `%s' was used to store `%s'.\n",
+ tied(%cphash)->key('HELLO WORLD'),
+ $cphash{'HELLO world'});
+
+=head1 DESCRIPTION
+
+The B<Tie::CPHash> provides a hash table that is case preserving but
+case insensitive. This means that
+
+ $cphash{KEY} $cphash{key}
+ $cphash{Key} $cphash{keY}
+
+all refer to the same entry. Also, the hash remembers which form of
+the key was last used to store the entry. The C<keys> and C<each>
+functions will return the key that was used to set the value.
+
+An example should make this clear:
+
+ tie %h, 'Tie::CPHash';
+ $h{Hello} = 'World';
+ print $h{HELLO}; # Prints 'World'
+ print keys(%h); # Prints 'Hello'
+ $h{HELLO} = 'WORLD';
+ print $h{hello}; # Prints 'WORLD'
+ print keys(%h); # Prints 'HELLO'
+
+The additional C<key> method lets you fetch the case of a specific key:
+
+ # When run after the previous example, this prints 'HELLO':
+ print tied(%h)->key('Hello');
+
+(The C<tied> function returns the object that C<%h> is tied to.)
+
+If you need a case insensitive hash, but don't need to preserve case,
+just use C<$hash{lc $key}> instead of C<$hash{$key}>. This has a lot
+less overhead than B<Tie::CPHash>.
+
+=head1 AUTHOR
+
+Christopher J. Madsen E<lt>F<chris_madsen@geocities.com>E<gt>
+
+=cut
+
+# Local Variables:
+# tmtrack-file-task: "Tie::CPHash.pm"
+# End:
diff -ruN Module-Build-0.27_0702-orig/t/lib/DistGen.pm Module-Build-0.27_0702/t/lib/DistGen.pm
--- Module-Build-0.27_0702-orig/t/lib/DistGen.pm 2006-02-19 21:11:45.000000000 +0000
+++ Module-Build-0.27_0702/t/lib/DistGen.pm 2006-02-20 05:29:32.093750000 +0000
@@ -14,6 +14,7 @@
use File::Path ();
use File::Spec ();
use IO::File ();
+use Tie::CPHash;
sub new {
my $package = shift;
@@ -29,6 +30,10 @@
);
my $self = bless( \%data, $package );
+ tie %{$self->{filedata}}, 'Tie::CPHash';
+
+ tie %{$self->{pending}{change}}, 'Tie::CPHash';
+
if ( -d $self->dirname ) {
warn "Warning: Removing existing directory '@{[$self->dirname]}'\n";
$self->remove;
@@ -280,16 +285,23 @@
}
my %names;
+ tie %names, 'Tie::CPHash';
foreach my $file ( keys %{$self->{filedata}} ) {
my $filename = $self->_real_filename( $file );
my $dirname = File::Basename::dirname( $filename );
$names{$filename} = 0;
+ print "Splitting '$dirname'\n" if $VERBOSE;
my @dirs = File::Spec->splitdir( $dirname );
while ( @dirs ) {
- my $dir = File::Spec->catdir( @dirs );
- $names{$dir} = 0;
+ my $dir = ( scalar(@dirs) == 1
+ ? $dirname
+ : File::Spec->catdir( @dirs ) );
+ if (length $dir) {
+ print "Setting directory name '$dir' in \%names\n" if $VERBOSE;
+ $names{$dir} = 0;
+ }
pop( @dirs );
}
}
@@ -297,11 +309,13 @@
File::Find::finddepth( sub {
my $name = File::Spec->canonpath( $File::Find::name );
+ $name =~ s/\.\z// if $^O eq 'VMS';
+
if ( not exists $names{$name} ) {
print "Removing '$name'\n" if $VERBOSE;
File::Path::rmtree( $_ );
}
- }, File::Spec->curdir );
+ }, ($^O eq "VMS" ? './' : File::Spec->curdir) );
chdir( $here );
} |
|
| Back to top |
|
 |
Yitzchak Scott-Thoennes *nix forums beginner
Joined: 19 Feb 2006
Posts: 2
|
Posted: Sun Feb 19, 2006 7:20 pm Post subject:
Re: [Module::Build] Re: Module::Build status on VMS
|
|
|
Has anyone familiar with DistGen looked at what Craig is doing?
Can anyone offer any assistance?
More comments inline.
On Sun, Feb 05, 2006 at 06:10:58PM -0600, Craig A. Berry wrote:
| Quote: | At 3:39 PM -0800 2/5/06, Yitzchak Scott-Thoennes wrote:
Any progress on this front? Given that this is just for purposes of
running tests, maybe here the hash keys should always be lowercased?
The previous patch to add Module::Build no longer applies cleanly;
http://zipcon.net/~sthoenna/mbaddfull270701.patch
is updated to match bleadperl and what's currently in cvs for MB.
I'll try to look at that again soon -- too many projects in progress
at once. I did some hacking with Tie:CPHash from CPAN and got a bit
farther. A still not fully working diff of DistGen.pm is at the end
of this message. I'm now getting, for example:
$ perl -"I[-.lib]" [-.lib.module.build.t]tilde.t
1..11
Warning: Removing existing directory 'D0:[CRAIG.perl.t._tmp.Simple]'
Changed file 't/basic.t'.
Changed file 'lib/Simple.pm'.
Changed file 'Build.PL'.
Splitting '[]'
Setting directory name '[]' in %names
Splitting '[.t]'
Setting directory name '[.t]' in %names
Setting directory name '[.t]' in %names
Splitting '[.lib]'
Setting directory name '[.lib]' in %names
Setting directory name '[.lib]' in %names
Splitting '[]'
Setting directory name '[]' in %names
Removing 'lib'
Removing 't'
Can't call method "install_base" on an undefined value at [-.lib.module.build.t]tilde.t line 44.
# No tests run!
I think the next hurdle is that File::Find is returning directory
names with no attached distinguishing punctuation (C<lib> or C<t>)
but the names that we've cached do have that punctuation (C<[.lib]
or C<[.t]>). File::Spec->canonpath does not normalize that:
$ perl -"MFile::Spec" -e "print File::Spec->canonpath('[.lib]');"
[.lib]
$ perl -"MFile::Spec" -e "print File::Spec->canonpath('lib');"
lib
So on VMS we'll have to get more aggressive about caching directory
names in the same form that we'll be looking them up. Otherwise we
don't recognize directories that we want to keep and we end up
deleting before they are even used.
--- DistGen.pm;2 Thu Jan 26 18:48:29 2006
+++ DistGen.pm Sun Jan 29 15:58:55 2006
@@ -5,7 +5,7 @@
use vars qw( $VERSION $VERBOSE );
$VERSION = '0.01';
-$VERBOSE = 0;
+$VERBOSE = 1;
use Cwd ();
@@ -14,6 +14,7 @@
use File::Path ();
use File::Spec ();
use IO::File ();
+use Tie::CPHash;
sub new {
my $package = shift;
@@ -29,6 +30,10 @@
);
my $self = bless( \%data, $package );
+ tie %{$self->{filedata}}, 'Tie::CPHash';
+
+ tie %{$self->{pending}{change}}, 'Tie::CPHash';
+
if ( -d $self->dirname ) {
warn "Warning: Removing existing directory '@{[$self->dirname]}'\n";
$self->remove;
@@ -280,6 +285,7 @@
}
my %names;
+ tie %names, 'Tie::CPHash';
foreach my $file ( keys %{$self->{filedata}} ) {
my $filename = $self->_real_filename( $file );
my ($vol, $dirname, $f) = File::Spec->splitpath( $filename );
@@ -288,10 +294,16 @@
$names{$filename} = 0;
+ print "Splitting '$dirname'\n" if $VERBOSE;
my @dirs = File::Spec->splitdir( $dirname );
while ( @dirs ) {
- my $dir = File::Spec->catdir( @dirs );
- $names{$dir} = 0;
+ my $dir = ( scalar(@dirs) == 1
+ ? $dirname
+ : File::Spec->catdir( @dirs ) );
+ if (length $dir) {
+ print "Setting directory name '$dir' in \%names\n" if $VERBOSE;
+ $names{$dir} = 0;
+ }
pop( @dirs );
}
}
@@ -299,11 +311,13 @@
File::Find::finddepth( sub {
my $name = File::Spec->canonpath( $File::Find::name );
+ $name =~ s/\.\z// if $^O eq 'VMS';
+
if ( not exists $names{$name} ) {
|
Wild stab in the dark:
if (! ( exists $names{$name} ||
$^O eq 'VMS' && -d $name && exists $names{"[.$name]"} ) ) {
It doesn't have to be pretty, it just has to work.
| Quote: | print "Removing '$name'\n" if $VERBOSE;
File::Path::rmtree( $_ );
}
- }, File::Spec->curdir );
+ }, './' );
|
Why not curdir?
|
|
| Back to top |
|
 |
Chris Sharman *nix forums addict
Joined: 02 Aug 2005
Posts: 83
|
Posted: Fri Feb 10, 2006 10:03 am Post subject:
Re: VMS files
|
|
|
Chris Sharman wrote:
| Quote: | 1. In the code below, is there some way to open the prices file for
keyed access with the same options (readonly, share=write, read
regardless) ?
(I can't see any option, myself, so I guess I'll have a hack at the C
code that does the open - something like "if (O_RDONLY) { }".
Is that something I should pass back to CPAN? If so, how ?)
|
Didn't read it carefully enough.
It does it per-record (rather than with the open).
It doesn't do the no-query-locking, but then there's a system option to
enable that optimisation.
No change required.
| Quote: | 2. Is there some way to check for EOF when I fall out of WHILE
(<$INFILE>) ? (rather than record locked or some other rms error?)
|
Thanks again
Chris
| Quote: | use VMS::IndexedFile;
use VMS::Stdio qw( &vmssysopen );
my $INFILE = vmssysopen("COE_FILES:PRODUCT.DAT", O_RDONLY, 0, "ctx=rec",
"shr=get,put,upd,del,nql", "rop=nlk,rrl") or die("Can't open input");
tie(my %hprc,VMS::IndexedFile,"COE_FILES:PRICES.DAT",0,O_RDONLY) or
die("Can't open prices");
|
Any views expressed in this message are those of the sender and not necessarily those of CCA Group. The unauthorized use, disclosure, copying or alteration of this message is forbidden. The contents of this message may be confidential and/or privileged, copyright CCA Group and are intended solely for the use of the individual or entity to whom they are addressed. Whilst this message has been scanned, CCA Group cannot guarantee that it is virus free or compatible with your systems and accepts no responsibility for any loss or damage arising from its use. The recipient is advised to run their own anti-virus software. If you receive this message in error please contact postmaster@ccagroup.co.uk immediately, destroy any copies and delete it from your computer systems. |
|
| Back to top |
|
 |
Chris Sharman *nix forums addict
Joined: 02 Aug 2005
Posts: 83
|
Posted: Fri Feb 10, 2006 9:38 am Post subject:
Re: VMS files
|
|
|
Thomas Pfau wrote:
| Quote: | Chris Sharman wrote:
Is VMS::IndexedFile the best/only way to read by key ? (it seems very
old - version 0.02 from April 1999)
I use VMS::IndexedFile to access the indexed files on my system. The
only issue I have with it is the fact that there's no way to change
which key you access a file through after you open the file except to
tie another hash. Other than that, I agree with Craig - it works and
there's no reason to update it.
|
Yes - seems to do the job. I noticed the example opened sysuaf once for
each key. I also found an RMS module, but that seemed to be even older!
Thanks to all of you for all the help - I feel I'm getting there now -
the learning curve isn't quite as steep as I'd feared.
I struggled a bit with locking - had to replace my open with a
vmssysopen to get the options I required (readonly, share=write).
Then found it tripped out (quietly with no apparent error) when it
reached a locked record - had to add "nql" & "rop=nlk,rrl" for that.
Two more questions:
1. In the code below, is there some way to open the prices file for
keyed access with the same options (readonly, share=write, read
regardless) ?
(I can't see any option, myself, so I guess I'll have a hack at the C
code that does the open - something like "if (O_RDONLY) { }".
Is that something I should pass back to CPAN? If so, how ?)
2. Is there some way to check for EOF when I fall out of WHILE
(<$INFILE>) ? (rather than record locked or some other rms error?)
Thanks again
Chris
use VMS::IndexedFile;
use VMS::Stdio qw( &vmssysopen );
my $INFILE = vmssysopen("COE_FILES:PRODUCT.DAT", O_RDONLY, 0, "ctx=rec",
"shr=get,put,upd,del,nql", "rop=nlk,rrl") or die("Can't open input");
tie(my %hprc,VMS::IndexedFile,"COE_FILES:PRICES.DAT",0,O_RDONLY) or
die("Can't open prices");
Any views expressed in this message are those of the sender and not necessarily those of CCA Group. The unauthorized use, disclosure, copying or alteration of this message is forbidden. The contents of this message may be confidential and/or privileged, copyright CCA Group and are intended solely for the use of the individual or entity to whom they are addressed. Whilst this message has been scanned, CCA Group cannot guarantee that it is virus free or compatible with your systems and accepts no responsibility for any loss or damage arising from its use. The recipient is advised to run their own anti-virus software. If you receive this message in error please contact postmaster@ccagroup.co.uk immediately, destroy any copies and delete it from your computer systems. |
|
| Back to top |
|
 |
Richard Levitte - VMS Wha *nix forums beginner
Joined: 19 Mar 2005
Posts: 3
|
Posted: Fri Feb 10, 2006 6:57 am Post subject:
Re: P.S. the problem is in catdir
|
|
|
In message <1CA4BF50819D0581D53FA7E1@[192.168.1.9]> on Thu, 09 Feb 2006 17:36:49 -0500, Steven Lembark <lembark@wrkhors.com> said:
lembark> This matters on VMS becuase the volume portion can be all
lembark> sorts of things, including search lists, all of which are
lembark> opaque to the caller. This allows me to
lembark>
lembark> set def USER$SANDBOX:
lembark>
lembark> and later
lembark>
lembark> set def [FOOBAR]
lembark>
lembark> and end up in USER:[PROJECTS.SANDBOX.INWORK.FOOBAR] becuase
lembark> VMS checked in the eight dir's defined as user$sandbox: and
lembark> the first one with a 'FOOBAR' subdir became my new default.
Not entirely true. You will end up in USER$SANDBOX:[FOOBAR].
However, whenever you do a file operation where the current default is
used, it will be translated into whatever works in the end, like
USER:[PROJECTS.SANDBOX.INWORK.FOOBAR].
Cheers,
Richard
-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.
--
Richard Levitte richard@levitte.org
http://richard.levitte.org/
"When I became a man I put away childish things, including
the fear of childishness and the desire to be very grown up."
-- C.S. Lewis |
|
| Back to top |
|
 |
Ken Williams *nix forums beginner
Joined: 16 Mar 2005
Posts: 6
|
Posted: Fri Feb 10, 2006 12:28 am Post subject:
Re: P.S. the problem is in catdir
|
|
|
On Feb 9, 2006, at 4:20 PM, Steven Lembark wrote:
| Quote: |
Perhaps I'm misunderstanding something, but I can't see how an empty
volume name could ever indicate an absolute path.
Because on *NIX you can
join '/', @subdirz;
and get a leading '/'.
|
That's true, but the confusion here is my fault: I meant that the
leading *directory* (from splitdir()) was an empty string to indicate
an absolute path, not the *volume* (from splitpath()).
-Ken |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Tue Dec 02, 2008 6:21 am | All times are GMT
|
|
Loans | Company Reports | Loans | Watch Gossip Girl Online | Web Advertising
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|