Skip Menu |

This queue is for tickets about the ExtUtils-Install CPAN distribution.

Report information
The Basics
Id: 2804
Status: resolved
Priority: 0/
Queue: ExtUtils-Install

People
Owner: Nobody in particular
Requestors: jari.aalto [...] poboxes.com
Cc:
AdminCc:

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



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.
[guest - Mon Jun 16 09:19:27 2003]: Show quoted text
> 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.
Patches welcome. If you are to do this, rather than simply reversing all the existing verbose prints, it would be nice if you modularized them whlie you're at it replacing: mkpath($targetdir,0,0755) unless $nonono; print "mkpath($targetdir,0,0755)\n" if $verbose>1; with sub _mkpath { my($dir, $print, $mode) = @_; print "mkpath($targetdir,$print,$mode)\n" if $verbose > 1; mkpath($targetdir,$print,$mode) unless $nonono; } Show quoted text
> 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;
Patches welcome, though it might be better if it warned instead of died. As above, it would be good if these were modularized into subroutines across the board rather than piecemeal. Show quoted text
> 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
This appears to already be fixed in the latest development version, though I did not try it on Windows. Try it out. http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker-6.10_06/
[jari.aalto@poboxes.com - Tue Jun 17 06:56:56 2003]: Show quoted text
> After debugging this, I found out that is is a serious mistake to try > to set PREFIX to a relative path, like I did: > > $ perl Makefile.PL PREFIX=.inst
If that doesn't work, its a bug not a mistake on your part. Show quoted text
> In my mind I thought it would translate relative to CURRENT > directory. The Install.pm's Find() then tried to install INSIDE > blib/.inst during Find ... which caused to recursive invocations.
The behavior should be that it installs relative to the current directory. In fact, the tests do exactly that. I believe we already discussed this in email, not in RT. Could you confirm that the latest snapshots on rt.cpan.org fix this problem?
[jari.aalto@poboxes.com - Tue Jun 17 06:56:56 2003]: Show quoted text
> I also added checks that were discussed in previous mail. Please > test. This patch is against latest CPAN version > ExtUtils-MakeMaker-6.10_06
I'm going to hold on this patch until after 5.8.1 is released as I need to get a stable version out the door for Jarkko, this isn't critical and I'd like to consider the problem more widely than just a few local changes.
http://www.makemaker.org/wiki/index.cgi?ModulesForSale ExtUtils::Install is set to be split out of MakeMaker. I'm going to leave this to whomever the poor sap is that takes it over.
As far as i know all of these issues are resolved. Please file a new ticket if you disagree.