octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: untar.m on Solaris with non-GNU tar


From: John W. Eaton
Subject: Re: untar.m on Solaris with non-GNU tar
Date: Fri, 20 Oct 2006 15:47:01 -0400

On 20-Oct-2006, Bill Denney wrote:

| On Fri, 20 Oct 2006, John Swensen wrote:
| 
| > I was trying to install octave-forge packages on a Solaris machine and 
| > kept getting a "tar: tape read error" and after digging found out that 
| > it is because the Solaris provided tar executable does not include the 
| > capability to gunzip *and* untar from a single 'tar' call.  Would it be 
| > possible to split the gunzip and tar process into 2 calls to accomodate?
| 
| I'm working on something that will fix this.  It will use the command:
| 
| sprintf("(cd \"%s\"; gzip -d -c \"%s\" | tar -x -v)", directory, filename);

Is this to fix the untar command, or for the unpack command?

Is directory "." unless the optional outputdir argument is given?

This will all break unless we have a POSIX shell, since I don't think
the Windows command shell does subshells the same way as a POSIX
shell.

If we care about Windows (and apparently some people do) then we need
to write these kinds of things in portable ways.  Does that mean we
need to do ugly things like

  if (isunix ())
    unix ("...");
  elseif (ispc ())
    dos ("...");
  else
    error ("I have no clue how to execute an external command");
  endif

Or we have to decide that the way to achieve portability is to ensure
that Octave has a POSIX shell available to run external commands.  But
even that might not be enough, as filesystem differences may cause
trouble unless we are careful.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]