-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] lib/CPAN.pm: Init $netrcfile, untar to work with cygnus tar #61
Comments
From aichner@ecf.teradyne.com tar (GNU tar) 1.12 gzip 1.2.4 (18 Aug 93) untar fails with following error: //E/cygnus/cygwin-b20/H-i586-cygwin32/bin/tar.EXE: Cannot execute remote shell: No such file or directory This is beacause Cygnus tar cannot handle DOS filenames including So tar xvf //D/Users/AichnerAd/.cpan/sources/authors/id/B/BB/BBIRTH/Win32-SerialPort-0.150.tar My proposed fix tries the gzip - tar pipe irregardless of OS and runs Could someone please test this under MSwin32 with a tar uncapable of Regards, Adrian 1999-06-13 Adrian Aichner <aichner@ecf.teradyne.com> * CPAN.pm (hosthardest): Initialize $netrcfile with $netrc->netrc. Inline Patchdiff -u c:\perl\5.00557\lib\CPAN.pm.orig c:\perl\5.00557\lib\CPAN.pm
--- c:\perl\5.00557\lib\CPAN.pm.orig Sun Jun 13 14:51:30 1999
+++ c:\perl\5.00557\lib\CPAN.pm Sun Jun 13 14:51:30 1999
@@ -2241,12 +2241,12 @@
next;
}
my($host,$dir,$getfile) = ($1,$2,$3);
- my($netrcfile,$fh);
my $timestamp = 0;
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
$ctime,$blksize,$blocks) = stat($aslocal);
$timestamp = $mtime ||= 0;
my($netrc) = CPAN::FTP::netrc->new;
+ my($netrcfile) = $netrc->netrc;
my($verbose) = $CPAN::DEBUG{'FTP'} & $CPAN::DEBUG ? " -v" : "";
my $targetfile = File::Basename::basename($aslocal);
my(@dialog);
@@ -2259,7 +2259,7 @@
"get $getfile $targetfile",
"quit"
);
- if (! $netrc->netrc) {
+ if (! $netrcfile) {
CPAN->debug("No ~/.netrc file found") if $CPAN::DEBUG;
} elsif ($netrc->hasdefault || $netrc->contains($host)) {
CPAN->debug(sprintf("hasdef[%d]cont($host)[%d]",
@@ -4261,47 +4261,48 @@
if (MM->maybe_command($CPAN::Config->{'gzip'})
&&
MM->maybe_command($CPAN::Config->{'tar'})) {
- if ($^O =~ /win/i) { # irgggh
- # people find the most curious tar binaries that cannot handle
- # pipes
- my $system = "$CPAN::Config->{'gzip'} --decompress $file";
- if (system($system)==0) {
- $CPAN::Frontend->myprint(qq{Uncompressed $file successfully\n});
- } else {
- $CPAN::Frontend->mydie(
- qq{Couldn\'t uncompress $file\n}
- );
- }
- $file =~ s/\.gz$//;
- $system = "$CPAN::Config->{tar} xvf $file";
- if (system($system)==0) {
- $CPAN::Frontend->myprint(qq{Untarred $file successfully\n});
- } else {
- $CPAN::Frontend->mydie(qq{Couldn\'t untar $file\n});
- }
- return 1;
+ my $system = "$CPAN::Config->{'gzip'} --decompress --stdout " .
+ "< $file | $CPAN::Config->{tar} xvf -";
+ if (system($system) != 0) { # irgggh
+ # people find the most curious tar binaries that cannot handle
+ # pipes
+ my $system = "$CPAN::Config->{'gzip'} --decompress $file";
+ if (system($system)==0) {
+ $CPAN::Frontend->myprint(qq{Uncompressed $file successfully\n});
+ } else {
+ $CPAN::Frontend->mydie(
+ qq{Couldn\'t uncompress $file\n}
+ );
+ }
+ $file =~ s/\.gz$//;
+ $system = "$CPAN::Config->{tar} xvf $file";
+ $CPAN::Frontend->myprint(qq{USING TAR:$system:\n});
+ if (system($system)==0) {
+ $CPAN::Frontend->myprint(qq{Untarred $file successfully\n});
+ } else {
+ $CPAN::Frontend->mydie(qq{Couldn\'t untar $file\n});
+ }
+ return 1;
} else {
- my $system = "$CPAN::Config->{'gzip'} --decompress --stdout " .
- "< $file | $CPAN::Config->{tar} xvf -";
- return system($system) == 0;
+ return 1;
}
} elsif ($CPAN::META->has_inst("Archive::Tar")
- &&
- $CPAN::META->has_inst("Compress::Zlib") ) {
+ &&
+ $CPAN::META->has_inst("Compress::Zlib") ) {
my $tar = Archive::Tar->new($file,1);
$tar->extract($tar->list_files); # I'm pretty sure we have nothing
# that isn't compressed
-
+
ExtUtils::MM_MacOS::convert_files([$tar->list_files], 1)
- if ($^O eq 'MacOS');
-
+ if ($^O eq 'MacOS');
+
return 1;
} else {
$CPAN::Frontend->mydie(qq{
-CPAN.pm needs either both external programs tar and gzip installed or
-both the modules Archive::Tar and Compress::Zlib. Neither prerequisite
-is available. Can\'t continue.
-});
+ CPAN.pm needs either both external programs tar and gzip installed or
+ both the modules Archive::Tar and Compress::Zlib. Neither prerequisite
+ is available. Can\'t continue.
+ });
}
}
-- Adrian Aichner Teradyne GmbH, European Design Center |
Fixes GH Perl#61 aka RT 134101 (cherry picked from commit 935b7556e54d4bd3c18fdfef2f072b674afb7051) Signed-off-by: Nicolas R <atoomic@cpan.org>
add probe for __attribute__(always_inline)
Migrated from rt.perl.org#862 (status was 'resolved')
Searchable as RT862$
The text was updated successfully, but these errors were encountered: