Gentoo Archives: gentoo-catalyst

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

Replies