apjanke / octave-packajoozle

A just-for-fun reworking of GNU Octave's `pkg` tool
GNU General Public License v3.0
4 stars 1 forks source link

pkj review fails if package to be is already installed #40

Closed cbm755 closed 5 years ago

cbm755 commented 5 years ago

I filed a different bug from #39 b/c it looks like a different error:

Octave 5.1.0:

octave:2> pkj review doctest-0.7.0.tar.gz
error: unique: X must be an array or cell array of strings
error: called from
    unique at line 52 column 5
    list_installed_matching at line 180 column 11
    review_package_impl at line 209 column 7
    review_package at line 57 column 7
    pkj>review_package at line 669 column 3
    pkj at line 389 column 7
cbm755 commented 5 years ago

Looks like this is because I already had doctest installed?

apjanke commented 5 years ago

Fixed in https://github.com/apjanke/octave-packajoozle/commit/024350f4fc1b45a1888a42e3d9d4be3b3b2fa2a0.

You do need to uninstall the package before reviewing it, though, because the review process tests installing and uninstalling the package. But now you'll get the right error message:

octave:18> pkj review doctest-0.6.1.tar.gz
error: pkj: review: Cannot install doctest 0.6.1: it is already installed
apjanke commented 5 years ago

You do need to uninstall the package before reviewing it

And this part is fixed in https://github.com/apjanke/octave-packajoozle/commit/eed31836ede76ef47a3649df3d969c28685fe95a. Reviewed packages are now installed to an isolated prefix in a temporary directory, to avoid making you uninstall other packages.


octave:16> pkg list
Package Name   | Version | Installation directory
---------------+---------+-----------------------
      doctest  |   0.6.1 | /Users/janke/octave/doctest-0.6.1
      general  |   2.1.0 | /Users/janke/octave/general-2.1.0
           io  |  2.4.12 | /Users/janke/octave/io-2.4.12
miscellaneous  |   1.2.1 | /Users/janke/octave/miscellaneous-1.2.1
octave:18> pkj review doctest-0.6.1.tar.gz
pkj: review: installing under /var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/packajoozle/pkj-review/places/place-hZbPKA
pkj: build temp dir: /var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/packajoozle/packajoozle-build-doctest-hcw5y0
Installed doctest 0.6.1 from /var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/packajoozle/pkj-review/work-KVmbak/doctest-0.6.1.tar.gz to tmp-pkj-review pkg dir
For information about changes from previous versions of the doctest package, run 'news doctest'.
pkj: unloading: doctest 0.6.1
pkj: uninstalling from tmp-pkj-review: doctest 0.6.1
pkj: packages uninstalled OK
Package review passed for doctest-0.6.1.tar.gz.

They still may interact with other packages on the path, though, so maybe unload stuff (except for dependencies) before reviewing, to be clean.