1 |
commit: 381f692ac7bc72a1cdc0029b24f8f33558a9c5c2 |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 2 01:25:55 2020 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 3 22:55:53 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=381f692a |
7 |
|
8 |
catalyst: Replace target_portdir with repo_basedir+repo_name |
9 |
|
10 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
11 |
|
12 |
catalyst/base/stagebase.py | 12 +++++++++--- |
13 |
catalyst/defaults.py | 2 +- |
14 |
doc/catalyst-config.5.txt | 10 +++++----- |
15 |
targets/stage2/chroot.sh | 2 +- |
16 |
targets/support/livecdfs-update.sh | 2 +- |
17 |
5 files changed, 17 insertions(+), 11 deletions(-) |
18 |
|
19 |
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py |
20 |
index bb008744..80cc16f2 100644 |
21 |
--- a/catalyst/base/stagebase.py |
22 |
+++ b/catalyst/base/stagebase.py |
23 |
@@ -192,7 +192,7 @@ class StageBase(TargetBase, ClearBase, GenBase): |
24 |
self.mount = MOUNT_DEFAULTS.copy() |
25 |
|
26 |
self.mount['portdir']['source'] = self.snapshot |
27 |
- self.mount['portdir']['target'] = self.settings['target_portdir'] |
28 |
+ self.mount['portdir']['target'] = self.settings['repo_basedir'] + '/' + self.settings['repo_name'] |
29 |
self.mount['distdir']['source'] = self.settings['distdir'] |
30 |
self.mount["distdir"]['target'] = self.settings['target_distdir'] |
31 |
|
32 |
@@ -803,7 +803,8 @@ class StageBase(TargetBase, ClearBase, GenBase): |
33 |
make_profile = Path(self.settings['chroot_path'] + self.settings['port_conf'], |
34 |
'make.profile') |
35 |
make_profile.unlink() |
36 |
- make_profile.symlink_to(Path('../..' + self.settings['target_portdir'], |
37 |
+ make_profile.symlink_to(Path('../..' + self.settings['repo_basedir'], |
38 |
+ self.settings['repo_name'], |
39 |
'profiles', |
40 |
self.settings['target_profile']), |
41 |
target_is_directory=True) |
42 |
@@ -1056,7 +1057,12 @@ class StageBase(TargetBase, ClearBase, GenBase): |
43 |
' '.join(myuseexpandvars[hostuseexpand]) + '"\n') |
44 |
|
45 |
# Write non-default PORTDIR/DISTDIR/PKGDIR settings to make.conf |
46 |
- for x in ['target_portdir', 'target_distdir', 'target_pkgdir']: |
47 |
+ if (self.settings['repo_basedir'], self.settings['repo_name']) != \ |
48 |
+ (confdefaults['repo_basedir'], confdefaults['repo_name']): |
49 |
+ myf.write('PORTDIR="%s/%s"\n' % (self.settings['repo_basedir'], |
50 |
+ self.settings['repo_name'])) |
51 |
+ |
52 |
+ for x in ['target_distdir', 'target_pkgdir']: |
53 |
if self.settings[x] != confdefaults[x]: |
54 |
varname = x.split('_')[1].upper() |
55 |
myf.write(f'{varname}="{self.settings[x]}"\n') |
56 |
|
57 |
diff --git a/catalyst/defaults.py b/catalyst/defaults.py |
58 |
index bbefa3a8..9d5771d5 100644 |
59 |
--- a/catalyst/defaults.py |
60 |
+++ b/catalyst/defaults.py |
61 |
@@ -65,6 +65,7 @@ confdefaults = { |
62 |
"pkgdir": "/var/cache/binpkgs", |
63 |
"port_tmpdir": "/var/tmp/portage", |
64 |
"PythonDir": "./catalyst", |
65 |
+ "repo_basedir": "/var/db/repos", |
66 |
"repo_name": "gentoo", |
67 |
"repos": "%(storedir)s/repos", |
68 |
"sharedir": "/usr/share/catalyst", |
69 |
@@ -73,7 +74,6 @@ confdefaults = { |
70 |
"storedir": "/var/tmp/catalyst", |
71 |
"target_distdir": "/var/cache/distfiles", |
72 |
"target_pkgdir": "/var/cache/binpkgs", |
73 |
- "target_portdir": "/var/db/repos/gentoo", |
74 |
} |
75 |
|
76 |
DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf' |
77 |
|
78 |
diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt |
79 |
index 11b27d90..d5444b38 100644 |
80 |
--- a/doc/catalyst-config.5.txt |
81 |
+++ b/doc/catalyst-config.5.txt |
82 |
@@ -108,6 +108,11 @@ Defaults to the host's DISTDIR. |
83 |
The directory in which git repositories exist for use by the snapshot target. |
84 |
Defaults to `${storedir}/repos`. |
85 |
|
86 |
+*repo_basedir*:: |
87 |
+The target repository directory to contain the primary repo (e.g., |
88 |
+gentoo repo) and any overlays. The default location is |
89 |
+`/var/db/repos`. |
90 |
+ |
91 |
*repo_name*:: |
92 |
The name of the main repository (e.g. gentoo). The git repository at |
93 |
`${repos}/${repo_name}.git` will be used to produce the portdir sqfs |
94 |
@@ -123,11 +128,6 @@ Defines the location of binary packages in the target. This will be |
95 |
written to the target's make.conf if it is not the default value of |
96 |
`/var/cache/binpkgs`. |
97 |
|
98 |
-*target_portdir*:: |
99 |
-Defines the location of the main ebuild repository in the target. |
100 |
-This will be written to the target's make.conf if it is not the |
101 |
-default value of `/var/db/repos/gentoo`. |
102 |
- |
103 |
Other settings |
104 |
~~~~~~~~~~~~~~ |
105 |
|
106 |
|
107 |
diff --git a/targets/stage2/chroot.sh b/targets/stage2/chroot.sh |
108 |
index aac9a92d..bf98d328 100755 |
109 |
--- a/targets/stage2/chroot.sh |
110 |
+++ b/targets/stage2/chroot.sh |
111 |
@@ -9,7 +9,7 @@ export CONFIG_PROTECT="-* /etc/locale.gen" |
112 |
echo "$locales" > /etc/locale.gen |
113 |
|
114 |
## START BUILD |
115 |
-${clst_target_portdir}/scripts/bootstrap.sh ${bootstrap_opts} || exit 1 |
116 |
+${clst_repo_basedir}/${clst_repo_name}/scripts/bootstrap.sh ${bootstrap_opts} || exit 1 |
117 |
|
118 |
# Replace modified /etc/locale.gen with default |
119 |
etc-update --automode -5 |
120 |
|
121 |
diff --git a/targets/support/livecdfs-update.sh b/targets/support/livecdfs-update.sh |
122 |
index 8297e60d..b1049671 100755 |
123 |
--- a/targets/support/livecdfs-update.sh |
124 |
+++ b/targets/support/livecdfs-update.sh |
125 |
@@ -257,7 +257,7 @@ case ${clst_livecd_type} in |
126 |
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 |
127 |
|
128 |
# This is my hack to reduce tmpfs usage |
129 |
- cp -r ${clst_target_portdir}/{profiles,eclass} /usr/livecd |
130 |
+ cp -r ${clst_repo_basedir}/${clst_repo_name}/{profiles,eclass} /usr/livecd |
131 |
rm -rf /usr/livecd/profiles/{co*,default-{1*,a*,b*,d*,h*,i*,m*,p*,s*,x*},g*,hardened-*,n*,x*} |
132 |
mv -f /etc/gconf /usr/livecd |
133 |
ln -sf /usr/livecd/gconf /etc/gconf |