Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:master commit in: doc/, catalyst/base/
Date: Thu, 30 Apr 2020 23:06:34
Message-Id: 1588287874.c98bd2b223fab1a2784427d8b09fe8a682647bf4.mattst88@gentoo
1 commit: c98bd2b223fab1a2784427d8b09fe8a682647bf4
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 22 00:57:34 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 30 23:04:34 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=c98bd2b2
7
8 catalyst: Only write out non-default paths to make.conf
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 catalyst/base/stagebase.py | 11 +++++++----
13 doc/catalyst-config.5.txt | 19 +++++++++----------
14 2 files changed, 16 insertions(+), 14 deletions(-)
15
16 diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
17 index 1f091829..affdabbe 100644
18 --- a/catalyst/base/stagebase.py
19 +++ b/catalyst/base/stagebase.py
20 @@ -14,7 +14,7 @@ from snakeoil.osutils import pjoin
21 from DeComp.compress import CompressMap
22
23 from catalyst import log
24 -from catalyst.defaults import (MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN)
25 +from catalyst.defaults import (confdefaults, MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN)
26 from catalyst.support import (CatalystError, file_locate, normpath,
27 cmd, read_makeconf, ismount, file_check)
28 from catalyst.base.targetbase import TargetBase
29 @@ -1055,9 +1055,12 @@ class StageBase(TargetBase, ClearBase, GenBase):
30 myf.write(hostuseexpand + '="' +
31 ' '.join(myuseexpandvars[hostuseexpand]) + '"\n')
32
33 - myf.write('PORTDIR="%s"\n' % self.settings['target_portdir'])
34 - myf.write('DISTDIR="%s"\n' % self.settings['target_distdir'])
35 - myf.write('PKGDIR="%s"\n' % self.settings['target_pkgdir'])
36 + # Write non-default PORTDIR/DISTDIR/PKGDIR settings to make.conf
37 + for x in ['target_portdir', 'target_distdir', 'target_pkgdir']:
38 + if self.settings[x] != confdefaults[x]:
39 + varname = x.split('_')[1].upper()
40 + myf.write(f'{varname}="{self.settings[x]}"\n')
41 +
42 if setup:
43 # Setup the portage overlay
44 if "portage_overlay" in self.settings:
45
46 diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
47 index b7d493eb..11b27d90 100644
48 --- a/doc/catalyst-config.5.txt
49 +++ b/doc/catalyst-config.5.txt
50 @@ -114,20 +114,19 @@ The name of the main repository (e.g. gentoo). The git repository at
51 snapshot.
52
53 *target_distdir*::
54 -This is the target distfiles directory location for the stage being created.
55 -This is important because this value will be stored in the stage's make.conf
56 -and will become the default location used if it is not edited by users.
57 -The default location is `/var/cache/distfiles`.
58 +Defines the location of the local source file repository in the
59 +target. This will be written to the target's make.conf if it is not
60 +the default value of `/var/cache/distfiles`.
61
62 *target_pkgdir*::
63 -This is the target packages directory for storing binpkgs in the stage being
64 -built. This location is stored in the make.conf of the stage being built.
65 -The default location is `/var/cache/binpkgs`
66 +Defines the location of binary packages in the target. This will be
67 +written to the target's make.conf if it is not the default value of
68 +`/var/cache/binpkgs`.
69
70 *target_portdir*::
71 -Defines the location of main repository in the target stages. This
72 -location is stored in make.conf of the stage being built.
73 -The default location is `/var/db/repos/gentoo`
74 +Defines the location of the main ebuild repository in the target.
75 +This will be written to the target's make.conf if it is not the
76 +default value of `/var/db/repos/gentoo`.
77
78 Other settings
79 ~~~~~~~~~~~~~~