gunzip incompatible

Muthiah Annamalai muthuspost at gmail.com
Mon Jan 28 03:45:51 CST 2008


John W. Eaton wrote:
> On 28-Jan-2008, Muthiah Annamalai wrote:
>
> | No I think you could change 'unpack.m' and allow a 4th argument that can 
> | be used
> | as a fallback.
>
> It wouldn't really be a fallback method, since it would force a
> particular method instead of trying to guess then falling back on some
> other method if the guess failed.
>
> Also, looking at unpack, it seems that it is already set up to have
> the third argument be the filetype (method to use) but that it is not
> being used appropriately.  So I think fixing this just a matter of a
> small patch to unpack.
>
> jwe
>
>   

I think this change makes something like what you say, but it doesnt 
handle tar.gz,
tar.bz, tar.bz2. I am not attaching a changelog, as I expect further 
improvement.

Index: unpack.m
===================================================================
RCS file: /cvs/octave/scripts/miscellaneous/unpack.m,v
retrieving revision 1.7
diff -c -r1.7 unpack.m
*** unpack.m 12 Oct 2007 21:27:23 -0000 1.7
--- unpack.m 28 Jan 2008 21:42:50 -0000
***************
*** 139,148 ****
@__parse_zip__, false};
endif

! nodotext = ext(! ismember (ext, "."));
!
! origdir = pwd ();

if (isfield (commandlist, nodotext))
[commandv, commandq, parser, move] = deal (commandlist.(nodotext){:});
cstartdir = canonicalize_file_name (origdir);
--- 139,159 ----
@__parse_zip__, false};
endif

! switch ( filetype )
! case "gunzip"
! nodotext = "gz";
! case "bunzip"
! nodotext = "bz";
! case "untar"
! nodotext = "tar";
! case "unzip"
! nodotext = "zip";
! otherwise
! nodotext = ext(! ismember (ext, "."));
! endswitch

+ origdir = pwd ();
+
if (isfield (commandlist, nodotext))
[commandv, commandq, parser, move] = deal (commandlist.(nodotext){:});
cstartdir = canonicalize_file_name (origdir);

Patch is also attached.

Thanks,
Muthu



-------------- next part --------------
A non-text attachment was scrubbed...
Name: unkompress.patch
Type: text/x-patch
Size: 1187 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080128/cb299252/attachment-0001.bin 


More information about the Help-octave mailing list