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

Update python2/python3 selection during update #5

Closed
iperi opened this issue May 23, 2016 · 5 comments
Closed

Update python2/python3 selection during update #5

iperi opened this issue May 23, 2016 · 5 comments

Comments

@iperi
Copy link

iperi commented May 23, 2016

I noticed that after world update selection of python2/3 interpreter isn't updated. I'm talking about small version bumps like from 3.3 to 3.4. It is easy to update through command line: eselect python update --python2 and eselect python update --python3. After running emerge --depclean without this update symlink could become invalid.

For clarification: I'm not talking about global python interpreter selection (which should be untouched).

What do you think?

@sakaki-
Copy link
Owner

sakaki- commented May 23, 2016

Hi, yes this would probably be sensible, perhaps as an option though rather than as default behaviour - I guess if someone has e.g. python 3.4 and 3.5 (which are in separate slots) installed, with 3.4 as default, they might get annoyed if eselect python update --python3 kept automatically selecting 3.5 on them...

sakaki- referenced this issue in sakaki-/sakaki-tools May 27, 2016
Underlying adds support for custom updaters (via /etc/genup/updaters.d), and
ebuild installs a few simple examples.
Addresses:
 *) https://github.com/sakaki-/genup/issues/4 and
 *) https://github.com/sakaki-/genup/issues/5;
thanks to ngerstle and iperi for suggesting.
@sakaki-
Copy link
Owner

sakaki- commented May 27, 2016

Hi, I've just released genup-1.0.11, which adds an /etc/genup/updaters.d directory. genup will run all executable files (or symlinks to executable files) found at the top level in that directory, at the end of its run (unless the --no-custom-updaters option is passed), and will immediately exit with an error should any of them return a non-zero exit status. The ebuild includes some examples, in /etc/genup/updaters.d/examples; copy or link these into the /etc/genup/updaters.d directory to have them run. The files /etc/genup/updaters.d/examples/20-python2-version.sh and /etc/genup/updaters.d/examples/21-python3-version.sh should hopefully address your use case if copied up.

I'm very open to pull requests for more sophisticated handlers to place in the examples directory; please address any of those to the genup package within sakaki-tools. Thanks!

@iperi
Copy link
Author

iperi commented May 27, 2016

I have one doubt - the python-updater is run before those scripts. So, after changing python version is not run. I have no idea what actually this python-updater is doing, but is it going to work with this script running order?

@sakaki-
Copy link
Owner

sakaki- commented May 27, 2016

You can always modify the 20-python2-version.sh / 21-python3-version.sh scripts to call python-updater themselves, after they call eselect python update --python2 / --python3. But I don't think that's necessary, as python-updater uses the portage info to find installed versions, rather than just the symlink. Will check.

@sakaki-
Copy link
Owner

sakaki- commented Jun 1, 2016

I think this is OK as is, so closing, but if you get problems with it please re-open or submit a PR on the updater in question (for example, if you want to add in a call to python-updater).
Best, sakaki

@sakaki- sakaki- closed this as completed Jun 1, 2016
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