help-octave
[Top][All Lists]
Advanced

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

Re: Yet Another Plotting System for Octave


From: Alexander Barth
Subject: Re: Yet Another Plotting System for Octave
Date: Thu, 18 Jan 2007 13:15:19 -0500
User-agent: Thunderbird 1.5.0.9 (X11/20070102)

Joe Koski wrote:
> on 1/17/07 8:46 PM, Marius Schamschula at address@hidden wrote:
> 
>> Oops,
>>
>> I was a bit quick to say that yapso installed correctly:
>>
>> The install died with 
>>
>> checking for glBegin in -lGL... no
>>
>> but
>>
>> Saturn:~ marius$ nm /usr/X11R6/lib/libGL.dylib | grep glBegin
>> 00002d7c T ___indirect_glBegin
>>          U _glBegin
>>          U ___indirect_glBegin
>>          U ___indirect_glBegin
>>
>> Any ideas?
>>
>> Marius
>>
> Marius,
> 
> As far as I know the pkg install feature is broken on Macs with
> octave-2.9.9. The untar.m routine was having Mac problems, and I offered to
> be the Mac tester, but nobody responded. I was waiting for 2.9.10 before
> trying again. You could probably work around the problem by manually using
> mkoctfile and manually installing the package. YAPSO sounds very promising.
> 
> Joe
> 

Thank you for sharing your experience with untar. What is very strange is that 
absolute file names
seem to work. I suspect something wrong with canonicalize_file_name or chdir. I 
attached a modified
untar file with some debugging information. Can you execute this modified untar 
like:

untar('yapso-0.2.1.tar.gz','test-dir')

and send us the output? Make sure that you use the attached version with "which 
untar".


Thanks
Alex

> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave


-- 
_______________________________________________________________

  Alexander Barth

  Ocean Circulation Group
  University of South Florida
  College of Marine Science
  140 Seventh Avenue South
  St. Petersburg, Florida  33701
  USA

  Phone: +1-727-553-3508     FAX:   +1-727-553-1189

_______________________________________________________________
## Copyright (C) 2005 Søren Hauberg
## 
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## 
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

## -*- texinfo -*-
## @deftypefn {Function File} untar (@var{tarfile}, @var{dir})
## Unpack the TAR archive @var{tarfile} to the directory @var{dir}.
## If @var{dir} is not specified, it defaults to the current directory.
## @seealso{tar, gzip, gunzip, zip, unzip}
## @end deftypefn

## Author: Søren Hauberg <address@hidden>
## Adapted-By: jwe

function files = untar (tarfile, dir)

  if (nargin == 1 || nargin == 2)

    if (nargin == 1)
      dir = ".";
    endif

    if (ischar (tarfile) && ischar (dir))

      orig_dir = pwd ()

      tarfile = canonicalize_file_name (tarfile)

      s = stat (dir)
      if (isempty (s))
        [status, msg] = mkdir (dir);
        if (! status)
          error ("untar: mkdir failed to create %s: %s", dir, msg);
        endif
      elseif (! S_ISDIR (s.mode))
        error ("untar: %s: not a directory", dir);
      endif

      unwind_protect
        chdir (dir);
        "now working dir is",pwd
        "command to be exectuted is",sprintf ("tar -x -v -f %s", tarfile)
        [status, output] = system (sprintf ("tar -x -v -f %s", tarfile));
      unwind_protect_cleanup
        chdir (orig_dir);
      end_unwind_protect

      if (status == 0)
        if (nargout > 0)
          fs = filesep ();
          if (dir(end) != fs)
            dir = strcat (dir, fs);
          endif
          ## Sadly not reliable if a filename contains a newline
          ## character!
          if (output(end) == "\n")
            output(end) = [];
          endif
          files = cellstr (split (output, "\n"));
          if (! strcmp (dir, "."))
            nf = length (files);
            for i = 1:nf
              files{i} = strcat (dir, files{i});
            endfor
          endif
          files = files';
        endif
      else
        error ("tar: tar exited with status = %s", status);
      endif

    else
      error ("untar: expecting arguments to be character strings");
    endif

  else
    print_usage ("untar");
  endif

endfunction

reply via email to

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