Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 560878 - app-portage/gentoolkit-dev - ekeyword.py: fail on ineffective update
Summary: app-portage/gentoolkit-dev - ekeyword.py: fail on ineffective update
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2015-09-20 07:40 UTC by Jeroen Roovers (RETIRED)
Modified: 2016-03-29 08:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gentoolkit-dev-9999-ekeyword.py-fail-on-planned-update.patch (gentoolkit-dev-9999-ekeyword.py-fail-on-planned-update.patch,245 bytes, patch)
2015-09-20 07:41 UTC, Jeroen Roovers (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2015-09-20 07:40:30 UTC
Currently, ekeyword.py returns 0 when you request a keyword change that has no effect. It would be useful to have it return something else (I suggest 2) so that in keywording scripts, you can use that information to correct the request before you commit.

A simple use case would be where you have tested two architectures and request a stabilisation for both but one is already stable. When you have scripted the commit message to reflect a change for both architectures, and only one gets updated, you would want to catch that.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2015-09-20 07:41:10 UTC
Created attachment 412312 [details, diff]
gentoolkit-dev-9999-ekeyword.py-fail-on-planned-update.patch
Comment 2 SpanKY gentoo-dev 2016-03-29 08:38:49 UTC
Comment on attachment 412312 [details, diff]
gentoolkit-dev-9999-ekeyword.py-fail-on-planned-update.patch

this is incorrect for a bunch of reasons:
- exit should pretty much never be used; you want sys.exit instead
- ekeyword is a library, so calling exit is never correct
- libs should be passing back up values, not exiting -- this already has |updated|
- process_content() is the right func to actually pass back a diff value
- this code aborts after updating a single ebuild when there might be many more
Comment 3 SpanKY gentoo-dev 2016-03-29 08:40:23 UTC
an exit of 2 wouldn't help out your automated use case.  unless you can think of a better CLI here, i think the best answer is to import ekeyword yourself and call its API.  the module has been written explicitly with re-use in mind.