From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6A525138350 for ; Sat, 2 May 2020 01:41:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D3F2EE0A6D; Sat, 2 May 2020 01:41:00 +0000 (UTC) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CC69AE0A6D for ; Sat, 2 May 2020 01:41:00 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id t40so647548pjb.3 for ; Fri, 01 May 2020 18:41:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QW8FZlwWLGCfVPyZuDBu5c/RzmPI6IQcgaAPeMop7cA=; b=ib2q9nagxmBmEL4LPNZVi/uIrgHsCcVrlGsP7nLfCmeSwJ5kD2om6JtDDdlnEvcX+y WFmt6esGgZ5XoThhCfsUuyHltvOIo+M8BRaBf+zaJRr15yaPQYc1pMqC7fP0KMt7Coky hUXRKgAwug/U8ZRcu1b93G+9Ic4y1V2xPi5TnbzTS1M+mm7mrfv5hKf0CzNfCZeWdMEy /ZlYHGFL7NoMdYxOj9U/VxNyOXU8kFonsUEgT7v+K9+WZqwOlN8OykqmOSsK/UlkYfYh mLdVyQTHGyDLuTHaoTZWyYIXXyhciMIPr/EOWsUCNalpW0xJXHeuDkUzYrRtsX/coifp 6jEg== X-Gm-Message-State: AGi0PuYK3zyg2w7pOHeICw6439lr9bXK6OLzxM39ODOMuCOtqT+ShuS1 w9l9ECURAL7C8ffgxBfzd7ihUJr8 X-Google-Smtp-Source: APiQypKdfh6e01aakYWLKiNULgDXVWDg7KtHTbxANDuefJigGc4nRffmMAZrFx3zziyk27gSQsXEYQ== X-Received: by 2002:a17:90a:840e:: with SMTP id j14mr2763091pjn.85.1588383659421; Fri, 01 May 2020 18:40:59 -0700 (PDT) Received: from localhost ([108.161.26.224]) by smtp.gmail.com with ESMTPSA id 7sm2988302pga.15.2020.05.01.18.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2020 18:40:58 -0700 (PDT) From: Matt Turner To: gentoo-catalyst@lists.gentoo.org Cc: Matt Turner Subject: [gentoo-catalyst] [PATCH 8/8] catalyst: Replace target_portdir with repo_basedir+repo_name Date: Fri, 1 May 2020 18:40:36 -0700 Message-Id: <20200502014036.1039317-8-mattst88@gentoo.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200502014036.1039317-1-mattst88@gentoo.org> References: <20200502014036.1039317-1-mattst88@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: e48d7106-4c6c-41d8-a321-6093620dd672 X-Archives-Hash: bdc003a4e83b9269dddf455e87c3adb7 Signed-off-by: Matt Turner --- 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 7c82029a..ee57d2de 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 -- 2.26.2