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

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

[Octave-bug-tracker] [bug #57522] "pkg unload" does not care for depende


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #57522] "pkg unload" does not care for dependencies
Date: Sun, 2 Feb 2020 08:40:26 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0

Update of bug #57522 (project octave):

                  Status:                   Fixed => Patch Submitted        
             Open/Closed:                  Closed => Open                   

    _______________________________________________________

Follow-up Comment #29:

Reopening.

@Rik:
It looks that one of your edits didn't work out well.

You adapted some adittedly convoluted code in get_inverse_dependencies.m
around L.45+ into:

        idx = cellfun (@(S) strcmp (S.name, pdep_nm), installed_pkgs_lst);
        installed_pkgs_lst{idx}.invdeps(end+1) =
{installed_pkgs_lst{i}.name};


A problem appears if 'idx' happens to contain only zeros (see below). 'idx' is
a pointer to an installed dependency in the list of installed packages.
'idx' however is empty if a direct or indirect dependency of some
package-to-be-unloaded happens to be not installed. In that case I get an
error along the lines of:

error: a cs-list cannot be further indexed
error: called from
    get_inverse_dependencies at line 46 column 55
    unload_packages at line 36 column 22
    pkg at line 534 column 7


I experimented a bit with cell indexing aong the lines of 

a = {1 2 3};
a([false false false]) = 6;


and that works OK ('a' remains untouched), but in the pertinent L.47 in
get_inverse_dependencies.m it doesn't work as intended.
I avoided this error by wrapping the ensuing assignment in an if construct, as
in attached patch.

In addition, you turned the strcmpi call into strcmp; I deliberately used
strcmpi to cater for sloppy package developers and/or sloppy package review,
and/or maybe to do away with strict capitalization rules for package
dependencies in package DESCRIPTION files.


(file #48332)
    _______________________________________________________

Additional Item Attachment:

File name: bug_57522_avoid_unload_error_uninstalled_deps.cset Size:1 KB
   
<https://savannah.gnu.org/file/bug_57522_avoid_unload_error_uninstalled_deps.cset?file_id=48332>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57522>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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