Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composite install-and-uninstall operation #418

Open
jclulow opened this issue Nov 1, 2022 · 2 comments
Open

composite install-and-uninstall operation #418

jclulow opened this issue Nov 1, 2022 · 2 comments

Comments

@jclulow
Copy link

jclulow commented Nov 1, 2022

At present, we have two distinct operations:

  • pkg install, which can add packages to a system, or change the installed version to a specific (perhaps older!) version or even a version from a specific other publisher
  • pkg uninstall, which removes packages from the system

Sometimes, when trying to move between production and development bits, it seems that it can be impossible to get from the current state to an intended target state because these two distinct operations may require the transition through an illegal state to get to the legal target state. For example:

  • a new package (say, newthing) was added to a development version of illumos-gate, which is depended upon by SUNWcs, and version-locked through osnet-incorporation
  • we want to go back to regular illumos packages, so we use a fully-qualified FMRI for osnet-incorporation
  • there is no acceptable version of newthing that can be installed, now, because it only exists in the version of the OS bits that we already have

What we would like to be able to do is something like:

pkg modify -v +osnet-incorporation@$oldversion -newthing

This would attempt, as a single operation, to change the osnet-incorporation version (which would also end up changing the version of most OS packages like SUNWcs) and concurrently remove newthing from the image. The target state should then be legal, and there should be no need to move through an invalid intermediate state to get there.

@jclulow
Copy link
Author

jclulow commented Nov 1, 2022

@citrus-it told me about pkg install --reject $fmri ... which actually does what we need here, if we:

pkg install -v --reject newthing osnet-incorporation@$oldversion

which is excellent news, thank you!

@citrus-it
Copy link
Member

citrus-it commented Nov 1, 2022

Here's a concrete example:

bloody% pkg list -a pciutils pcitool
NAME (PUBLISHER)                                  VERSION                    IFO
system/management/pcitool                         0.5.11-151043.0            ---
system/pciutils                                   3.8.0-151043.0             im-

bloody% pfexec pkg install --reject=system/pciutils pcitool
            Packages to remove:  1
           Packages to install:  1

bloody% pkg list -a pciutils pcitool
NAME (PUBLISHER)                                  VERSION                    IFO
system/management/pcitool                         0.5.11-151043.0            im-
system/pciutils                                   3.8.0-151043.0             ---

It would still be nice to have a more user friendly interface to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants