Gentoo Archives: gentoo-portage-dev

From: Alec Warner <antarus@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] New proposed modular sync system
Date: Thu, 09 Jan 2014 19:15:25
Message-Id: CAAr7Pr-SQKNpq-+EAX5m2XkygtMPWBEQ7XKucpSJcawQyBEQ8g@mail.gmail.com
In Reply to: [gentoo-portage-dev] New proposed modular sync system by Brian Dolbec
1 On Thu, Jan 9, 2014 at 9:33 AM, Brian Dolbec <dolsen@g.o> wrote:
2
3 > First off, I know many of you think portage needs to do everything on
4 > it's own. NO outside dependencies.
5 >
6 > BUT! Please hear me out.
7 >
8 > While working on many of gentoo's tools gentoolkit's equery, eclean,
9 > enalyze, Layman, mirrorselect, etc.. I have found that there was a lot
10 > of needless code duplication. Both within the apps themselves and
11 > copying/re-inventing the nearly identical code in other apps.
12 >
13 > I want to move many of gentoo's core applications to using some more
14 > shared libraries. But that in itself is not a topic to discuss in this
15 > thread. Please, do not sidetrack this thread. The above is only for
16 > background info leading to this proposed change. This proposal follows
17 > along that thinking.
18 >
19 > Many years ago after re-writing ecleans code I began re-writing
20 > portage's emaint code so that it could be imported and used internally
21 > in eclean to re-generate the Packages binpkg index file. In that code I
22 > found a todo which said "make a plug-in system so we don't have to keep
23 > modifying this code" or something along those lines. So I did. It
24 > took 4 years+, rebasing many times and migrating vcs's, but Zac finally
25 > merged it. It has been used in portage for more than a year. That
26 > plug-in system I designed to be very flexible and basic. It can be used
27 > for many areas of portage to simplify it's code and the maintenance
28 > required to keep current with changes in repository types, and transfer
29 > methods.
30 >
31 > I have started a Proposals sub-page under the Portage project page in
32 > the wiki. It has a link to a diagram I made showing how the plug-in
33 > system is laid out. This thread will be used to discuss the proposal
34 > and the details needed for the module_spec dictionary that is used to
35 > provide the manager with the details of what a module provides, options,
36 > etc..
37 >
38 > For a working example of the system in action, just try out emaint -h,
39 > and some other actions it provides. Then move one of it's modules out
40 > of the the emaint/modules/ directory and re-try emaint -h. You will see
41 > the options for that module and it's actions are no longer available.
42 > No code editing was required, no errors occurred,... Put it back,
43 > retry...
44 >
45 > The modular sync system I propose would re-use that plug-in manager to
46 > interface the sync manager code with the modules that perform the sync
47 > actions. This sytem is easily extended with new modules for different
48 > transfer methods or VCS specific modules.
49 >
50 > This also makes it possible for other gentoo applications like layman to
51 > install a layman specific module which syncs all layman overlays that it
52 > installs. All this done with out effort on the part of the portage team
53 > either for maintenance or code changes to support it's addition. The
54 > same can be said for Funtoo, if our git module is not suiotable, they
55 > just install their own custom sync module. Done :)
56 >
57 > These add-on sync modules can also be installed via their own ebuild.
58 >
59 > For example: Zac has for years had a custom script that syncs the
60 > portage tree and makes a squashfs version of it which he uses for his
61 > PORTDIR. it is faster than a normal one. He, or someone else could make
62 > a app-portage/squashfs-sync ebuild that installs a module for that
63 > purpose. The user then just needs to edit his repos.conf file and
64 > change the sync-type to squashfs. Then emerge --sync will do it
65 > automatically without user intervention and auxiliary scripts run
66 > manually or cron job.
67 >
68 > This system would also make it possible to modify emerge-s cli to accept
69 > target repos to sync. and not any others also installed. Similarly to
70 > "layman -s some-overlay", "emerge --sync some-overlay"
71 >
72 >
73 I think the opposition to this idea primarily falls on reliability. There
74 have been a number of hacks to portage over the years to keep it
75 functioning during upgrades of itself, even down to the non-standard place
76 where its .py files are stored (/usr/lib/portage/pym?) So the real question
77 is when we move to a plug-in architecture, how do we add, remove, upgrade
78 the plugins without breaking the actual package manager?
79
80 -A
81
82
83
84
85 > P.S. sorry for such a long email
86 > --
87 > Brian Dolbec <dolsen@g.o>
88 >

Replies

Subject Author
Re: [gentoo-portage-dev] New proposed modular sync system Brian Dolbec <dolsen@g.o>