Summary: | portageq: add commands for probing repos.conf | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Nikoli <nikoli> |
Component: | Tools | Assignee: | Portage Tools Team <tools-portage> |
Status: | CONFIRMED --- | ||
Severity: | enhancement | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Nikoli
2015-02-18 17:10:16 UTC
i don't think adding a specific command here is the right way to go. since repos.conf is a collection of ini files, a command that lets you probe fields out of that would be more useful. something like: portageq repositories_configuration <eroot> [section] [key] then you could do: $ portageq repositories_configuration / gentoo location /usr/portage and we can treat the DEFAULT section specially: if the requested key doesn't exist in the DEFAULT section, then look it up in the specified main-repo. # This returns DEFAULT.main-repo. $ portageq repositories_configuration / DEFAULT main-repo gentoo # Since DEFAULT.location doesn't exist, it looks up DEFAULT.main-repo, gets # back e.g. gentoo, then looks up gentoo.location. $ portageq repositories_configuration / DEFAULT location /usr/portage now you have an exact replacement for `portageq envvar PORTDIR`. this doesn't provide a replacement for `portageq envvar PORTDIR_OVERLAYS` though. maybe we can accept options like: portageq repositories_configuration <eroot> [--list] [section] [key] which would let you do: # This would set sections to e.g. gentoo (filters out DEFAULT). sections=$(portageq repositories_configuration / --list) overlays=$(for s in ${sections}; do portageq repositories_configuration / ${s} location; done) by default we should return the sections in order of their priority |