Gentoo Archives: gentoo-catalyst

From: Brian Dolbec <dolsen@g.o>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] [PATCH] stagebase: robustify portage_confdir setup
Date: Wed, 28 Oct 2015 14:32:50
Message-Id: 20151028073154.7640680a.dolsen@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH] stagebase: robustify portage_confdir setup by Mike Frysinger
1 On Sun, 11 Oct 2015 14:28:56 -0400
2 Mike Frysinger <vapier@g.o> wrote:
3
4 > When setting up the portage_confdir, we should make sure it exists,
5 > and that we rsync it properly (regardless of the settings given by
6 > the user).
7 >
8 > Bugzilla: https://bugs.gentoo.org/538652
9 > Reported-by: Joshua Kinard <kumba@g.o>
10 > ---
11 > catalyst/base/stagebase.py | 8 ++++++--
12 > 1 file changed, 6 insertions(+), 2 deletions(-)
13 >
14 > diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
15 > index 4a0b482..740e05d 100644
16 > --- a/catalyst/base/stagebase.py
17 > +++ b/catalyst/base/stagebase.py
18 > @@ -893,8 +893,12 @@ class StageBase(TargetBase, ClearBase, GenBase):
19 > else:
20 > if "portage_confdir" in self.settings:
21 > log.info('Configuring %s...',
22 > self.settings['port_conf'])
23 > - cmd("rsync -a " +
24 > self.settings["portage_confdir"] + "/ " +
25 > - self.settings["chroot_path"]
26 > + self.settings["port_conf"],
27 > + dest =
28 > normpath(self.settings['chroot_path'] + '/' +
29 > self.settings['port_conf'])
30 > + ensure_dirs(dest)
31 > + # The trailing slashes on both paths
32 > are important:
33 > + # We want to make sure rsync copies
34 > the dirs into each
35 > + # other and not as subdirs.
36 > + cmd('rsync -a %s/ %s/' %
37 > (self.settings['portage_confdir'], dest), "Error copying %s" %
38 > self.settings["port_conf"], env=self.env)
39 > self.resume.enable("setup_confdir")
40
41 Yeah, this is definitely better
42
43 --
44 Brian Dolbec <dolsen>