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

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

[Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls
Date: Fri, 30 Apr 2021 03:01:23 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36

Follow-up Comment #9, bug #60472 (project octave):

@nrjank: I recently also came across "pkg prefix".  The documented behavior
will be preserved (for backward compatibility) in the version I am working on,
but not every "accidental" undocumented side effect will be preserved. 
Hopefully, the comprehension by the average user will be improved a lot =)

To put a little light into the current pkg magic.  You are dealing with two
concepts:


pkg prefix
pkg local_list / global_list


which in theory are decoupled, but practically they share the very same
persistent variables 😵 🤯

The "pkg prefix" defines where things get installed to.  "prefix" is the
directory for all package files, "archprefix" defines where compiled
ARCHitecture depended stuff ("*.oct" files) go to.  Both can point to the same
directory.

Next you have to distinguish between three categories of (arch)prefixes:

1. global
2. local
3. user defined

The latter one comes out only very implicitly and it not really documented.
https://octave.org/doc/v6.2.0/XREFpkg.html  But once the prefix was changed by
the user is takes absolute precedence until Octave is restarted (thus "pkg
install -local" and "pkg install -global" are not working as expected anymore
and should be called "pkg install -userDefined" for clarity).  Similar with
calling "pkg -global" or "pkg -local" as you observed.  I assume this is an
unforeseen side-effect, due to mixing of two concepts sharing the same
persistent variables and this will be not part of my pkg version.  "pkg
install" becomes an independent command (function), controlled by "pkg
config".

On the other hand "pkg local_list / global_list" define the locations of
"index files" for globally and locally installed packages, respectively.  If
those files are changed, "pkg" "forgets" previous package installations.

Another severe point is, that "pkg list" merges both indices "pkg local_list /
global_list" in a crude way taking precedence for local ("pkg local_list")
packages.

Thus if you had a global and local "tsa" installation, you the local ("pkg
local_list") "tsa" shadows the global ("pkg global_list") one.


Off-topic note:
pkg has grown into an "unnecessary complicated structured" tool.  Some side
effects by sub-commands are hard to oversee and my current refactoring actions
focus on decoupling of responsibilities into separate functions.  All
controlled by a single configuration "pkg config" without any side effects or
actions that can only be reverted easily by an Octave restart.

Still it is work in progress below alpha-status.  I hope to close a bunch of
pkg bugs this summer =)


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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