Re: Archive::Tar does not behave like gnu tar

2008-09-24 Thread David Cantrell
On Tue, Sep 23, 2008 at 10:05:01PM -0400, David Golden wrote:

 Please see if they all honor a --no-same-permissions flag.
 $ tar --help | grep no-same-permissions

NetBSD

$ tar --help | grep no-same-permissions
tar: unknown option -- help
usage: tar [-]{crtux}[-befhjlmopqvwzHOPSXZ014578] [archive] [blocksize]
   [-C directory] [-T file] [-s replstr] [file ...]

FreeBSD

$ tar --help | grep no-same-permissions
$

Irix

$ tar --help | grep no-same-permissions
tar: no function specifier.
usage: tar [-][{ruxXtcC}acdefhlm{o|S}pqvwLUBDRV{O|K}fb] [dir] [tapefile]
[blocksize] file ...

Solaris

$ /usr/bin/tar --help | grep no-same-permissions
Usage: tar {c|r|t|u|[EMAIL PROTECTED] [blocksize]
[tarfile] [size] [exclude-file...] {file | -I include-file | -C
directory file}...

-- 
David Cantrell | Official London Perl Mongers Bad Influence

Stepped on something soft and wobbly.
Struck a match.
Found it was a dead Chinaman.

-- Sir George Scott


Re: Archive::Tar does not behave like gnu tar

2008-09-24 Thread David Golden
On Wed, Sep 24, 2008 at 10:13 AM, David Cantrell [EMAIL PROTECTED] wrote:
 NetBSD

 $ tar --help | grep no-same-permissions
 tar: unknown option -- help
 usage: tar [-]{crtux}[-befhjlmopqvwzHOPSXZ014578] [archive] [blocksize]
   [-C directory] [-T file] [-s replstr] [file ...]

Where's the DWIM option for the DCANTRELL module?  ;-)

Looks like Archive::Tar, while slower, it more consistently
controllable everywhere.  Otherwise, we need experts on all systems
and versions of tar to figure out the right flags.  And preferably a
module to abstract all that away.  Ugh.

-- David


Re: Archive::Tar does not behave like gnu tar

2008-09-24 Thread David Cantrell
On Wed, Sep 24, 2008 at 10:33:04AM -0400, David Golden wrote:

 Looks like Archive::Tar, while slower, it more consistently
 controllable everywhere.

Yup.

And it's core in 5.10 and can be made a dependency for new releases of
CPAN.pm and CPANPLUS.  Anyone using old versions of CPAN.pm - well,
they'll be no worse off than they are now.  The only possible problem is
that one of its pre-reqs isn't pure perl - but that's a compression
library thing, so could be made into an optional pre-req, falling back
to the local gzip if necessary.

-- 
David Cantrell | A machine for turning tea into grumpiness

  I remember when computers were frustrating because they did
  exactly what you told them to.  That seems kinda quaint now.
  -- JD Baldwin, in the Monastery


Re: Archive::Tar does not behave like gnu tar

2008-09-24 Thread Eric Wilhelm
# from David Golden
# on Wednesday 24 September 2008 07:33:

 $ tar --help | grep no-same-permissions
 tar: unknown option -- help
 usage: tar [-]{crtux}[-befhjlmopqvwzHOPSXZ014578] [archive]
 [blocksize] [-C directory] [-T file] [-s replstr] [file ...]

Where's the DWIM option for the DCANTRELL module?  ;-)

My mac's tar manpage doesn't mention no-same-permissions, but it does 
say for -x:

  ...file permissions are restored, if possible

And has an option --same-permissions, which seems lonely and odd (but 
this is a mac so it's either BSD odd or value-added mac odd.)

The important note is that it *does* apply the umask to the extraction 
by default for a normal user and preserves permissions by default for 
the root user.

And while undocumented (in the manpage, but documented in the --help 
output!), it does honor --no-same-permissions.

So, the bsd manpage on my mac doesn't document --no-same-permissions, 
but it says that this tar is the gnu implementation (and that this is 
the netbsd 1.0 manpage.)

--Eric
-- 
hobgoblin n 1: (folklore) a small grotesque supernatural creature that
  makes trouble for human beings
---
http://scratchcomputing.com
---


Re: Archive::Tar does not behave like gnu tar

2008-09-23 Thread Eric Wilhelm
# from Shlomi Fish
# on Tuesday 23 September 2008 03:00:

[EMAIL PROTECTED] Data-Dump-Streamer-2.08-40]$ ls -l Makefile.PL
-rwxrwxrwx 1 cpan cpan 3792 2006-04-16 18:33 Makefile.PL*

Apparently that is using Archive::Tar by way of Archive::Extract (says 
bingos.)

So, something needs to set $Archive::Tar::CHMOD = 1; to make it behave 
like gnu tar.

Of course, when running as root, cpanplus would have to set TAR_OPTIONS 
whenever prefer_bin is set in your config.

For a workaround, (if you have gnu tar) apparently prefer_bin = 1 in 
your cpanplus config would do it.

--Eric
-- 
Consumers want choice, consumers want openness.
--Rob Glaser
---
http://scratchcomputing.com
---


Re: Archive::Tar does not behave like gnu tar

2008-09-23 Thread David Golden
On Tue, Sep 23, 2008 at 3:06 PM, Eric Wilhelm
[EMAIL PROTECTED] wrote:
 So, something needs to set $Archive::Tar::CHMOD = 1; to make it behave
 like gnu tar.

$Archive::Tar::CHMOD = 1 or 0?

The default is 1.  From the Pod:

By default, Archive::Tar will try to chmod your files to whatever mode
was specified for the particular file in the archive. In some cases,
this may not be desired. In that case, set this variable to 0 to
disable chmod-ing.

So I think 0 would leave it to the umask, or am I reading this wrong?

If it's that easy, I can go patch CPAN.pm right away.

-- David


Re: Archive::Tar does not behave like gnu tar

2008-09-23 Thread Eric Wilhelm
# from David Golden
# on Tuesday 23 September 2008 12:42:

 So, something needs to set $Archive::Tar::CHMOD = 1; to make it
 behave like gnu tar.

$Archive::Tar::CHMOD = 1 or 0?

The default is 1.  From the Pod:

Yeah, sorry. 0.  It has a default which is opposite of gnu tar.

If it's that easy, I can go patch CPAN.pm right away.

And CPANPLUS I guess.  I'm not sure what else happens in 
Archive::Extract and whatever other code is involved, I've only dug 
deep enough to determine that shlomi's problem is caused by something 
other than gnu tar.

There is also still an issue using gnu tar if you run as root.

And are there other tar programs?

--Eric
-- 
I've often gotten the feeling that the only people who have learned
from computer assisted instruction are the authors.
--Ben Schneiderman
---
http://scratchcomputing.com
---


Re: Archive::Tar does not behave like gnu tar

2008-09-23 Thread David Golden
On Tue, Sep 23, 2008 at 3:53 PM, Eric Wilhelm
[EMAIL PROTECTED] wrote:
 Yeah, sorry. 0.  It has a default which is opposite of gnu tar.

If it's that easy, I can go patch CPAN.pm right away.

Done: CPAN.pm is patched in trunk.

 And CPANPLUS I guess.  I'm not sure what else happens in
 Archive::Extract and whatever other code is involved, I've only dug
 deep enough to determine that shlomi's problem is caused by something
 other than gnu tar.

It looks like Archive::Extract attempts to do the right thing, but
sets the wrong variable:

 local $Archive::Tar::Constant::CHOWN = 0;

I'll file a bug report on RT.

 And are there other tar programs?

.zip?

-- David


Re: Archive::Tar does not behave like gnu tar

2008-09-23 Thread David Cantrell
On Tue, Sep 23, 2008 at 12:53:33PM -0700, Eric Wilhelm wrote:

 There is also still an issue using gnu tar if you run as root.
 And are there other tar programs?

Unfortunately yes.

If people can point me at some simple tests (sorry, I've not been
following this thread), I can see what these tars do:
  NetBSD
  FreeBSD
  Irix
  Solaris

They all appear to be different - at least, they all respond differently
to 'tar --help'.  This would tend to indicate to me that the solution is
use Archive::Tar.

Someone should also test using GNU tar on Cygwin and GNU tar on Win32.

-- 
David Cantrell | London Perl Mongers Deputy Chief Heretic

  Cynical is a word used by the naive to describe the experienced.
  George Hills, in uknot


Re: Archive::Tar does not behave like gnu tar

2008-09-23 Thread David Golden
On Tue, Sep 23, 2008 at 7:27 PM, David Cantrell [EMAIL PROTECTED] wrote:
 If people can point me at some simple tests (sorry, I've not been
 following this thread), I can see what these tars do:
  NetBSD
  FreeBSD
  Irix
  Solaris

 They all appear to be different - at least, they all respond differently
 to 'tar --help'.  This would tend to indicate to me that the solution is
 use Archive::Tar.

Please see if they all honor a --no-same-permissions flag.

$ tar --help | grep no-same-permissions

--David