public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: Re: [gentoo-catalyst] [PATCH 8/8] catalyst: Replace target_portdir with repo_basedir+repo_name
Date: Sat, 2 May 2020 16:28:42 -0700	[thread overview]
Message-ID: <20200502162842.372ab7ea@storm> (raw)
In-Reply-To: <20200502014036.1039317-8-mattst88@gentoo.org>

On Fri,  1 May 2020 18:40:36 -0700
Matt Turner <mattst88@gentoo.org> wrote:

> Signed-off-by: Matt Turner <mattst88@gentoo.org>
> ---



Thank you for revesing that.   I have been trying to get away from
legacy use of/meaning of portdir.  Plus I would like to get catlyst
code as bullet-proof/future-proof as possible.  In this way, it would
become easy and logical for derivative distros to re-use and even
contribute back to it's maintenance.  

I would also like to change the use of 'portdir' as the variable name
in self.mount and other locations in the future.  There are too many
legacy references with different meanings that go along with it.

looks good :)


>  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



  reply	other threads:[~2020-05-02 23:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02  1:40 [gentoo-catalyst] [PATCH 1/8] targets: Use gensquashfs instead of mksquashfs Matt Turner
2020-05-02  1:40 ` [gentoo-catalyst] [PATCH 2/8] targets: Drop most fstypes Matt Turner
2020-05-02 23:00   ` Brian Dolbec
2020-05-02 23:17     ` Matt Turner
2020-05-02  1:40 ` [gentoo-catalyst] [PATCH 3/8] targets: Inline filesystem-functions.sh Matt Turner
2020-05-02 23:03   ` Brian Dolbec
2020-05-02 23:18     ` Matt Turner
2020-05-03  0:25       ` Brian Dolbec
2020-05-02  1:40 ` [gentoo-catalyst] [PATCH 4/8] targets: Remove unused source filesystem-functions.sh Matt Turner
2020-05-02 23:06   ` Brian Dolbec
2020-05-02 23:20     ` Matt Turner
2020-05-02 23:51       ` Brian Dolbec
2020-05-02  1:40 ` [gentoo-catalyst] [PATCH 5/8] targets: Remove run_crossdev() function Matt Turner
2020-05-02 23:06   ` Brian Dolbec
2020-05-02 23:22     ` Matt Turner
2020-05-02 23:45       ` Brian Dolbec
2020-05-02  1:40 ` [gentoo-catalyst] [PATCH 6/8] targets: Inline functions with one caller Matt Turner
2020-05-02 23:12   ` Brian Dolbec
2020-05-02  1:40 ` [gentoo-catalyst] [PATCH 7/8] targets: Remove unused extract_kernel() Matt Turner
2020-05-02 23:15   ` Brian Dolbec
2020-05-02  1:40 ` [gentoo-catalyst] [PATCH 8/8] catalyst: Replace target_portdir with repo_basedir+repo_name Matt Turner
2020-05-02 23:28   ` Brian Dolbec [this message]
2020-05-02 22:56 ` [gentoo-catalyst] [PATCH 1/8] targets: Use gensquashfs instead of mksquashfs Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200502162842.372ab7ea@storm \
    --to=dolsen@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox