Subject: | PREFIX argument treatment incorrect Install.pm (Win32/Cygwin) |
Cross reference: http://grepmail.sourceforge.net/
SUGGESTION:
It would be better if the verbose print commands came BEFORE, not after the command, because if the command fails, you don't know the start situation. Like this from Install.pm:
144 print "mkpath($targetdir,0,0755)\n" if $verbose>1;
145 mkpath([$targetdir],0,0755) unless $nonono;
The code in 6.05 is the other way round.
MINOR BUG:
I think there should be a test in Install.pm after this:
147 copy($_,$targetfile) unless $nonono;
The copy command may fail, so printing $! and quitting would be good. Similarly this command potentially may fail under Win32/Cygwin also:
152 chmod $mode, $targetfile;
MAJOR BUG:
If MakeMaker 6.05 is instructed to use PREFIX argument under standard Perl 5.8.0, it goes into the loop where PREFIX is multiplied at each loop round. This example is from configuring grepmail with Makefile.PL
$ perl Makefile.PL FASTREADER=0 INSTALLDIRS=perl PREFIX=.inst/usr
.. Relevant content of produced Makefile
INSTALLDIRS = perl
PREFIX = .inst/usr
SITEPREFIX = .inst/usr
VENDORPREFIX = .inst/usr
MAKEMAKER = /usr/lib/perl5/5.8.0/ExtUtils/MakeMaker.pm
MM_VERSION = 6.05
I installed few debug calls inside module. See lines 118 and after.
/usr/lib/perl5/5.8.0/ExtUtils/Install.pm
48 sub install {
49 my($hash,$verbose,$nonono,$inc_uninstall) = @_;
50 $verbose ||= 0;
51 $nonono ||= 0;
52
53 use Cwd qw(cwd);
54 use ExtUtils::Packlist;
55 use File::Basename qw(dirname);
...
95 my($source);
96 MOD_INSTALL: foreach $source (sort keys %hash) {
97 #copy the tree to the target directory without altering
98 #timestamp and permission and remember for the .packlist
...
118 find(sub {
119 my ($mode,$size,$atime,$mtime) = (stat)[2,7,8,9];
120 return unless -f _;
121 return if $_ eq ".exists";
122
123 # my $targetdir = $targetroot;
124 my $targetdir = File::Spec->catdir($targetroot, $File::Fin
124 d::dir);
125 my $targetfile = File::Spec->catfile($targetdir, $_);
126
127 print ">> FDIR $File::Find::dir\n";
128 print ">> TDIR $targetdir TFILE $targetfile\n";
129
130 my $diff = 0;
131 if ( -f $targetfile && -s _ == $size) {
132 # We have a good chance, we can skip this one
133 $diff = compare($_,$targetfile);
134 } else {
135 print "$_ differs\n" if $verbose>1;
136 $diff++;
137 }
138
139 if ($diff){
140 if (-f $targetfile){
141 forceunlink($targetfile) unless $nonono;
142 } else {
143 my $verbose = 2;
144 print "mkpath($targetdir,0,0755)\n" if $verbose>1;
145 mkpath([$targetdir],0,0755) unless $nonono;
146 }
Which read like this:
root@w2kpicasso:/usr/src/build/grepmail-cvs-2003.0616$ make install
Show quoted text
>> SOURCE blib/arch TROOT .inst/usr/lib/perl5/5.8.0/cygwin-multi-64int
>> SOURCE blib/bin TROOT .inst/usr/bin
>> SOURCE blib/lib TROOT .inst/usr/lib/perl5/5.8.0
>> SOURCE blib/man1 TROOT .inst/usr/man/man1
>> FDIR .
>> TDIR .inst/usr/man/man1 TFILE .inst/usr/man/man1/grepmail.1
>> FDIR ./.inst/usr/man/man1
>> TDIR .inst/usr/man/man1/.inst/usr/man/man1 TFILE .inst/usr/man/man1/.inst/u\
sr/man/man1/grepmail.1
Show quoted text>> FDIR ./.inst/usr/man/man1/.inst/usr/man/man1
>> TDIR .inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1 TFILE .inst/u\
sr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/grepmail.1
Show quoted text>> FDIR ./.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1
>> TDIR .inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man\
/man1 TFILE .inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr\
/man/man1/grepmail.1
Show quoted text>> FDIR ./.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/m\
an/man1
Show quoted text>> TDIR .inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man\
/man1/.inst/usr/man/man1 TFILE .inst/usr/man/man1/.inst/usr/man/man1/.inst/usr\
/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/grepmail.1
Show quoted text>> FDIR ./.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/m\
an/man1/.inst/usr/man/man1
Show quoted text>> TDIR .inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man\
/man1/.inst/usr/man/man1/.inst/usr/man/man1 TFILE .inst/usr/man/man1/.inst/usr\
/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/m\
an/man1/grepmail.1
mkpath(.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/\
man1/.inst/usr/man/man1/.inst/usr/man/man1,0,0755)
mkdir .inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/man1/.inst/usr/man/m\
an1/.inst/usr/man/man1/.inst: Invalid argument at /usr/lib/perl5/5.8.0/ExtUtil\
s/Install.pm line 145
make: *** [pure_perl_install] Error 255
Please contact for further information and ask help for testing new code.