[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls |
Date: |
Fri, 30 Apr 2021 12:18:48 -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 #14, bug #60472 (project octave):
ok, applying the patch the the latest version of 6.2.1 stable:
before patch, prefix starts local as it should, -global call makes persistent
change to subsequent calls to global package location:
>> pkg prefix
Installation prefix: C:\Users\NICHOL~1.JAN\octave
Architecture dependent prefix: C:\Users\NICHOL~1.JAN\octave
>> pkg install -global abc
error: pkg: file not found: abc.
This looks like an Octave Forge package name. Did you mean:
pkg install -forge abc
error: called from
pkg at line 554 column 19
>> pkg prefix
Installation prefix:
C:\Programs\Octave\OCTAVE~2\mingw64\share\octave\packages
Architecture dependent prefix:
C:\Programs\Octave\OCTAVE~2\mingw64\lib\octave\packages
after applying the patch:
>> pkg prefix
Installation prefix: C:\Users\NICHOL~1.JAN\octave
Architecture dependent prefix: C:\Users\NICHOL~1.JAN\octave
>> pkg install -global abc
error: pkg: file not found: abc.
This looks like an Octave Forge package name. Did you mean:
pkg install -forge abc
error: called from
pkg at line 554 column 19
>> pkg prefix
Installation prefix: C:\Users\NICHOL~1.JAN\octave
Architecture dependent prefix: C:\Users\NICHOL~1.JAN\octave
so prefix now reverts to the proper context on the next call to pkg. This
appears to fix at least part of the problem. running a single -global
install/uninstall will not change the default local/global behavior, and
subsequent packages will go to their default location.
>> pkg list ga
package ga is not installed.
>> pkg install -global -forge ga
For information about changes from previous versions of the ga package, run
'news ga'.
>> pkg list ga
Package Name | Version | Installation directory
--------------+---------+-----------------------
ga | 0.10.2 |
...\Octave\octave-stable\mingw64\share\octave\packages\ga-0.10.2
>> pkg list arduino
package arduino is not installed.
>> pkg install -forge arduino
For information about changes from previous versions of the arduino package,
run 'news arduino'.
>> pkg list arduino ga
Package Name | Version | Installation directory
--------------+---------+-----------------------
arduino | 0.7.0 | C:\Users\nicholas.jankowski\octave\arduino-0.7.0
ga | 0.10.2 |
...\Octave\octave-stable\mingw64\share\octave\packages\ga-0.10.2
this should solve the main issue that kicked off this bug report trying to
manage locally and globally installed packages. pkg update should behave
better as well since it doesn't currently take -local/-global options.
checking the behavior of prefix, it appears a manual setting does take
priority over any following -local or -global statements.
>> pkg prefix
Installation prefix: C:\Users\NICHOL~1.JAN\octave
Architecture dependent prefix: C:\Users\NICHOL~1.JAN\octave
>> pkg list arduino
package arduino is not installed.
>> pkg list ga
package ga is not installed.
>> pkg prefix C:\Programs\Octave\testpackages C:\Programs\Octave\testpackages
ans = C:\Programs\Octave\testpackages
>> pkg prefix
Installation prefix: C:\Programs\Octave\testpackages
Architecture dependent prefix: C:\Programs\Octave\testpackages
>> pkg install -global -forge arduino
For information about changes from previous versions of the arduino package,
run 'news arduin
o'.
>> pkg list arduino
Package Name | Version | Installation directory
--------------+---------+-----------------------
arduino | 0.7.0 | C:\Programs\Octave\testpackages\arduino-0.7.0
>> pkg install -local -forge ga
For information about changes from previous versions of the ga package, run
'news ga'.
>> pkg list ga
Package Name | Version | Installation directory
--------------+---------+-----------------------
ga | 0.10.2 | C:\Programs\Octave\testpackages\ga-0.10.2
>> load(pkg('local_list'))
>> local_packages
local_packages =
{
[1,1] =
scalar structure containing the fields:
name = ga
version = 0.10.2
date = 2020-12-02
author = Luca Favatella <slackydeb@gmail.com>
maintainer = Octave-Forge community <maintainers@octave.org>
title = Genetic Algorithm
description = Genetic optimization code
categories = Optimization
depends =
{
[1,1] =
scalar structure containing the fields:
package = octave
operator = >=
version = 3.4.0
}
autoload = yes
license = GPL version 3 or later
url = http://octave.sf.net
dir = C:\Programs\Octave\testpackages\ga-0.10.2
archprefix = C:\Programs\Octave\testpackages\ga-0.10.2
}
>> load(pkg('global_list'))
>> global_packages(end)
ans =
{
[1,1] =
scalar structure containing the fields:
name = arduino
version = 0.7.0
date = 2021-04-28
author = John Donoghue <john.donoghue@ieee.org>
maintainer = John Donoghue <john.donoghue@ieee.org>
title = Octave Arduino Toolkit
description = Basic Octave implementation of the matlab arduino
extension, allowing co
mmunication to a programmed arduino board to control its hardware.
categories = Arduino Toolkit
depends =
{
[1,1] =
scalar structure containing the fields:
package = octave
operator = >=
version = 4.0.0
[1,2] =
scalar structure containing the fields:
package = instrument-control
operator = >=
version = 0.3.0
}
systemrequirements = arduino-ide (>= 1.5)
license = GPLv3+
url = https://octave.sourceforge.io/arduino/
dir = C:\Programs\Octave\testpackages\arduino-0.7.0
archprefix = C:\Programs\Octave\testpackages\arduino-0.7.0
}
So, after a prefix change, -local and -global flags will not change the
install location, but they will populate the appropriate local and global
package lists. I think this behavior makes sense and is consistent with intent
unless someone knows otherwise.
It would be nice if there was a 'pkg prefix -default' option to force a reset
back to default paths and set user_prefix back to false without the need to
close/restart octave. but maybe the wishlist is stretching a bit long for, as
Kai said, what is already a bit of an overburdened tool.
TL;DR: absent any other issues, Markus's patch seems to fix the primary issue
that prompted this bug report. As the rmdir bug was fixed elsewhere, I would
consider it complete.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60472>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, (continued)
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Nicholas Jankowski, 2021/04/29
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Philip Nienhuis, 2021/04/29
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Nicholas Jankowski, 2021/04/29
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Nicholas Jankowski, 2021/04/29
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Nicholas Jankowski, 2021/04/29
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Kai Torben Ohlhus, 2021/04/30
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Nicholas Jankowski, 2021/04/30
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Markus Mützel, 2021/04/30
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Nicholas Jankowski, 2021/04/30
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Nicholas Jankowski, 2021/04/30
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls,
Nicholas Jankowski <=
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Mike Miller, 2021/04/30
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Markus Mützel, 2021/04/30
- [Octave-bug-tracker] [bug #60472] pkg -global option changes pkg prefix for subsequent calls, Nicholas Jankowski, 2021/04/30