Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 657206 Details for
Bug 560518
dev-util/catalyst: Create /etc/portage/repos.conf/gentoo.conf in stages
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
catalyst-repos.conf.patch
catalyst-repos.conf.patch (text/plain), 5.15 KB, created by
Arfrever Frehtes Taifersar Arahesis
on 2020-08-28 01:10:18 UTC
(
hide
)
Description:
catalyst-repos.conf.patch
Filename:
MIME Type:
Creator:
Arfrever Frehtes Taifersar Arahesis
Created:
2020-08-28 01:10:18 UTC
Size:
5.15 KB
patch
obsolete
>From 4459a604c2d631f6ae4aaee14a2271c1db4957f8 Mon Sep 17 00:00:00 2001 >From: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> >Date: Fri, 28 Aug 2020 00:53:27 +0000 >Subject: [PATCH] stagebase: Create repos.conf > >Bug: https://bugs.gentoo.org/560518 >Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> >--- > catalyst/base/stagebase.py | 42 ++++++++++++++++++++++++-------------- > catalyst/defaults.py | 1 + > 2 files changed, 28 insertions(+), 15 deletions(-) > >diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py >index df1cb844..96d21e21 100644 >--- a/catalyst/base/stagebase.py >+++ b/catalyst/base/stagebase.py >@@ -980,9 +980,10 @@ class StageBase(TargetBase, ClearBase, GenBase): > if os.path.exists(hosts_file): > os.rename(hosts_file, hosts_file + '.catalyst') > shutil.copy('/etc/hosts', hosts_file) >- # write out the make.conf >+ # Write out make.conf and repos.conf > try: > self.write_make_conf(setup=True) >+ self.write_repos_conf(setup=True) > except OSError as e: > raise CatalystError('Could not write %s: %s' % ( > normpath(self.settings["chroot_path"] + >@@ -1068,23 +1069,12 @@ class StageBase(TargetBase, ClearBase, GenBase): > myf.write(hostuseexpand + '="' + > ' '.join(myuseexpandvars[hostuseexpand]) + '"\n') > >- # Write non-default PORTDIR/DISTDIR/PKGDIR settings to make.conf >- if (self.settings['repo_basedir'], self.settings['repo_name']) != \ >- (confdefaults['repo_basedir'], confdefaults['repo_name']): >- myf.write('PORTDIR="%s/%s"\n' % (self.settings['repo_basedir'], >- self.settings['repo_name'])) >- >+ # Write non-default DISTDIR/PKGDIR settings to make.conf > for x in ['target_distdir', 'target_pkgdir']: > if self.settings[x] != confdefaults[x]: > varname = x.split('_')[1].upper() > myf.write(f'{varname}="{self.settings[x]}"\n') > >- if setup: >- # Setup the portage overlay >- if "portage_overlay" in self.settings: >- myf.write('PORTDIR_OVERLAY="%s"\n' % >- self.settings["local_overlay"]) >- > # Set default locale for system responses. #478382 > myf.write( > '\n' >@@ -1092,6 +1082,27 @@ class StageBase(TargetBase, ClearBase, GenBase): > '# Please keep this setting intact when reporting bugs.\n' > 'LC_MESSAGES=C\n') > >+ def write_repos_conf(self, setup=True): >+ # Modify and write out repos.conf (for the chroot) >+ repos_conf_path = normpath(self.settings["chroot_path"] + >+ self.settings["repos_conf"]) >+ ensure_dirs(repos_conf_path) >+ clear_dir(repos_conf_path) >+ >+ with open(os.path.join(repos_conf_path, "gentoo.conf"), "w") as myf: >+ myf.write("[gentoo]\n") >+ # Write non-default location of gentoo repository >+ if (self.settings["repo_basedir"], self.settings["repo_name"]) != \ >+ (confdefaults["repo_basedir"], confdefaults["repo_name"]): >+ myf.write("location = %s/%s\n" % (self.settings["repo_basedir"], >+ self.settings["repo_name"])) >+ >+ if setup: >+ # 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"]) >+ > def fsscript(self): > if "autoresume" in self.settings["options"] \ > and self.resume.is_enabled("fsscript"): >@@ -1156,15 +1167,16 @@ class StageBase(TargetBase, ClearBase, GenBase): > log.warning("You've been hacking. Clearing target patches: %s", target) > clear_path(target) > >- # Remove our overlay >+ # Remove the local repository > overlay = normpath( > self.settings["chroot_path"] + self.settings["local_overlay"]) > if os.path.exists(overlay): > clear_path(overlay) > > if "sticky-config" not in self.settings["options"]: >- # re-write the make.conf to be sure it is clean >+ # Re-write make.conf and repos.conf to be sure they are clean > self.write_make_conf(setup=False) >+ self.write_repos_conf(setup=False) > > # 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 c153fcc4..9660a7f3 100644 >--- a/catalyst/defaults.py >+++ b/catalyst/defaults.py >@@ -38,6 +38,7 @@ confdefaults = { > "local_overlay": "/var/db/repos/local", > "port_conf": "/etc/portage", > "make_conf": "%(port_conf)s/make.conf", >+ "repos_conf": "%(port_conf)s/repos.conf", > "options": set(), > "pkgdir": "/var/cache/binpkgs", > "port_tmpdir": "/var/tmp/portage", >-- >2.28.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 560518
:
418818
|
420854
|
657204
| 657206