Lines 980-988
class StageBase(TargetBase, ClearBase, GenBase):
Link Here
|
980 |
if os.path.exists(hosts_file): |
980 |
if os.path.exists(hosts_file): |
981 |
os.rename(hosts_file, hosts_file + '.catalyst') |
981 |
os.rename(hosts_file, hosts_file + '.catalyst') |
982 |
shutil.copy('/etc/hosts', hosts_file) |
982 |
shutil.copy('/etc/hosts', hosts_file) |
983 |
# write out the make.conf |
983 |
# Write out make.conf and repos.conf |
984 |
try: |
984 |
try: |
985 |
self.write_make_conf(setup=True) |
985 |
self.write_make_conf(setup=True) |
|
|
986 |
self.write_repos_conf(setup=True) |
986 |
except OSError as e: |
987 |
except OSError as e: |
987 |
raise CatalystError('Could not write %s: %s' % ( |
988 |
raise CatalystError('Could not write %s: %s' % ( |
988 |
normpath(self.settings["chroot_path"] + |
989 |
normpath(self.settings["chroot_path"] + |
Lines 1068-1090
class StageBase(TargetBase, ClearBase, GenBase):
Link Here
|
1068 |
myf.write(hostuseexpand + '="' + |
1069 |
myf.write(hostuseexpand + '="' + |
1069 |
' '.join(myuseexpandvars[hostuseexpand]) + '"\n') |
1070 |
' '.join(myuseexpandvars[hostuseexpand]) + '"\n') |
1070 |
|
1071 |
|
1071 |
# Write non-default PORTDIR/DISTDIR/PKGDIR settings to make.conf |
1072 |
# Write non-default DISTDIR/PKGDIR settings to make.conf |
1072 |
if (self.settings['repo_basedir'], self.settings['repo_name']) != \ |
|
|
1073 |
(confdefaults['repo_basedir'], confdefaults['repo_name']): |
1074 |
myf.write('PORTDIR="%s/%s"\n' % (self.settings['repo_basedir'], |
1075 |
self.settings['repo_name'])) |
1076 |
|
1077 |
for x in ['target_distdir', 'target_pkgdir']: |
1073 |
for x in ['target_distdir', 'target_pkgdir']: |
1078 |
if self.settings[x] != confdefaults[x]: |
1074 |
if self.settings[x] != confdefaults[x]: |
1079 |
varname = x.split('_')[1].upper() |
1075 |
varname = x.split('_')[1].upper() |
1080 |
myf.write(f'{varname}="{self.settings[x]}"\n') |
1076 |
myf.write(f'{varname}="{self.settings[x]}"\n') |
1081 |
|
1077 |
|
1082 |
if setup: |
|
|
1083 |
# Setup the portage overlay |
1084 |
if "portage_overlay" in self.settings: |
1085 |
myf.write('PORTDIR_OVERLAY="%s"\n' % |
1086 |
self.settings["local_overlay"]) |
1087 |
|
1088 |
# Set default locale for system responses. #478382 |
1078 |
# Set default locale for system responses. #478382 |
1089 |
myf.write( |
1079 |
myf.write( |
1090 |
'\n' |
1080 |
'\n' |
Lines 1092-1097
class StageBase(TargetBase, ClearBase, GenBase):
Link Here
|
1092 |
'# Please keep this setting intact when reporting bugs.\n' |
1082 |
'# Please keep this setting intact when reporting bugs.\n' |
1093 |
'LC_MESSAGES=C\n') |
1083 |
'LC_MESSAGES=C\n') |
1094 |
|
1084 |
|
|
|
1085 |
def write_repos_conf(self, setup=True): |
1086 |
# Modify and write out repos.conf (for the chroot) |
1087 |
repos_conf_path = normpath(self.settings["chroot_path"] + |
1088 |
self.settings["repos_conf"]) |
1089 |
ensure_dirs(repos_conf_path) |
1090 |
clear_dir(repos_conf_path) |
1091 |
|
1092 |
with open(os.path.join(repos_conf_path, "gentoo.conf"), "w") as myf: |
1093 |
myf.write("[gentoo]\n") |
1094 |
# Write non-default location of gentoo repository |
1095 |
if (self.settings["repo_basedir"], self.settings["repo_name"]) != \ |
1096 |
(confdefaults["repo_basedir"], confdefaults["repo_name"]): |
1097 |
myf.write("location = %s/%s\n" % (self.settings["repo_basedir"], |
1098 |
self.settings["repo_name"])) |
1099 |
|
1100 |
if setup: |
1101 |
# Set up the local repository |
1102 |
if "portage_overlay" in self.settings: |
1103 |
with open(os.path.join(repos_conf_path, "local.conf"), "w") as myf: |
1104 |
myf.write("[local]\nlocation = %s\n" % self.settings["local_overlay"]) |
1105 |
|
1095 |
def fsscript(self): |
1106 |
def fsscript(self): |
1096 |
if "autoresume" in self.settings["options"] \ |
1107 |
if "autoresume" in self.settings["options"] \ |
1097 |
and self.resume.is_enabled("fsscript"): |
1108 |
and self.resume.is_enabled("fsscript"): |
Lines 1156-1170
class StageBase(TargetBase, ClearBase, GenBase):
Link Here
|
1156 |
log.warning("You've been hacking. Clearing target patches: %s", target) |
1167 |
log.warning("You've been hacking. Clearing target patches: %s", target) |
1157 |
clear_path(target) |
1168 |
clear_path(target) |
1158 |
|
1169 |
|
1159 |
# Remove our overlay |
1170 |
# Remove the local repository |
1160 |
overlay = normpath( |
1171 |
overlay = normpath( |
1161 |
self.settings["chroot_path"] + self.settings["local_overlay"]) |
1172 |
self.settings["chroot_path"] + self.settings["local_overlay"]) |
1162 |
if os.path.exists(overlay): |
1173 |
if os.path.exists(overlay): |
1163 |
clear_path(overlay) |
1174 |
clear_path(overlay) |
1164 |
|
1175 |
|
1165 |
if "sticky-config" not in self.settings["options"]: |
1176 |
if "sticky-config" not in self.settings["options"]: |
1166 |
# re-write the make.conf to be sure it is clean |
1177 |
# Re-write make.conf and repos.conf to be sure they are clean |
1167 |
self.write_make_conf(setup=False) |
1178 |
self.write_make_conf(setup=False) |
|
|
1179 |
self.write_repos_conf(setup=False) |
1168 |
|
1180 |
|
1169 |
# Clean up old and obsoleted files in /etc |
1181 |
# Clean up old and obsoleted files in /etc |
1170 |
if os.path.exists(self.settings["stage_path"]+"/etc"): |
1182 |
if os.path.exists(self.settings["stage_path"]+"/etc"): |