octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #49880] Failure to install package from uncomp


From: Thomas
Subject: [Octave-bug-tracker] [bug #49880] Failure to install package from uncompressed file
Date: Sun, 18 Dec 2016 21:08:58 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0

URL:
  <http://savannah.gnu.org/bugs/?49880>

                 Summary: Failure to install package from uncompressed file
                 Project: GNU Octave
            Submitted by: harmonic_gnu
            Submitted on: Sun 18 Dec 2016 09:08:56 PM GMT
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Installation Failure
                  Status: None
             Assigned to: None
         Originator Name: harmonic_gnu
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.0
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Symptom:
Octave is supposed to support installing a package from a file that is already
uncompressed into a directory. However when trying to install the package from
a directory it gives the following error:

unpack: FILETYPE must be "gunzip" for a directory
error: called from
    install at line 146 column 5
    pkg at line 394 column 9

  A directory is not supposed to be gunzipped, so this suggests something is
wrong. 

The Cause:

In lines 65 & 99 of install.m  a verification of whether its a directory or a
compressed file is done by using the "exist()" function:
   

  if (exist (tgz, "file"))    
if (exist (tgz, "file") || exist (tgz, "dir"))


The use of the exist function here is not correct because (exist (tgz, "file")
will give 0 only if tgz is not a file AND not a directory, the function does
not give a binary output. If it is either of them the output is 2 or 7, which
evaluate to true in the if statement.

Suggested correction:

For line 65 it should say instead

if (exist (tgz, "file")==2)  
 
, meaning that if tgz exists and is a file then execute that piece to
decompress it. 
For line 99 we could  have:


if (exist (tgz, "file")==2 || exist (tgz, "dir")==7)


   which would execute that piece of the code only if a valid file or
directory were found. 

  







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49880>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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