Skip Menu |

This queue is for tickets about the XML-Edifact CPAN distribution.

Report information
The Basics
Id: 18657
Status: new
Priority: 0/
Queue: XML-Edifact

People
Owner: Nobody in particular
Requestors: cpan [...] pjedwards.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.47
Fixed in: (no value)



Subject: XML-Edifact-0.47 PATCH for build and test on VMS
XML-Edifact-0.47 Perl 5.87 on VMS Please find attached a patch for build and test case passes on VMS. Summary of changes: File::Spec->catdir replaced with File::Spec->catfile where needed. File::Spec->catfile and File::Spec->catdir added in a few places. Make filename extension substiution case insensitive on VMS. "touch" not native command, replaced with makefile's $(TOUCH) SDBM files renamed to remove period as SDBM adds a period to the files it creates, on VMS only one period is allowed. Thanks Peter (Stig) Edwards
Subject: XML-Edifact-0.47.diff
--- XML-Edifact-0.47/boot/annex_b.run 2006-04-09 20:33:58.1144614838 -0400 +++ XML-Edifact-0.47/boot/annex_b.run 2006-04-09 23:00:55.1144623655 -0400 @@ -37,1 +37,1 @@ use vars qw($element_tag $element_cooked_name $element_canon_name); open (INFILE, "un_edifact_d96b/annex_b.96b") || die "can not open annex_b.96b for reading"; -open (SEGFILE, ">".File::Spec->catdir("html","LIB","xml-edifact-03","segment.add") ) || die "can not open segment.add for writing"; -open (COMFILE, ">".File::Spec->catdir("html","LIB","xml-edifact-03","composite.add") ) || die "can not open composite.add for writing"; -open (ELEFILE, ">".File::Spec->catdir("html","LIB","xml-edifact-03","element.add") ) || die "can not open element.add for writing"; +open (SEGFILE, ">".File::Spec->catfile("html","LIB","xml-edifact-03","segment.add") ) || die "can not open segment.add for writing"; +open (COMFILE, ">".File::Spec->catfile("html","LIB","xml-edifact-03","composite.add") ) || die "can not open composite.add for writing"; +open (ELEFILE, ">".File::Spec->catfile("html","LIB","xml-edifact-03","element.add") ) || die "can not open element.add for writing"; printf STDERR "reading Annex B\n"; --- XML-Edifact-0.47/boot/codes.run 2006-04-09 20:33:58.1144614838 -0400 +++ XML-Edifact-0.47/boot/codes.run 2006-04-09 23:00:55.1144623655 -0400 @@ -19,0 +19,0 @@ =cut -open (OUTFILE, ">".File::Spec->catdir("html","LIB","xml-edifact-03","codes.txt") ) || die "can not open codes.txt for writing"; +open (OUTFILE, ">".File::Spec->catfile("html","LIB","xml-edifact-03","codes.txt") ) || die "can not open codes.txt for writing"; open (INFILE, "un_edifact_d96b/uncl-1.96b") || die "can not open uncl-1.96b for reading"; printf STDERR "reading uncl-1.96b\n"; --- XML-Edifact-0.47/boot/composite.run 2006-04-09 20:33:58.1144614838 -0400 +++ XML-Edifact-0.47/boot/composite.run 2006-04-09 23:00:55.1144623655 -0400 @@ -47,1 +47,1 @@ use vars qw($s $f3 $f5 $f7 $f9); open (INFILE, "un_edifact_d96b/trcd.96b") || die "can not open trcd.96b for reading"; -open (TXTFILE, ">".File::Spec->catdir("html","LIB","xml-edifact-03","composite.txt") ) || die "can not open composite.txt for writing"; -# open (XMLFILE, ">".File::Spec->catdir("html","LIB","xml-edifact-03","composite.xml") ) || die "can not open composite.xml for writing"; +open (TXTFILE, ">".File::Spec->catfile("html","LIB","xml-edifact-03","composite.txt") ) || die "can not open composite.txt for writing"; +# open (XMLFILE, ">".File::Spec->catfile("html","LIB","xml-edifact-03","composite.xml") ) || die "can not open composite.xml for writing"; printf STDERR "reading trcd.96b\n"; # print XMLFILE $XML::Edifact::COMPOSITE_SPECIFICATION_HEADER; --- XML-Edifact-0.47/boot/dtd.run 2006-04-09 20:33:58.1144614838 -0400 +++ XML-Edifact-0.47/boot/dtd.run 2006-04-09 23:00:55.1144623655 -0400 @@ -18,1 +18,1 @@ $debug=2; # ----------------------------------------------------------------------------- -open OUT,">".File::Spec->catdir("html","LIB","xml-edifact-03","edifact.dtd"); +open OUT,">".File::Spec->catfile("html","LIB","xml-edifact-03","edifact.dtd"); select(OUT); print $XML::Edifact::DOCTYPE_HEADER; --- XML-Edifact-0.47/boot/element.run 2006-04-09 20:33:58.1144614838 -0400 +++ XML-Edifact-0.47/boot/element.run 2006-04-09 23:00:55.1144623655 -0400 @@ -22,2 +22,2 @@ use strict; use vars qw($cod $des); -open (OUTFILE, ">".File::Spec->catdir("html","LIB","xml-edifact-03","element.txt") ) || die "can not open element.txt for writing"; +open (OUTFILE, ">".File::Spec->catfile("html","LIB","xml-edifact-03","element.txt") ) || die "can not open element.txt for writing"; printf STDERR "reading tred.96b\n"; open (INFILE, "un_edifact_d96b/tred.96b") || die "can not open tred for reading"; --- XML-Edifact-0.47/boot/segment.run 2006-04-09 20:33:58.1144614838 -0400 +++ XML-Edifact-0.47/boot/segment.run 2006-04-09 23:00:55.1144623655 -0400 @@ -51,1 +51,1 @@ #------------------------------------------------------------------------------# open (INFILE, "un_edifact_d96b/trsd.96b") || die "can not open trsd.96b for reading"; -open (TXTFILE, ">".File::Spec->catdir("html","LIB","xml-edifact-03","segment.txt") ) || die "can not open segment.txt for writing"; -# open (XMLFILE, ">".File::Spec->catdir("html","LIB","xml-edifact-03","segment.xml") ) || die "can not open segment.xml for writing"; +open (TXTFILE, ">".File::Spec->catfile("html","LIB","xml-edifact-03","segment.txt") ) || die "can not open segment.txt for writing"; +# open (XMLFILE, ">".File::Spec->catfile("html","LIB","xml-edifact-03","segment.xml") ) || die "can not open segment.xml for writing"; print STDERR "reading trsd.96b\n"; # print XMLFILE $XML::Edifact::SEGMENT_SPECIFICATION_HEADER; --- XML-Edifact-0.47/Bootstrap.PL 2006-04-09 20:33:58.1144614838 -0400 +++ XML-Edifact-0.47/Bootstrap.PL 2006-04-09 23:00:55.1144623655 -0400 @@ -20,1 +20,1 @@ XML::Edifact::open_dbm( $DATA, O_RDWR|O_CREAT ); #------------------------------------------------------------------------------# -$run=File::Spec->catdir("boot","segment.run"); $req_ok = require $run; -$run=File::Spec->catdir("boot","composite.run"); $req_ok = require $run; -$run=File::Spec->catdir("boot","element.run"); $req_ok = require $run; -$run=File::Spec->catdir("boot","annex_b.run"); $req_ok = require $run; -$run=File::Spec->catdir("boot","codes.run"); $req_ok = require $run; -$run=File::Spec->catdir("boot","dtd.run"); $req_ok = require $run; +$run=File::Spec->catfile("boot","segment.run"); $req_ok = require $run; +$run=File::Spec->catfile("boot","composite.run"); $req_ok = require $run; +$run=File::Spec->catfile("boot","element.run"); $req_ok = require $run; +$run=File::Spec->catfile("boot","annex_b.run"); $req_ok = require $run; +$run=File::Spec->catfile("boot","codes.run"); $req_ok = require $run; +$run=File::Spec->catfile("boot","dtd.run"); $req_ok = require $run; #------------------------------------------------------------------------------# @@ -53,5 +53,10 @@ foreach $name (@_) { open (INFILE, $name) || die "can not open !".$name."! for reading"; $tiename = $name; + if ($^O ne 'VMS') { $tiename =~ s/\.txt$//; + } else { + $tiename =~ s/\.txt$//i; + } + print STDERR "load_dbm tiename='$tiename'\n"; tie(%DBM, 'SDBM_File', $tiename, O_RDWR|O_CREAT, 0644) || die "can not tie ".$tiename.$!; %DBM = (); --- XML-Edifact-0.47/Makefile.PL 2006-04-09 20:33:58.1144614838 -0400 +++ XML-Edifact-0.47/Makefile.PL 2006-04-10 11:33:57.1144668837 -0400 @@ -25,1 +25,1 @@ !1! $URL="http://www.xml-edifact.org" unless $URL; -$DIR=File::Spec->catfile(File::Spec->tmpdir(),"xml-edifact") unless $DIR; +$DIR=File::Spec->catdir(File::Spec->splitpath(File::Spec->tmpdir()),"xml-edifact") unless $DIR; $URL = prompt "URL for public documents",$URL; $DIR = prompt "Directory on this system",$DIR; @@ -40,2 +40,2 @@ $DAT=File::Spec->catdir($Config{'installsitelib'},"XML","Edifact","d96b"); $TST=File::Spec->catdir("blib","lib","XML","Edifact","d96b"); -open OUTFILE,">".File::Spec->catdir("XML","Edifact","Config.pm"); +open OUTFILE,">".File::Spec->catfile("XML","Edifact","Config.pm"); print OUTFILE 'package XML::Edifact::Config;'."\n"; print OUTFILE 'use strict;'."\n"; print OUTFILE 'use vars qw($URL $DIR $DAT $TST);'."\n"; @@ -73,2 +73,2 @@ }, ); +#sub MY::postamble { +# return('install:: '.$main::DIR."/.exists\n". +# $main::DIR."/.exists : html/.exists\n". +# "\t".'$(MOD_INSTALL) html '.$main::DIR."\n". +# "\t".'touch '.$main::DIR."/.exists\n"); +#} + sub MY::postamble { - return('install:: '.$main::DIR."/.exists\n". - $main::DIR."/.exists : html/.exists\n". + return('install:: '.File::Spec->catfile($main::DIR,'.exists')."\n". + File::Spec->catfile($main::DIR,'.exists')." : ".File::Spec->catfile('html','.exists')."\n". "\t".'$(MOD_INSTALL) html '.$main::DIR."\n". - "\t".'touch '.$main::DIR."/.exists\n"); + "\t".'$(TOUCH) '.File::Spec->catfile($main::DIR,'.exists')."\n"); } --- XML-Edifact-0.47/XML/Edifact.pm 2006-04-09 20:33:58.1144614838 -0400 +++ XML-Edifact-0.47/XML/Edifact.pm 2006-04-09 23:00:55.1144623655 -0400 @@ -74,2 +74,2 @@ $directory = $XML::Edifact::Config::DAT unless $directory; $fcntl = O_RDONLY unless $fcntl; - tie(%SEGMT, 'SDBM_File', $directory.'/segment.dat', $fcntl, 0644) || die "can not tie segment.dat:".$!; - tie(%SEGMR, 'SDBM_File', $directory.'/segment.rev', $fcntl, 0644) || die "can not tie segment.dat:".$!; - tie(%COMPT, 'SDBM_File', $directory.'/composite.dat', $fcntl, 0644) || die "can not tie composite.dat:".$!; - tie(%ELEMT, 'SDBM_File', $directory.'/element.dat', $fcntl, 0644) || die "can not tie element.dat:".$!; - tie(%CODET, 'SDBM_File', $directory.'/codes.dat', $fcntl, 0644) || die "can not tie codes.dat:".$!; + # VMS only supports filenames with one period/dot (.). + + tie(%SEGMT, 'SDBM_File', File::Spec->catfile($directory,'segment_dat'), $fcntl, 0644) || die "can not tie SDBM file ".File::Spec->catfile($directory,'segment_dat').":".$!; + tie(%SEGMR, 'SDBM_File', File::Spec->catfile($directory,'segment_rev'), $fcntl, 0644) || die "can not tie SDBM file ".File::Spec->catfile($directory,'segment_rev').":".$!; + tie(%COMPT, 'SDBM_File', File::Spec->catfile($directory,'composite_dat'), $fcntl, 0644) || die "can not tie SDBM file ".File::Spec->catfile($directory,'composite_dat').":".$!; + tie(%ELEMT, 'SDBM_File', File::Spec->catfile($directory,'element_dat'), $fcntl, 0644) || die "can not tie SDBM file ".File::Spec->catfile($directory,'element_dat').":".$!; + tie(%CODET, 'SDBM_File', File::Spec->catfile($directory,'codes_dat'), $fcntl, 0644) || die "can not tie SDBM file ".File::Spec->catfile($directory,'codes_dat').":".$!; $indent_join=''; $indent_tab='';