diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 62950b5..86ca230 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1116,13 +1116,9 @@ class StageBase(TargetBase, ClearBase, GenBase): for hostuseexpand in myuseexpandvars: myf.write(hostuseexpand + '="' + ' '.join(myuseexpandvars[hostuseexpand]) + '"\n') - myf.write('PORTDIR="%s"\n' % self.settings['portdir']) myf.write('DISTDIR="%s"\n' % self.settings['distdir']) myf.write('PKGDIR="%s"\n' % self.settings['packagedir']) - # Setup the portage overlay - if "portage_overlay" in self.settings: - myf.write('PORTDIR_OVERLAY="/usr/local/portage"\n') # Set default locale for system responses. #478382 myf.write( @@ -1132,6 +1128,19 @@ class StageBase(TargetBase, ClearBase, GenBase): 'LC_MESSAGES=C\n') myf.close() + + # Create repos.conf (for the chroot) + repos_conf_path = normpath(self.settings["chroot_path"] + self.settings["repos_conf"]) + cmd("rm -fr " + repos_conf_path, "Could not remove " + repos_conf_path, env=self.env) Why the rm -fr??? + cmd("mkdir -p " + repos_conf_path) We are using ensure_dirs in catalyst, see fileops.py. There is even a clear_dir() + with open(os.path.join(repos_conf_path, "gentoo.conf"), "w") as myf: + myf.write("[gentoo]\nlocation = %s\n" % self.settings["portdir"]) + # Set up the local repository + if "portage_overlay" in self.settings: + with open(os.path.join(repos_conf_path, "local.conf"), "w") as myf: + myf.write("[local]\nlocation = %s\n" % self.settings["local_overlay"]) + + self.resume.enable("chroot_setup") def fsscript(self): That looks wrong, 2 blank lines then the self.resume.enable call, then one blank line between the next def below @@ -1171,13 +1180,12 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["chroot_path"]+"/etc/hosts",\ "Could not replace /etc/hosts",env=self.env) - # Remove our overlay + # Remove the local repository if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]): cmd("rm -rf " + self.settings["chroot_path"] + self.settings["local_overlay"], "Could not remove " + self.settings["local_overlay"], env=self.env) - cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\ - self.settings["make_conf"],\ - "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env) + cmd("rm -f" + os.path.join(normpath(self.settings["chroot_path"] + self.settings["repos_conf"]), "local.conf"), + "Could not remove local repository from repos.conf",env=self.env) /\ please run the pylint command Mike has made for catalyst missing one space after the comma # Clean up old and obsoleted files in /etc if os.path.exists(self.settings["stage_path"]+"/etc"): diff --git a/catalyst/defaults.py b/catalyst/defaults.py index c5162d6..28435e0 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -32,6 +32,7 @@ confdefaults={ "local_overlay": "/usr/local/portage", "port_conf": "/etc/portage", "make_conf": "%(port_conf)s/make.conf", + "repos_conf": "%(port_conf)s/repos.conf", "options": set(), "packagedir": "/usr/portage/packages", "portdir": "/usr/portage", The patch is mostly good. Please fix those few things and re-submit.