commit: 381f692ac7bc72a1cdc0029b24f8f33558a9c5c2
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sat May 2 01:25:55 2020 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sun May 3 22:55:53 2020 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=381f692a
catalyst: Replace target_portdir with repo_basedir+repo_name
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
catalyst/base/stagebase.py | 12 +++++++++---
catalyst/defaults.py | 2 +-
doc/catalyst-config.5.txt | 10 +++++-----
targets/stage2/chroot.sh | 2 +-
targets/support/livecdfs-update.sh | 2 +-
5 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index bb008744..80cc16f2 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -192,7 +192,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
self.mount = MOUNT_DEFAULTS.copy()
self.mount['portdir']['source'] = self.snapshot
- self.mount['portdir']['target'] = self.settings['target_portdir']
+ self.mount['portdir']['target'] = self.settings['repo_basedir'] + '/'
+ self.settings['repo_name']
self.mount['distdir']['source'] = self.settings['distdir']
self.mount["distdir"]['target'] = self.settings['target_distdir']
@@ -803,7 +803,8 @@ class StageBase(TargetBase, ClearBase, GenBase):
make_profile = Path(self.settings['chroot_path'] +
self.settings['port_conf'],
'make.profile')
make_profile.unlink()
- make_profile.symlink_to(Path('../..' + self.settings['target_portdir'],
+ make_profile.symlink_to(Path('../..' + self.settings['repo_basedir'],
+ self.settings['repo_name'],
'profiles',
self.settings['target_profile']),
target_is_directory=True)
@@ -1056,7 +1057,12 @@ class StageBase(TargetBase, ClearBase, GenBase):
' '.join(myuseexpandvars[hostuseexpand]) + '"\n')
# Write non-default PORTDIR/DISTDIR/PKGDIR settings to make.conf
- for x in ['target_portdir', 'target_distdir', 'target_pkgdir']:
+ 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']))
+
+ 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')
diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index bbefa3a8..9d5771d5 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -65,6 +65,7 @@ confdefaults = {
"pkgdir": "/var/cache/binpkgs",
"port_tmpdir": "/var/tmp/portage",
"PythonDir": "./catalyst",
+ "repo_basedir": "/var/db/repos",
"repo_name": "gentoo",
"repos": "%(storedir)s/repos",
"sharedir": "/usr/share/catalyst",
@@ -73,7 +74,6 @@ confdefaults = {
"storedir": "/var/tmp/catalyst",
"target_distdir": "/var/cache/distfiles",
"target_pkgdir": "/var/cache/binpkgs",
- "target_portdir": "/var/db/repos/gentoo",
}
DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf'
diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
index 11b27d90..d5444b38 100644
--- a/doc/catalyst-config.5.txt
+++ b/doc/catalyst-config.5.txt
@@ -108,6 +108,11 @@ Defaults to the host's DISTDIR.
The directory in which git repositories exist for use by the snapshot target.
Defaults to `${storedir}/repos`.
+*repo_basedir*::
+The target repository directory to contain the primary repo (e.g.,
+gentoo repo) and any overlays. The default location is
+`/var/db/repos`.
+
*repo_name*::
The name of the main repository (e.g. gentoo). The git repository at
`${repos}/${repo_name}.git` will be used to produce the portdir sqfs
@@ -123,11 +128,6 @@ Defines the location of binary packages in the target.
This will be
written to the target's make.conf if it is not the default value of
`/var/cache/binpkgs`.
-*target_portdir*::
-Defines the location of the main ebuild repository in the target.
-This will be written to the target's make.conf if it is not the
-default value of `/var/db/repos/gentoo`.
-
Other settings
~~~~~~~~~~~~~~
diff --git a/targets/stage2/chroot.sh b/targets/stage2/chroot.sh
index aac9a92d..bf98d328 100755
--- a/targets/stage2/chroot.sh
+++ b/targets/stage2/chroot.sh
@@ -9,7 +9,7 @@ export CONFIG_PROTECT="-* /etc/locale.gen"
echo "$locales" > /etc/locale.gen
## START BUILD
-${clst_target_portdir}/scripts/bootstrap.sh ${bootstrap_opts} || exit 1
+${clst_repo_basedir}/${clst_repo_name}/scripts/bootstrap.sh ${bootstrap_opts}
|| exit 1
# Replace modified /etc/locale.gen with default
etc-update --automode -5
diff --git a/targets/support/livecdfs-update.sh
b/targets/support/livecdfs-update.sh
index 8297e60d..b1049671 100755
--- a/targets/support/livecdfs-update.sh
+++ b/targets/support/livecdfs-update.sh
@@ -257,7 +257,7 @@ case ${clst_livecd_type} in
USE="-* $(cat /var/db/pkg/sys-libs/glibc*/USE)" emerge -eqp
@system | grep -e '^\[ebuild' | sed -e 's:^\[ebuild .\+\] ::' -e 's: .\+$::' >
/usr/livecd/systempkgs.txt
# This is my hack to reduce tmpfs usage
- cp -r ${clst_target_portdir}/{profiles,eclass} /usr/livecd
+ cp -r ${clst_repo_basedir}/${clst_repo_name}/{profiles,eclass}
/usr/livecd
rm -rf
/usr/livecd/profiles/{co*,default-{1*,a*,b*,d*,h*,i*,m*,p*,s*,x*},g*,hardened-*,n*,x*}
mv -f /etc/gconf /usr/livecd
ln -sf /usr/livecd/gconf /etc/gconf