Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 762331 - app-portage/gentoolkit: ekeyword has no way to distinguish ebuild arguments aside from the .ebuild file suffix
Summary: app-portage/gentoolkit: ekeyword has no way to distinguish ebuild arguments a...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-12-29 01:51 UTC by Zac Medico
Modified: 2020-12-31 07:26 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2020-12-29 01:51:02 UTC
We'd like to use ekeyword in a git merge driver implementation (see https://archives.gentoo.org/gentoo-portage-dev/message/ddf7e0285b28ac044e5da7e5ce4fec47), but the files that the driver will pass to ekeyword do not necessarily have a .ebuild suffix. Therefore, it would be handy to be able to distinguish ebuild arguments some other way. Perhaps os.path.isfile(arg) would be sufficient.
Comment 2 Brian Dolbec gentoo-dev 2020-12-31 05:45:59 UTC
Looks good to me.  Go ahead from me.
Comment 3 Zac Medico gentoo-dev 2020-12-31 07:26:03 UTC
FWIW, our git merge driver could potentially bypass the argument parsing logic like this:

try:
   ekeyword.process_ebuild(pathname, list(map(ekeyword.arg_to_op, args))
except Exception:
   result = 1
   traceback.print_exc()
else:
   result = 0