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

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

[Octave-bug-tracker] [bug #60574] pkg update ignores -global / -local op


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #60574] pkg update ignores -global / -local options
Date: Tue, 11 May 2021 17:04:27 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36

Follow-up Comment #2, bug #60574 (project octave):

for the first part, passing the global local option, the following seems to be
a quick fix:

replacing line 728:

        if (compare_versions (forge_pkg_version, installed_pkg_version, ">"))
          feval (@pkg, "install", "-forge", installed_pkg_name);
        endif


with 

        if (compare_versions (forge_pkg_version, installed_pkg_version, ">"))
          options_to_pass = varargin (strncmp (varargin, "-", 1));
          options_to_pass(end+1) = "-forge";
          feval (@pkg, "install", options_to_pass{:}, installed_pkg_name);
        endif


passes all -options to pkg install, making sure the last one is -forge.  I
don't think duplicate (two '-forge' options) or 'opposite' options (both
-local and -global) are a problem, it will behave just as pkg install does,
parsing them in order and the final ones taking preference.  

this just leaves adjusting how it generates the local/global lists. currently
if you specify -global, i think it will parse both local and global lists, and
do updates to both in global, versus just updating the ones in global. i.e.,
if I had a local audio and no global one, this would see audio, see in can be
updated, and install that update in global, leaving the old one in local and
the new one to be ignored in global (since local takes precedence).  

as said before i think more consistent would be for -local/-global to only
look at the packages in that location, and only try to update those packages
there.  (in the case above, -global wouldn't even check for an audio update
because it doesn't exist in -global.  update would just look for updates to
what's installed where it's told to look.)

(file #51423)
    _______________________________________________________

Additional Item Attachment:

File name: pkg_update_options_v1.diff     Size:0 KB
   
<https://file.savannah.gnu.org/file/pkg_update_options_v1.diff?file_id=51423>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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