Comments (1)
From [email protected]
tar (GNU tar) 1.12
Copyright (C) 1988, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by John Gilmore and Jay Fenlason.
gzip 1.2.4 (18 Aug 93)
Compilation options:
DIRENT UTIME STDC_HEADERS HAVE_UNISTD_H ASMV
untar fails with following error:
//E/cygnus/cygwin-b20/H-i586-cygwin32/bin/tar.EXE: Cannot execute remote shell: No such file or directory
[main] E:\cygnus\cygwin-b20\H-i586-cygwin32\bin\tar.EXE 1000 (0) handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
[main] tar 1000 (0) handle_exceptions: Dumping stack trace to tar.EXE.core
Couldn't untar D:\Users\AichnerAd\.cpan\sources\authors\id\B\BB\BBIRTH\Win32-SerialPort-0.150.tar
cpan>
This is beacause Cygnus tar cannot handle DOS filenames including
drive letters.
So
tar xvf D:\Users\AichnerAd\.cpan\sources\authors\id\B\BB\BBIRTH\Win32-SerialPort-0.150.tar
fails, while following would work:
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
commands separately if that fails.
Could someone please test this under MSwin32 with a tar uncapable of
piping?
Regards,
Adrian
1999-06-13 Adrian Aichner <aichner@ecf.teradyne.com>
* CPAN.pm (hosthardest): Initialize $netrcfile with $netrc->netrc.
(untar): Attempt piping gzip output to tar irregardless of
$OSNAME. Run commands separately in case of error.
Inline Patch
diff -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
Integra Test Division Telephone +49/89/41861(0)-208
Dingolfinger Strasse 2 Fax +49/89/41861-217 (What is a Fax?)
D-81673 MUENCHEN E-mail adrian.aichner@teradyne.com
from perl5.
Related Issues (20)
- Cannot build without another Perl HOT 8
- Give more informative error when using a filehandle as a directory handle HOT 3
- Porting/sync-with-cpan having trouble with version declared in package statement HOT 8
- ExtUtils::Liblist->ext() finds wrong libraries that do not work for build-time linking ('-ltinfo' found at .../libtinfo.so.6.4), breaks builds (Term::ReadLine::Gnu) HOT 3
- When Configure checks the integrity of Perl, running the ls command encounters an error message related to “grep: warning: stray \ before -.” This causes Configure to mistakenly judge the package as incomplete HOT 7
- [doc] print join 1..9 HOT 5
- split bitwise-assignment operators (`&=`, `&.=`, etc) don't return lvalues HOT 1
- test t/io/sem fails on Mac PPC64 HOT 14
- Use of uninitialized value $_[0] in defined operator HOT 1
- [doc] perlfunc our section block unclear HOT 1
- [doc] perlfunc pack snippet has different output HOT 1
- Missing support for undef in for_list assignments HOT 6
- BBC: c844eac triggers failures in Devel::Cover HOT 1
- "@" symbol in directory path results in syntax error in Config_heavy.pl HOT 5
- FreeBSD/arm64: POSIX/t/math.t fails with -Duselongdouble HOT 4
- inconsistent behavior of dup open w/ barewords under `use strict` HOT 1
- 5.40.0 onwards won't build Darwin fat binaries HOT 17
- Segmentation fault in Perl_csighandler3 when used XS with threads. HOT 10
- BBC: Blead Breaks File::Tabular HOT 10
- feature 'class': out of memory error if subclassing a class with an explicit new HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perl5.