layman icon indicating copy to clipboard operation
layman copied to clipboard

Allow adding repositories recursively

Open Hummer12007 opened this issue 7 years ago • 12 comments

See https://bugs.gentoo.org/545568

Hummer12007 avatar Apr 04 '17 20:04 Hummer12007

overall, looks good. just the one configparser issue

dol-sen avatar Apr 04 '17 21:04 dol-sen

How were you thinking of dealing with the main repo? in this case "gentoo"

We have been trying to get way from the main-repo configuration. I'll poke Zac to have a look at this, see what he thinks is the best way. I'm thinking in terms of portability to other distros, there are a bunch of them, ie: funtoo, sabayon, calculate,...

dol-sen avatar Apr 04 '17 21:04 dol-sen

lgtm

zmedico avatar Apr 04 '17 21:04 zmedico

I was thinking (about other distros) and figured out that there's no universal solution (apart from looking at repos.conf). And anyway, it just prompts before adding each repo, so the user will have to react (and willingfully accept the repo). Or we could just special case gentoo (as almost every overlay has it in masters).

Hummer12007 avatar Apr 04 '17 21:04 Hummer12007

oh, instead of hard coding the special case.

Why don't we add another config item for it. Then it is easily changed...

provided-masters:

it can be a list like the old overlays and some other variables in the config That should take care of Funtoo's new split repo stuff they are working on.

dol-sen avatar Apr 04 '17 22:04 dol-sen

Done.

Hummer12007 avatar Apr 04 '17 23:04 Hummer12007

apart from looking at repos.conf

If it's acceptable to use the portage api, then something like this would work:

Python 3.4.5 (default, Mar 12 2017, 00:44:50) 
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import portage
>>> 'gentoo' in portage.settings.repositories
True

zmedico avatar Apr 05 '17 00:04 zmedico

From what I've seen, portage APIs are only used in a module or two (not in "core" layman).

Hummer12007 avatar Apr 05 '17 00:04 Hummer12007

Yeah, I tried to keep from using portage api's as much as possible. That way it would be easier to incorporate and.or use in different package managers. The news system is configurable to the point that a custom module could be used, but defaults to the portage API.

This looks really good now. Thank you Zac, my mail client (claws-mail) no longer self fetches unless I manually change directories, then back. So I missed notification of the changes.

I like it. Zac, by using the provided_masters config, it makes it possible for users to add masters not under layman control, not just the main "gentoo" repo.

dol-sen avatar Apr 05 '17 02:04 dol-sen

I like it. Zac, by using the provided_masters config, it makes it possible for users to
add masters not under layman control, not just the main "gentoo" repo.

It you have a way to query the names of configured repositories then you don't need that. For example, the app-portage/gentoopm package provides a gentoopmq tool that can do it:

$ gentoopmq repositories
gentoo local python

zmedico avatar Apr 05 '17 02:04 zmedico

Problems may arise in some corner cases when using gentoopmq API, seems to me, esp. when the user has several package managers installed, additionally, in case the downstream distro maintains their own version of the portage tree (named differently than 'gentoo', albeit kept in ~sync with the upstream tree). IIRC, funtoo does (or did) exactly that.

Hummer12007 avatar Apr 09 '17 19:04 Hummer12007

Funtoo is in the process of splitting the repository up into logical groups. That they feel would be better for maintaining things like a stable xorg. A user could then also exclude certain sub-repos they don't need. The split repos could then use branches for different stability stages instead of just {'',-arch,~arch, arch} We could eventually set up a means to specify the means to obtaining the installed list via a pkg manager similar to what I did for the news.

dol-sen avatar Apr 09 '17 22:04 dol-sen