From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: Re: [gentoo-catalyst] Re: [PATCH 2/2] Move from PORTDIR_OVERLAY to repos.conf
Date: Sat, 31 Oct 2020 17:24:33 -0400 [thread overview]
Message-ID: <20201031172433.22881e93@rogue1> (raw)
In-Reply-To: <CAEdQ38EgZ-UHNjNhPfnByPDXNtNSKdh+Dj0daWe8wrtbdRxiUQ@mail.gmail.com>
On Fri, 30 Oct 2020 12:07:56 -0400
Matt Turner <mattst88@gentoo.org> wrote:
> On Sun, Oct 18, 2020 at 11:15 AM Felix Bier
> <Felix.Bier@rohde-schwarz.com> wrote:
> >
> > This commit fixes the following issues:
> >
> > * The PORTDIR_OVERLAY variable has been deprecated by Gentoo.
> >
> > With this commit, the variable is no longer written to the
> > generated make.conf. Instead, a config file
> > /etc/portage/repos.conf/<repo-name>.conf
> > is generated for each overlay. The repo name is read from the
> > overlay using the portage API. Internally, portage parses
> > metadata/layout.conf and profiles/repo_name to obtain the name.
> >
> > References:
> > https://wiki.gentoo.org/wiki//etc/portage/make.conf
> > https://wiki.gentoo.org/wiki//etc/portage/repos.conf
> >
> > * All overlays were copied into the same target directory. If the
> > same file name occurred in multiple overlays, the last overlay
> > would overwrite all previous files with this name. In
> > particular, only the metadata/layout.conf of the last overlay was
> > retained, so it was not possible to reference the other overlays
> > e.g. via the masters entry in the layout.conf or the portage-2
> > syntax for specifying a parent profile from another overlay. Also,
> > this created problems when the overlays contained ebuilds
> > for the same package, but with differing versions, because
> > after copying, the target directory contained both versions of
> > the ebuild but only the manifest file of the last overlay.
> >
> > With this commit, each overlay is copied into a separate
> > sub-directory, e.g. /var/gentoo/repos/local/<repo-name>/.
>
> I see this /var/gentoo/repos path used as an example in a few places
> but not actually in any code. I think our example should match the
> default structure these days, e.g., /var/db/repos/<repo-name>.
>
> > This directory is referenced via the location entry in the
> > generated /etc/portage/repos.conf/<repo-name>.conf.
> > ---
> > catalyst/base/stagebase.py | 72
> > ++++++++++++++++++++++++++++---------- catalyst/defaults.py |
> > +
> > + def get_overlay_location(self, repo_name):
> > + """ Construct overlay repo path:
> > /var/gentoo/repos/local/{name} """
> > + return
> > normpath(os.path.join(self.settings['local_overlay'], repo_name)) +
> > + def write_repo_conf(self, repo_name, config):
> > + """ Write ConfigParser to
> > {chroot}/etc/portage/repo.conf/{name}.conf """
> > + repo_conf = self.get_repo_conf_path(repo_name)
> > + chroot_repo_conf = self.settings['chroot_path'] + repo_conf
> > + log.info('Creating repo config %s.', chroot_repo_conf)
> > + ensure_dirs(os.path.dirname(chroot_repo_conf))
>
> Same thing: I'd rather use pathlib and use Path.mkdir and not add new
> uses of ensure_dirs.
>
> > +
> > + try:
> > + with open(chroot_repo_conf, 'w') as myf:
>
> Let's rename myf. The 'my' prefix pattern in catalyst is not a good
> one. Even just 'f' or 'file' would be better, IMO.
>
file is a python reserved word, use _file or some other variant to not
re-assign the python file definition.
next prev parent reply other threads:[~2020-10-31 21:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-17 19:00 [gentoo-catalyst] [PATCH 2/2] Move from PORTDIR_OVERLAY to repos.conf Felix Bier
2020-10-17 20:11 ` Matt Turner
2020-10-18 13:58 ` [Newsletter] " Felix Bier
2020-10-30 16:13 ` Matt Turner
2020-10-18 15:15 ` [gentoo-catalyst] " Felix Bier
2020-10-30 16:07 ` Matt Turner
2020-10-31 21:24 ` Brian Dolbec [this message]
2020-10-31 22:28 ` Matt Turner
2020-11-10 1:03 ` [Newsletter] " Felix Bier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201031172433.22881e93@rogue1 \
--to=dolsen@gentoo.org \
--cc=gentoo-catalyst@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox