commit:     06fd1a0cd1a957c14343d9c0440dd606a883ee12
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 11 18:23:26 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Oct 28 16:49:56 2015 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=06fd1a0c

stagebase: robustify portage_confdir setup

When setting up the portage_confdir, we should make sure it exists,
and that we rsync it properly (regardless of the settings given by
the user).

Bugzilla: https://bugs.gentoo.org/538652
Reported-by: Joshua Kinard <kumba <AT> gentoo.org>

 catalyst/base/stagebase.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 3c24dbd..6094109 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -893,8 +893,12 @@ class StageBase(TargetBase, ClearBase, GenBase):
                else:
                        if "portage_confdir" in self.settings:
                                log.info('Configuring %s...', 
self.settings['port_conf'])
-                               cmd("rsync -a " + 
self.settings["portage_confdir"] + "/ " +
-                                       self.settings["chroot_path"] + 
self.settings["port_conf"],
+                               dest = normpath(self.settings['chroot_path'] + 
'/' + self.settings['port_conf'])
+                               ensure_dirs(dest)
+                               # The trailing slashes on both paths are 
important:
+                               # We want to make sure rsync copies the dirs 
into each
+                               # other and not as subdirs.
+                               cmd('rsync -a %s/ %s/' % 
(self.settings['portage_confdir'], dest),
                                        "Error copying %s" % 
self.settings["port_conf"],
                                        env=self.env)
                                self.resume.enable("setup_confdir")

Reply via email to