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

pkgx install should overwrite existing versions #998

Open
felipecrs opened this issue Apr 24, 2024 · 2 comments
Open

pkgx install should overwrite existing versions #998

felipecrs opened this issue Apr 24, 2024 · 2 comments

Comments

@felipecrs
Copy link
Contributor

Let's say I previously had:

pkgx install java@17

Then later:

$ pkgx install java@11
pkgx: already installed: java (openjdk.org^17)

$ echo $?
0

Here is what I think:

  1. pkgx install should uninstall if previously installed and then install again the new version. Just like sudo apt-get install docker-ce-cli=5:25.0.3-1~ubuntu.22.04~jammy.

  2. If 1 is too hard to be implemented, the least pkgx should do is to return a non-zero code when another version of the package is already installed.

This happened in my CI/CD, where I ship an environment with pkgx install java@17, but some services needed to use java@11.

Their pipelines were configured to run pkgx install java@11 but since a succesful exit code was given, the application was still being built with java@17.

@felipecrs felipecrs changed the title pkgx install should overwrite existing versions pkgx install should overwrite existing versions Apr 24, 2024
@jhheider
Copy link
Contributor

yeah, the non-zero exit code feels incorrect.

as far as your CI/CD goes, even something as simple as: rm -r ~/.local/bin || true should be sufficient, if you need to use the install functionality, rather than either an environment or shebang-style invocation.

@felipecrs
Copy link
Contributor Author

as far as your CI/CD goes, even something as simple as: rm -r ~/.local/bin || true should be sufficient, if you need to use the install functionality, rather than either an environment or shebang-style invocation.

Yeah. For now I do pkgx uninstall java before pkgx install.

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