public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] patch, fix broken seed stage update
@ 2013-02-26 16:20 Brian Dolbec
  2013-02-26 16:37 ` W. Trevor King
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Brian Dolbec @ 2013-02-26 16:20 UTC (permalink / raw
  To: gentoo-catalyst@lists.gentoo.org; +Cc: zmedico, fuzzyray

The git branch is located at http://dev.gentoo.org/~dolsen/catalyst/
git checkout the rewrite branch.

For those of you that have already cloned it, use --force in your pull.
I've condensed, rearranged the changes into more logical complete
changes.  Still, I wouldn't think you could cherrypick any single commit
in general.  Some fixes could be cherrypicked to apply to current
master, some would likely have to be hand applied due to other changes.

Next on my todo list, fix doc's creation, create a setup.py and make the
code installable via ebuild.  

I think also development should continue in a branch on the main
catalyst repo on g.o.g.o.  Possibly name it catalyst3b so it does not
conflict with the catalyst3 branch started.  I looked at rebasing my
work on it, but decided against it.  There were far too many changes in
master since it was last updated.

There are far too many patches to individually list them in this mail
list.  Please checkout the branch from my repo to review the changes.
It would also be easier to use gitweb to view them online if it was
pushed to the main repo.


Anyway the latest patch...

======================================================================

Fix broken seed stage update...

Strip --usepkg and --buildpkg from emerge options for user defined
update_seed_command.
Add a check for the update_seed option to set the correct update
options.
Fix default seed stage update command to properly update gcc and it's
deps.
Add a seed stage update system command and option.
Add --binpkg-respect-use=y for all cases --usepkg is enabled.


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

From 9ffa5b8812403bf20f17eba58543fc4b7c04bc33 Mon Sep 17 00:00:00 2001
From: Brian Dolbec <dolsen@gentoo.org>
Date: Mon, 25 Feb 2013 23:31:41 -0800
Subject: [PATCH] Fix broken seed stage update...

Strip --usepkg and --buildpkg from emerge options for user defined update_seed_command.
Add a check for the update_seed option to set the correct update options.
Fix default seed stage update command to properly update gcc and it's deps.
Add a seed stage update system command and option.
Add --binpkg-respect-use=y for all cases --usepkg is enabled.
---
 catalyst/targets/stage1.py          |  3 ++-
 doc/catalyst-spec.5.txt             | 12 +++++++++++-
 targets/stage1/stage1-chroot.sh     | 17 ++++++++++++++---
 targets/support/chroot-functions.sh | 11 ++++++++++-
 4 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
index e936929..e067c8c 100644
--- a/catalyst/targets/stage1.py
+++ b/catalyst/targets/stage1.py
@@ -18,7 +18,8 @@ class stage1(StageBase):
 	def __init__(self,spec,addlargs):
 		self.required_values=[]
 		self.valid_values=["chost"]
-		self.valid_values.extend(["update_seed","update_seed_command"])
+		self.valid_values.extend(["update_seed","update_seed_command",
+			"update_seed_system"])
 		StageBase.__init__(self,spec,addlargs)
 
 	def set_stage_path(self):
diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt
index 4a6e06c..196bdc3 100644
--- a/doc/catalyst-spec.5.txt
+++ b/doc/catalyst-spec.5.txt
@@ -138,9 +138,19 @@ it should update the seed stage or not (valid values: `yes no`).
 *update_seed_command*::
 This is an optional command to pass to emerge for updating the seed
 stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
-If not specified, catalyst will update gcc deps.
+If not specified, catalyst will update gcc's deps, and rebuild gcc if any of
+it's deps are updated with a new version. Even if it itself is not updated.
+This prevents gcc breakage when it's dependency lib sonames have changed.
 This setting requires enabling update_seed.
 
+*update_seed_system*::
+This is an optional setting supported by stage1 to tell catalyst if
+it should update the seed's system packages or not (valid values: `yes no`).
+This is run after any update_seed_command, updating any remaining upgradable
+system packages.
+This setting requires enabling update_seed.
+
+
 Compilation
 ~~~~~~~~~~~
 
diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh
index 97aef7f..65c2d81 100755
--- a/targets/stage1/stage1-chroot.sh
+++ b/targets/stage1/stage1-chroot.sh
@@ -26,12 +26,23 @@ clst_root_path=/ setup_pkgmgr
 # Update stage3
 if [ -n "${clst_update_seed}" ]; then
 	if [ "${clst_update_seed}" == "yes" ]; then
-		echo "Updating seed stage..."
 		if [ -n "${clst_update_seed_command}" ]; then
-			clst_root_path=/ run_merge "--buildpkg=n ${clst_update_seed_command}"
+			echo "--- Updating seed stage with USER defined update_seed_command"
+			update_cmd=${clst_update_seed_command/--usepkg /}
+			update_cmd=${clst_update_seed_command/--buildpkg /}
+			clst_root_path=/ run_merge "${update_cmd}"
 		else
-			clst_root_path=/ run_merge "--buildpkg=n --update --deep --newuse --onlydeps gcc"
+			echo "--- Updating seed stage with DEFAULT update_seed_command"
+			update_cmd="--update --deep --complete-graph --rebuild-if-new-ver gcc"
+			clst_root_path=/ run_merge ${update_cmd}
 		fi
+		if [ "${clst_update_seed_system}" == "yes" ]; then
+			echo "--- Updating seed stage system packages"
+			update_cmd="--update --deep --complete-graph @system"
+			clst_root_path=/ run_merge ${update_cmd}
+		fi
+		# now reset the emerge options for the target
+		clst_update_seed=no setup_myemergeopts
 	elif [ "${clst_update_seed}" != "no" ]; then
 		echo "Invalid setting for update_seed: ${clst_update_seed}"
 		exit 1
diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
index 2524b4f..69d2923 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -133,9 +133,18 @@ setup_myemergeopts(){
 	then
 		export bootstrap_opts="${bootstrap_opts} -f"
 		export clst_myemergeopts="${clst_myemergeopts} -f"
+	# now intercept normal target options if we're updating the seed
+	# to update the seed we do not want binpkgs that may have links to
+	# sonames no longer installed, due to dependency updates.
+	# this function will be re-run later with clst_update_seed=no
+	elif [ "${clst_update_seed}" == "yes" ]
+	then
+		export clst_myemergeopts="${clst_myemergeopts} --newuse"
+		export bootstrap_opts="${bootstrap_opts} -r"
 	elif [ -n "${clst_PKGCACHE}" ]
 	then
-		export clst_myemergeopts="${clst_myemergeopts} --usepkg --buildpkg --newuse"
+		# if you add --usepkg, then also add --binpkg-respect-use=y
+		export clst_myemergeopts="${clst_myemergeopts} --usepkg --binpkg-respect-use=y --buildpkg --newuse"
 		export bootstrap_opts="${bootstrap_opts} -r"
 	fi
 }
-- 
1.8.1.2





^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-26 16:20 [gentoo-catalyst] patch, fix " Brian Dolbec
@ 2013-02-26 16:37 ` W. Trevor King
  2013-02-26 16:47   ` Brian Dolbec
  2013-02-26 17:29 ` Rick "Zero_Chaos" Farina
  2013-02-27  2:37 ` Matt Turner
  2 siblings, 1 reply; 19+ messages in thread
From: W. Trevor King @ 2013-02-26 16:37 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

[-- Attachment #1: Type: text/plain, Size: 1617 bytes --]

On Tue, Feb 26, 2013 at 08:20:45AM -0800, Brian Dolbec wrote:
> The git branch is located at http://dev.gentoo.org/~dolsen/catalyst/
> git checkout the rewrite branch.

Did you forget to push?

  $ git remote -v | grep dolsen
  dolsen  http://dev.gentoo.org/~dolsen/catalyst (fetch)
  dolsen  http://dev.gentoo.org/~dolsen/catalyst (push)
  $ git fetch dolsen
  $ git log --pretty=fuller dolsen/rewrite
  commit 0fb26090a730f876993c13e23b6da3effdd5d1ed
  Author:     Brian Dolbec <dolsen@gentoo.org>
  AuthorDate: Thu Jan 24 21:09:05 2013 -0800
  Commit:     Brian Dolbec <dolsen@gentoo.org>
  CommitDate: Thu Jan 24 21:13:01 2013 -0800

      add archdir to settings

> Next on my todo list, fix doc's creation, create a setup.py and make the
> code installable via ebuild.  

For what it's worth, I'd rather see this polished up an merged into
master before you add more work on top, mostly because that would make
it easier for me to help out ;).

> I think also development should continue in a branch on the main
> catalyst repo on g.o.g.o.  Possibly name it catalyst3b so it does not
> conflict with the catalyst3 branch started.  I looked at rebasing my
> work on it, but decided against it.  There were far too many changes in
> master since it was last updated.

Avoiding this is another reason to get fairly incremental portions of
your work merged back into master before they grow too unwieldy.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-26 16:37 ` W. Trevor King
@ 2013-02-26 16:47   ` Brian Dolbec
  2013-02-03 12:44     ` [gentoo-catalyst] More proposed Catalyst changes W. Trevor King
  2013-02-26 16:48     ` Peter Stuge
  0 siblings, 2 replies; 19+ messages in thread
From: Brian Dolbec @ 2013-02-26 16:47 UTC (permalink / raw
  To: gentoo-catalyst

On Tue, 2013-02-26 at 11:37 -0500, W. Trevor King wrote:
> On Tue, Feb 26, 2013 at 08:20:45AM -0800, Brian Dolbec wrote:
> > The git branch is located at http://dev.gentoo.org/~dolsen/catalyst/
> > git checkout the rewrite branch.
> 
> Did you forget to push?
> 
>   $ git remote -v | grep dolsen
>   dolsen  http://dev.gentoo.org/~dolsen/catalyst (fetch)
>   dolsen  http://dev.gentoo.org/~dolsen/catalyst (push)
>   $ git fetch dolsen
>   $ git log --pretty=fuller dolsen/rewrite
>   commit 0fb26090a730f876993c13e23b6da3effdd5d1ed
>   Author:     Brian Dolbec <dolsen@gentoo.org>
>   AuthorDate: Thu Jan 24 21:09:05 2013 -0800
>   Commit:     Brian Dolbec <dolsen@gentoo.org>
>   CommitDate: Thu Jan 24 21:13:01 2013 -0800
> 
>       add archdir to settings
> 

BAH!, forgot to ssh in and run git update-server-info on it

try again.

another reason to get a branch going on g.o.g.o

Also I've rebased everything on current master including W. Trevor
King's patches.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-26 16:47   ` Brian Dolbec
  2013-02-03 12:44     ` [gentoo-catalyst] More proposed Catalyst changes W. Trevor King
@ 2013-02-26 16:48     ` Peter Stuge
  1 sibling, 0 replies; 19+ messages in thread
From: Peter Stuge @ 2013-02-26 16:48 UTC (permalink / raw
  To: gentoo-catalyst

Brian Dolbec wrote:
> BAH!, forgot to ssh in and run git update-server-info on it

Add a hook to do it for you in the future.


//Peter


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-26 16:20 [gentoo-catalyst] patch, fix " Brian Dolbec
  2013-02-26 16:37 ` W. Trevor King
@ 2013-02-26 17:29 ` Rick "Zero_Chaos" Farina
  2013-02-26 19:39   ` Matt Turner
  2013-02-27  2:37 ` Matt Turner
  2 siblings, 1 reply; 19+ messages in thread
From: Rick "Zero_Chaos" Farina @ 2013-02-26 17:29 UTC (permalink / raw
  To: gentoo-catalyst

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/26/2013 11:20 AM, Brian Dolbec wrote:
> The git branch is located at http://dev.gentoo.org/~dolsen/catalyst/
> git checkout the rewrite branch.
> 
> For those of you that have already cloned it, use --force in your pull.
> I've condensed, rearranged the changes into more logical complete
> changes.  Still, I wouldn't think you could cherrypick any single commit
> in general.  Some fixes could be cherrypicked to apply to current
> master, some would likely have to be hand applied due to other changes.
> 
> Next on my todo list, fix doc's creation, create a setup.py and make the
> code installable via ebuild.  
> 
> I think also development should continue in a branch on the main
> catalyst repo on g.o.g.o.  Possibly name it catalyst3b so it does not
> conflict with the catalyst3 branch started.  I looked at rebasing my
> work on it, but decided against it.  There were far too many changes in
> master since it was last updated.
In my opinion you can kill the current catalyst 3 branch as nothing uses
it and afaik it doesn't work.  jmbvicetto should be able to
authoritatively agree or not.

- -Zero
> 
> There are far too many patches to individually list them in this mail
> list.  Please checkout the branch from my repo to review the changes.
> It would also be easier to use gitweb to view them online if it was
> pushed to the main repo.
> 
> 
> Anyway the latest patch...
> 
> ======================================================================
> 
> Fix broken seed stage update...
> 
> Strip --usepkg and --buildpkg from emerge options for user defined
> update_seed_command.
> Add a check for the update_seed option to set the correct update
> options.
> Fix default seed stage update command to properly update gcc and it's
> deps.
> Add a seed stage update system command and option.
> Add --binpkg-respect-use=y for all cases --usepkg is enabled.
> 
> 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
>>From 9ffa5b8812403bf20f17eba58543fc4b7c04bc33 Mon Sep 17 00:00:00 2001
> From: Brian Dolbec <dolsen@gentoo.org>
> Date: Mon, 25 Feb 2013 23:31:41 -0800
> Subject: [PATCH] Fix broken seed stage update...
> 
> Strip --usepkg and --buildpkg from emerge options for user defined update_seed_command.
> Add a check for the update_seed option to set the correct update options.
> Fix default seed stage update command to properly update gcc and it's deps.
> Add a seed stage update system command and option.
> Add --binpkg-respect-use=y for all cases --usepkg is enabled.
> ---
>  catalyst/targets/stage1.py          |  3 ++-
>  doc/catalyst-spec.5.txt             | 12 +++++++++++-
>  targets/stage1/stage1-chroot.sh     | 17 ++++++++++++++---
>  targets/support/chroot-functions.sh | 11 ++++++++++-
>  4 files changed, 37 insertions(+), 6 deletions(-)
> 
> diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
> index e936929..e067c8c 100644
> --- a/catalyst/targets/stage1.py
> +++ b/catalyst/targets/stage1.py
> @@ -18,7 +18,8 @@ class stage1(StageBase):
>  	def __init__(self,spec,addlargs):
>  		self.required_values=[]
>  		self.valid_values=["chost"]
> -		self.valid_values.extend(["update_seed","update_seed_command"])
> +		self.valid_values.extend(["update_seed","update_seed_command",
> +			"update_seed_system"])
>  		StageBase.__init__(self,spec,addlargs)
>  
>  	def set_stage_path(self):
> diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt
> index 4a6e06c..196bdc3 100644
> --- a/doc/catalyst-spec.5.txt
> +++ b/doc/catalyst-spec.5.txt
> @@ -138,9 +138,19 @@ it should update the seed stage or not (valid values: `yes no`).
>  *update_seed_command*::
>  This is an optional command to pass to emerge for updating the seed
>  stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
> -If not specified, catalyst will update gcc deps.
> +If not specified, catalyst will update gcc's deps, and rebuild gcc if any of
> +it's deps are updated with a new version. Even if it itself is not updated.
> +This prevents gcc breakage when it's dependency lib sonames have changed.
>  This setting requires enabling update_seed.
>  
> +*update_seed_system*::
> +This is an optional setting supported by stage1 to tell catalyst if
> +it should update the seed's system packages or not (valid values: `yes no`).
> +This is run after any update_seed_command, updating any remaining upgradable
> +system packages.
> +This setting requires enabling update_seed.
> +
> +
>  Compilation
>  ~~~~~~~~~~~
>  
> diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh
> index 97aef7f..65c2d81 100755
> --- a/targets/stage1/stage1-chroot.sh
> +++ b/targets/stage1/stage1-chroot.sh
> @@ -26,12 +26,23 @@ clst_root_path=/ setup_pkgmgr
>  # Update stage3
>  if [ -n "${clst_update_seed}" ]; then
>  	if [ "${clst_update_seed}" == "yes" ]; then
> -		echo "Updating seed stage..."
>  		if [ -n "${clst_update_seed_command}" ]; then
> -			clst_root_path=/ run_merge "--buildpkg=n ${clst_update_seed_command}"
> +			echo "--- Updating seed stage with USER defined update_seed_command"
> +			update_cmd=${clst_update_seed_command/--usepkg /}
> +			update_cmd=${clst_update_seed_command/--buildpkg /}
> +			clst_root_path=/ run_merge "${update_cmd}"
>  		else
> -			clst_root_path=/ run_merge "--buildpkg=n --update --deep --newuse --onlydeps gcc"
> +			echo "--- Updating seed stage with DEFAULT update_seed_command"
> +			update_cmd="--update --deep --complete-graph --rebuild-if-new-ver gcc"
> +			clst_root_path=/ run_merge ${update_cmd}
>  		fi
> +		if [ "${clst_update_seed_system}" == "yes" ]; then
> +			echo "--- Updating seed stage system packages"
> +			update_cmd="--update --deep --complete-graph @system"
> +			clst_root_path=/ run_merge ${update_cmd}
> +		fi
> +		# now reset the emerge options for the target
> +		clst_update_seed=no setup_myemergeopts
>  	elif [ "${clst_update_seed}" != "no" ]; then
>  		echo "Invalid setting for update_seed: ${clst_update_seed}"
>  		exit 1
> diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
> index 2524b4f..69d2923 100755
> --- a/targets/support/chroot-functions.sh
> +++ b/targets/support/chroot-functions.sh
> @@ -133,9 +133,18 @@ setup_myemergeopts(){
>  	then
>  		export bootstrap_opts="${bootstrap_opts} -f"
>  		export clst_myemergeopts="${clst_myemergeopts} -f"
> +	# now intercept normal target options if we're updating the seed
> +	# to update the seed we do not want binpkgs that may have links to
> +	# sonames no longer installed, due to dependency updates.
> +	# this function will be re-run later with clst_update_seed=no
> +	elif [ "${clst_update_seed}" == "yes" ]
> +	then
> +		export clst_myemergeopts="${clst_myemergeopts} --newuse"
> +		export bootstrap_opts="${bootstrap_opts} -r"
>  	elif [ -n "${clst_PKGCACHE}" ]
>  	then
> -		export clst_myemergeopts="${clst_myemergeopts} --usepkg --buildpkg --newuse"
> +		# if you add --usepkg, then also add --binpkg-respect-use=y
> +		export clst_myemergeopts="${clst_myemergeopts} --usepkg --binpkg-respect-use=y --buildpkg --newuse"
>  		export bootstrap_opts="${bootstrap_opts} -r"
>  	fi
>  }
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRLPDkAAoJEKXdFCfdEflKLykP/Rx73fH878oLHFunNkfpa929
us+Kcf74QNvTjDUH2uzgofICiJFsnCdgUjmF0+gBDUY8DjxOjMYI4CrbqF6FEJ88
Q+rmN5rkcFvqRaVZrh480U9qPhm8JvYvIzviijBBmOqZDOgFQHpOPJMSeRcMAU/5
7fAT5zbmUGduKtecV/juI6UQimo5/eNuWd/z7BY3qAG/eh4skFK1M0JX2JJKnlAO
m5I5GCDKn32FQhhm5OdW+GFgS6c6MczBGGIEnyTwu7Lv50OC6XRm9xP4uiDjGOqW
A+tPhp1pidhamjCYhW0A+1fv5ZYe6DIZy/b8p/KrgB3oDKmhwWn83u1RhCu3GxMe
6Scg1KlnBJgPVa8b7OiS0lbJlrLAUlcQzJJKhvlrH7mRZ8vAqn4R77s31opuU2JU
UvZdchAYN/ziZG9xR/btrDE8yrpzwjiXj4Sc1BncqDMb2Sq/HLrxxYi0Tuk7UNDz
hQdjRBEaC8e/yvuPtdGqpoq9WojKeMH6DhBHI/FYhOlcqr4vHyPtiD6ioHwd92LK
iBAiAfQ5jjk+pDu1yIbOC5/GchWVV6hKjgz2qZd3dZPQq7YixRVImHR5roBXiKwm
4w9FutyE5slZZgFjIjrkcg1lp0emHI8osKfl9hf+wNvVXmgo8AZrrmidqgESNe8B
iQtoJi1P+d7Mee4cqlrI
=Yseo
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-01-31 18:39           ` W. Trevor King
@ 2013-02-26 18:04             ` W. Trevor King
  2013-02-27  1:30               ` Brian Dolbec
  0 siblings, 1 reply; 19+ messages in thread
From: W. Trevor King @ 2013-02-26 18:04 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

[-- Attachment #1: Type: text/plain, Size: 9746 bytes --]

On Tue, Feb 26, 2013 at 08:47:14AM -0800, Brian Dolbec wrote:
> Also I've rebased everything on current master

That should make things easier to merge :).

It looks like some of my earlier comments were addressed by this
reroll, but some are still applicable.  Apologies if we'd resolved any
of this earlier and I just missed the reference in my mailbox.

I map my old comments onto the rebased commits below, but the bulk of
the outstanding suggestions revolve around:

* ConfigParser-based configuration
* Argparse-based command line parsing
* Logging-based debugging output
* os.path.join(), normpath(), … for path manipulation

These are mostly “take advantage of Python's standard library”
changes, and I'd be happy to help implement them on top of the current
master if folks feel like that has a chance of getting merged ;).

On Thu, Jan 31, 2013 at 01:39:22PM -0500, W. Trevor King wrote:
> 38cd3bb add more configured defaults
> 
> List the new settings (distdir, repo_name, packagedir, port_tmpdir,
> options, snapshot_name) in the commit message so I don't have to read
> the diff.  Probably explain why you think they should be configurable
> as well.  `options` is also a pretty ambiguous name.

This still applies to 0a25452.  I made a few comments about using
separate boolean options instead of an aggregate `options` set.
Fixing this should be part of the ConfigParser transition.

> 016704a use the new configured snapshot_name and portdir settings
> 
> Rather than a separate add (38cd3bb) and use (016704a), I think it
> would be better if new options had their addition and use rolled into
> a single commit (e.g. add snapshot_name and use it as one commit, add
> portdir and use it as another commit).
> 
> This might also be a good place to move the path construction over to
> use os.path.join().

This still applies to be2f820.

> 63a25eb Remove self.mounts and self.mountmap's use of paths for keys and paths. Migrate more hardcoded paths to use settings.
> 
> That's a long commit summary ;).  Perhaps the “Migrate…” portion
> should go into the commit message body, or that could be split out
> into a separate commit.

This splitting happened in 77eece8, but…

> This might also be a good time to transition from `CatalystError, …`
> to `CatalystError(…)` where you're touching lines.
> 
> I'm not sure which versions of Python Catalyst is trying to support,
> but I'd be happy to see the beginings of a migration to '{}'.format()
> for building strings (vs. the current `'' + ''` concatenation)

… this still applies.

> 7a909b9 cleanup long lines, improve useage() output formatting slightly
> 
> Can we just switch from getopt to argparse (Python ≥2.7)?

Still applies to 7870959.

> 5eeb8b1 new minimal start script
> 
> I think __version__ and __maintainer__ should live in
> catalyst/__init__.py.

Still applies to baae19f.

> 299e35d update the module loading paths for the new locations
> 
> Can we just drop this import manipulation and use __all__?

Still applies to 79f73a3.

> a7206bb rename files directory to etc to better reflect the directories contents
> 
> Actually, files/ is also used for other things (e.g. built man pages,
> see MAN_PAGES in the Makefile).  If we keep the rename to etc/, we
> might to just build the man pages under doc/.

Still applies to 25f6f1b.

> f9f18be update gitignore
> 
> The Scratch, catalystc, *.geany, and test* entries would appear to be
> specific to your local installation and usage.  I'd drop them from the
> reroll.

They're still in 7fdecf4, but it will be easy to drop this before the
merge with master.

On Thu, Jan 31, 2013 at 02:46:53PM -0500, W. Trevor King wrote:
> 968d818 Initial creation of a defaults file. Split out hash and contents to their own classes, files
> 
> After this, it's not clear to me what the difference is between
> catalyst.support and catalyst.util.  Perhaps they should be merged.
> 
> I'd also use catalyst.targets.__all__ instead of coding a list of
> targets in the apparently unrelated
> catalyst.defaults.valid_build_targets.

Still applies to c97dc3d.

> 9d752a7 move confdefaults out of main.py
> 
> Looks good, except, I'm not sure why you changed from
> `confdefaults.keys()` to `list(confdefaults)` in parse_config() (which
> should probably be living in catalyst.config anyway).

Still applies to 0c2302a.  Additional discussion from a sub-thread:

On Sun, Feb 03, 2013 at 07:44:36AM -0500, W. Trevor King wrote:
> On Sat, Feb 02, 2013 at 12:41:32PM -0800, Brian Dolbec wrote:
> > As for list(confdefaults), py3 compatibility.  dict.keys() isn't usable
> > and 2to3 converts it to list(dict)... something about needing to specify
> > the return type.  So is a preemptive change.   One less thing to change
> > later.
> 
> Really?
> 
>   $ python3.3 -c "a = {1:2, 3:4}; print([x for x in a.keys()])"
>   [1, 3]
> 
> On the other hand, it might be cleaner to just say:
> 
>   for x in confdefaults:
> 
> But this should still go into a separate commit.

I still think this is true ;).

On Thu, Jan 31, 2013 at 02:46:53PM -0500, W. Trevor King wrote:
> c303dae some options cleanup, unifying their use, reducing redundancy.
> 
> While I like the general thrust of this, I'd be happier with explicit
> boolean options instead of a set of boolean options.  For example:
> 
>   confdefaults = {
>     'autoresume': False,
>     'ccache': False,
>     …
> 		}

Still applies to ca85cd4.  Like I said above, I'm happy to work up a
ConfigParser-based solution.

> 04068a1 massive pyflakes import cleanup and broken CatalystError calls
> 
> A lot of this is great stuff (Hooray no `import *`!).  However, I'd
> split the `print_traceback=True` changes out into their own commit (or
> just change the default value for CatalystError while you're testing).
> 
> It looks like an unrelated change to
> catalyst.defaults.required_build_targets snuck into this commit.
> 
> The hash_map changes should probably be squashed into the earlier hash
> reorganization, rather than going into this commit.

Still applies to eed08b1.

> 5c689a8 update module loading for the new python structure, rename snapshot_target to snapshot
> 
> I think I like this.  It's good to use __import__.  You're missing a
> blank line after your import_module docstring summary [1].
> 
> I think that the import_module API should match Python 3's
> importlib.import_module [2].

Still applies to still applies to f733b3f.

> 669451d fix options being reset by a config file
> 
> See my comments on c303dae.  We should really be using ConfigParser's
> defaults here, instead of rolling our own default system.

ConfigParser :).

> c5eb7f7 fix mounts, mountmap hardcoding removal, use normpath to fix paths, add some debug print statements, remove clear & purge code from support.py,
> 
> Split the long commit summary.

This was fixed in 9fabaae, but…

> Can we use logging instead of print?
> 
> The except (Failure loading " + x + " plugin) should be squashed into
> the commit that caused it and be restricted to only catch
> ImportErrors.
> 
> The mountmap fix for 'proc' → '/proc' should be squashed into the
> commit that caused it.
> 
> -               mypath=self.settings["chroot_path"]
> +               #mypath=self.settings["chroot_path"]
> 
> Just remove this entirely, don't comment it out.

… these were not.

> a847803 Use normpath from support
> 
> Why are we not using os.path.normpath?
> 
> Also, remove instead of commenting out.

Still applies to be413a4.

> 242c17d rename all target .py file and classes without the "_target" so they are the same as the .sh files and work with teh simplified module loading.
> 
> Move “so they …” into the commit message body and s/teh/the/.

With 6a86874, the commit body has “This is so they are the named the
same as the target…”, which should probably be “This is so they are
named the same as the target…” (removing an extra “the”).

> e05cc34 Break out a few more repeated (path1 + path2)'s  to doing it once and using the temp variable. comment out some debug print's
> 
> Long commit summary.

This is fixed in 4dd2cb2, but…

> os.path.join!  Also, convert debug prints to use the logging module
> ;).

… these are not.

> e0738c0 rename a make.conf key to make_conf due to bash variable name restrictions
> 
> Squash into causing commit.

Still applies to 253dab7.

> ae61e4a reduce 2 operations into one simpler one
> 
> Just switch to ConfigParser ;).

Still applies to 92c6745.

> b08a757 extend ParserBase to do variable substitution.
> 
> ConfigParser does that to ;).

Still applies to 104c387.

> 265c8ed add a "shdir" setting to make moving the bash code around easier and have less hardcoded paths in the bash scripts
> 
> Long commit summary.

This is fixed in b433a82, but…

> Your comment claims catalyst runtime executables for both sharedir and
> shdir.

… this is not.
 
> 55a58ee Add a forced debug print statement in cmd() for better debug output
> 
> Python logging.

Still applies to 3791efc.

> 24d69bd Commit my testpath file with instructions to run the git checkout code directly without being installed.
> 
> s/caatalyst/catalyst/
> 
> It would also probably be a good idea to add an example test.conf with
> relative paths.

Still applies to 786a01c.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-26 17:29 ` Rick "Zero_Chaos" Farina
@ 2013-02-26 19:39   ` Matt Turner
  2013-02-27  2:04     ` Brian Dolbec
  0 siblings, 1 reply; 19+ messages in thread
From: Matt Turner @ 2013-02-26 19:39 UTC (permalink / raw
  To: gentoo-catalyst

On Tue, Feb 26, 2013 at 9:29 AM, Rick "Zero_Chaos" Farina
<zerochaos@gentoo.org> wrote:
> In my opinion you can kill the current catalyst 3 branch as nothing uses
> it and afaik it doesn't work.  jmbvicetto should be able to
> authoritatively agree or not.

If Brian's work is to be the basis for future revisions of catalyst,
it should be the master branch. We can branch current master as a
stable branch. The current catalyst2 branch is totally dead, and
overwriting it doesn't cause us to lose anything.

... but the patches should be sent to the list (with git
format-patch/send-email) and reviewed before being committed to
master.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-26 18:04             ` [gentoo-catalyst] patch, fix broken seed stage update W. Trevor King
@ 2013-02-27  1:30               ` Brian Dolbec
  2013-02-27  1:40                 ` W. Trevor King
  0 siblings, 1 reply; 19+ messages in thread
From: Brian Dolbec @ 2013-02-27  1:30 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

On Tue, 2013-02-26 at 13:04 -0500, W. Trevor King wrote:
> On Tue, Feb 26, 2013 at 08:47:14AM -0800, Brian Dolbec wrote:
> > Also I've rebased everything on current master
> 
> That should make things easier to merge :).
> 
> It looks like some of my earlier comments were addressed by this
> reroll, but some are still applicable.  Apologies if we'd resolved any
> of this earlier and I just missed the reference in my mailbox.
> 
> I map my old comments onto the rebased commits below, but the bulk of
> the outstanding suggestions revolve around:
> 
> * ConfigParser-based configuration
> * Argparse-based command line parsing
> * Logging-based debugging output
> * os.path.join(), normpath(), … for path manipulation
> 
> These are mostly “take advantage of Python's standard library”
> changes, and I'd be happy to help implement them on top of the current
> master if folks feel like that has a chance of getting merged ;).
> 

All that is for a TODO list.  What I did was rebase my existing changes,
merging fixes to the commits that made the change..., fix the commit
messages, etc...

Same with the other things you listed below, mostly for a TODO and your
wishlist.  Pretty much all I agree with.


My aim for now is to debug the hell out of it, to stabilize all the
existing changes, BEFORE doing a ton more changes.  That will also give
me more experience in how catalyst is used, possibly ideas how to change
it for the better.  I'll fix the doc's generation and make a setup.py
and new 9999 ebuild.

Plus I need to focus more on another project needed for the git tree
migration.


> Cheers,
> Trevor
> 




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-27  1:30               ` Brian Dolbec
@ 2013-02-27  1:40                 ` W. Trevor King
  2013-02-27  2:35                   ` Brian Dolbec
  0 siblings, 1 reply; 19+ messages in thread
From: W. Trevor King @ 2013-02-27  1:40 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]

On Tue, Feb 26, 2013 at 05:30:40PM -0800, Brian Dolbec wrote:
> My aim for now is to debug the hell out of it, to stabilize all the
> existing changes, BEFORE doing a ton more changes.  That will also give
> me more experience in how catalyst is used, possibly ideas how to change
> it for the better.  I'll fix the doc's generation and make a setup.py
> and new 9999 ebuild.

I'm not suggesting additional changes on top of yours, I'm suggesting
new ones underneath yours, or alternatives to your current series.  It
seems a shame to spend time testing a work in progress, since you'll
probably want to re-test the final form before merging.  I'm trying to
help polish your series down before we invest a lot of time testing.

> Plus I need to focus more on another project needed for the git tree
> migration.

I have no problem waiting on the catalyst front if it helps push the
Git migration through.  I've been wishing for that for a while :D.

Instead of making my suggested changes on top of your series, I can
also make them underneath your series, and help rebase your series on
top.  That gets the changes I want in, and lets you focus on other
things at the same time ;).

I'm also ok with just waiting until folks have more time (e.g. the
catalyst-spec man page cooked for five months ;).

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-26 19:39   ` Matt Turner
@ 2013-02-27  2:04     ` Brian Dolbec
  2013-02-27  2:37       ` Matt Turner
  2013-02-27 12:12       ` W. Trevor King
  0 siblings, 2 replies; 19+ messages in thread
From: Brian Dolbec @ 2013-02-27  2:04 UTC (permalink / raw
  To: gentoo-catalyst

On Tue, 2013-02-26 at 11:39 -0800, Matt Turner wrote:
> On Tue, Feb 26, 2013 at 9:29 AM, Rick "Zero_Chaos" Farina
> <zerochaos@gentoo.org> wrote:
> > In my opinion you can kill the current catalyst 3 branch as nothing uses
> > it and afaik it doesn't work.  jmbvicetto should be able to
> > authoritatively agree or not.
> 
> If Brian's work is to be the basis for future revisions of catalyst,
> it should be the master branch. We can branch current master as a
> stable branch. The current catalyst2 branch is totally dead, and
> overwriting it doesn't cause us to lose anything.
> 

I generally agree that my rewrite should become the master branch, but
it could live in a side branch for a while longer, there are many more
changes needed to clean up the code.  It is likely to be broken at times
some commits by themselves won't be complete, etc...


> ... but the patches should be sent to the list (with git
> format-patch/send-email) and reviewed before being committed to
> master.
> 

I tried using git to send this patch, but it did not work.  I'll look
into how to make it work with email.

But I do question the need to send all patches to this list for review.
Take this patch email for instance.  It was primarily for the last
commit I did to fix the update_seed methods which I found not working
correctly. I also mentioned I had rebased all my other work, condensing
where it made sense...

 Do you see any code suggestions, questions and/or comments in regards
to it... NO

All mails in this thread are about everything else :/

I will continue to spam the list with all my rebased commits, which I
intended to do when I had more time.  I sent this one off this morning
before I went to work.  I know Jorge was interested in the changes.  I'm
back now, so will manually prepare more patch mails.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-27  1:40                 ` W. Trevor King
@ 2013-02-27  2:35                   ` Brian Dolbec
  2013-02-27  2:41                     ` Matt Turner
  0 siblings, 1 reply; 19+ messages in thread
From: Brian Dolbec @ 2013-02-27  2:35 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

On Tue, 2013-02-26 at 20:40 -0500, W. Trevor King wrote:
> On Tue, Feb 26, 2013 at 05:30:40PM -0800, Brian Dolbec wrote:
> > My aim for now is to debug the hell out of it, to stabilize all the
> > existing changes, BEFORE doing a ton more changes.  That will also give
> > me more experience in how catalyst is used, possibly ideas how to change
> > it for the better.  I'll fix the doc's generation and make a setup.py
> > and new 9999 ebuild.
> 
> I'm not suggesting additional changes on top of yours, I'm suggesting
> new ones underneath yours, or alternatives to your current series.  It
> seems a shame to spend time testing a work in progress, since you'll
> probably want to re-test the final form before merging.  I'm trying to
> help polish your series down before we invest a lot of time testing.
> 

NNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOO :(  not more rebasing  I spent
several days just tracking down and fixing rebase errors.  Fix a few,
that in turn caused more errors...

You and I both know that the code is likely to be broken at times while
doing many of the code changes needed to fix it.  The original code was
horrible, not all of it, but...   The time for polish is later when the
majority of the changes are done.  I want to move forward, not churn in
circles, rebasing, fixing conflicts, forever waiting for a commit to be
reviewed & merged.  One of the big reasons I started on catalyst was to
remove the hardcoded paths everywhere that was preventing the tree
migration away from /usr/portage.  That has been largely accomplished,
although not really tested.

The reason I wanted to do more testing, is so far I've only done
snapshot, stage1 thru 3.  I've done the major restructure of the python
layout.  I want to get everything working, not 100% bug free, before
moving on.  That will make it easier to figure out where something got
broken while doing the changes.  Call it a midterm exam ;) to see where
we stand.

So I wouldn't mind working in a branch for now, somewhere we can all
participate in pushing commits to in order to achieve our end goal.
Then later when it's mostly done, we can look to moving it to master.
Finish debugging and polishing it.



> Cheers,
> Trevor
> 




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-26 16:20 [gentoo-catalyst] patch, fix " Brian Dolbec
  2013-02-26 16:37 ` W. Trevor King
  2013-02-26 17:29 ` Rick "Zero_Chaos" Farina
@ 2013-02-27  2:37 ` Matt Turner
  2013-02-27  3:03   ` Brian Dolbec
  2 siblings, 1 reply; 19+ messages in thread
From: Matt Turner @ 2013-02-27  2:37 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

On Tue, Feb 26, 2013 at 8:20 AM, Brian Dolbec <dolsen@gentoo.org> wrote:
> --- a/doc/catalyst-spec.5.txt
> +++ b/doc/catalyst-spec.5.txt
> @@ -138,9 +138,19 @@ it should update the seed stage or not (valid values: `yes no`).
>  *update_seed_command*::
>  This is an optional command to pass to emerge for updating the seed
>  stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
> -If not specified, catalyst will update gcc deps.
> +If not specified, catalyst will update gcc's deps, and rebuild gcc if any of
> +it's deps are updated with a new version. Even if it itself is not updated.
> +This prevents gcc breakage when it's dependency lib sonames have changed.
>  This setting requires enabling update_seed.
>
> +*update_seed_system*::
> +This is an optional setting supported by stage1 to tell catalyst if
> +it should update the seed's system packages or not (valid values: `yes no`).
> +This is run after any update_seed_command, updating any remaining upgradable
> +system packages.
> +This setting requires enabling update_seed.

I don't see any need for an update_seed_system option. If someone
wants to run emerge @system then they can do:

update_seed_command: --options @system


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-27  2:04     ` Brian Dolbec
@ 2013-02-27  2:37       ` Matt Turner
  2013-02-27 12:12       ` W. Trevor King
  1 sibling, 0 replies; 19+ messages in thread
From: Matt Turner @ 2013-02-27  2:37 UTC (permalink / raw
  To: gentoo-catalyst

On Tue, Feb 26, 2013 at 6:04 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
>  Do you see any code suggestions, questions and/or comments in regards
> to it... NO

Sorry, I've had other things to do today in the 10 intervening hours
since the patch was sent. Have a bit of patience.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-27  2:35                   ` Brian Dolbec
@ 2013-02-27  2:41                     ` Matt Turner
  0 siblings, 0 replies; 19+ messages in thread
From: Matt Turner @ 2013-02-27  2:41 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

On Tue, Feb 26, 2013 at 6:35 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> On Tue, 2013-02-26 at 20:40 -0500, W. Trevor King wrote:
>> On Tue, Feb 26, 2013 at 05:30:40PM -0800, Brian Dolbec wrote:
>> > My aim for now is to debug the hell out of it, to stabilize all the
>> > existing changes, BEFORE doing a ton more changes.  That will also give
>> > me more experience in how catalyst is used, possibly ideas how to change
>> > it for the better.  I'll fix the doc's generation and make a setup.py
>> > and new 9999 ebuild.
>>
>> I'm not suggesting additional changes on top of yours, I'm suggesting
>> new ones underneath yours, or alternatives to your current series.  It
>> seems a shame to spend time testing a work in progress, since you'll
>> probably want to re-test the final form before merging.  I'm trying to
>> help polish your series down before we invest a lot of time testing.
>>
>
> NNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOO :(  not more rebasing  I spent
> several days just tracking down and fixing rebase errors.  Fix a few,
> that in turn caused more errors...

Rebasing can be annoying, but isn't inherently difficult. Typically
you don't rebase until you're ready for others to review and commit
them.

I'm curious if you know how to use interactive rebase to apply fix-ups
to commits? If not, I'll be happy to walk you through it. It greatly
simplifies the workflow.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-27  2:37 ` Matt Turner
@ 2013-02-27  3:03   ` Brian Dolbec
  2013-02-27  3:22     ` Matt Turner
  0 siblings, 1 reply; 19+ messages in thread
From: Brian Dolbec @ 2013-02-27  3:03 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

On Tue, 2013-02-26 at 18:37 -0800, Matt Turner wrote:
> On Tue, Feb 26, 2013 at 8:20 AM, Brian Dolbec <dolsen@gentoo.org> wrote:
> > --- a/doc/catalyst-spec.5.txt
> > +++ b/doc/catalyst-spec.5.txt
> > @@ -138,9 +138,19 @@ it should update the seed stage or not (valid values: `yes no`).
> >  *update_seed_command*::
> >  This is an optional command to pass to emerge for updating the seed
> >  stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
> > -If not specified, catalyst will update gcc deps.
> > +If not specified, catalyst will update gcc's deps, and rebuild gcc if any of
> > +it's deps are updated with a new version. Even if it itself is not updated.
> > +This prevents gcc breakage when it's dependency lib sonames have changed.
> >  This setting requires enabling update_seed.
> >
> > +*update_seed_system*::
> > +This is an optional setting supported by stage1 to tell catalyst if
> > +it should update the seed's system packages or not (valid values: `yes no`).
> > +This is run after any update_seed_command, updating any remaining upgradable
> > +system packages.
> > +This setting requires enabling update_seed.
> 
> I don't see any need for an update_seed_system option. If someone
> wants to run emerge @system then they can do:
> 
> update_seed_command: --options @system
> 

Well, Jorge last night was saying he wanted -uDN1 @world, but settled
for what was done.

Also if you look at my change for the default update_seed_command.  If
that is just made to @system, the problem I had updating my seed, it
would still be broken.  The problem was that mpc was updated which
changed sonames, so gcc had to be rebuilt or was broken.  Just doing an
emerge -uDN1 @system would not have rebuilt gcc for the new mpc lib.
And most system pkgs can not use EAPI 5 subslots to prevent breakage.

This way gcc will get properly updated, rebuilt if necessary, then if
the user wants, update remaining system pkgs.

It's there, now, only a few lines of code, and for the reasons above,
not as easy to do it all in one command.  We would have to change the
update_seed_command spec option from being a run_merge() to a bash
subshell command.  In that way it can be as complex as the user desires.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-27  3:03   ` Brian Dolbec
@ 2013-02-27  3:22     ` Matt Turner
  2013-02-27  3:49       ` Brian Dolbec
  0 siblings, 1 reply; 19+ messages in thread
From: Matt Turner @ 2013-02-27  3:22 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

On Tue, Feb 26, 2013 at 7:03 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> On Tue, 2013-02-26 at 18:37 -0800, Matt Turner wrote:
>> On Tue, Feb 26, 2013 at 8:20 AM, Brian Dolbec <dolsen@gentoo.org> wrote:
>> > --- a/doc/catalyst-spec.5.txt
>> > +++ b/doc/catalyst-spec.5.txt
>> > @@ -138,9 +138,19 @@ it should update the seed stage or not (valid values: `yes no`).
>> >  *update_seed_command*::
>> >  This is an optional command to pass to emerge for updating the seed
>> >  stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
>> > -If not specified, catalyst will update gcc deps.
>> > +If not specified, catalyst will update gcc's deps, and rebuild gcc if any of
>> > +it's deps are updated with a new version. Even if it itself is not updated.
>> > +This prevents gcc breakage when it's dependency lib sonames have changed.
>> >  This setting requires enabling update_seed.
>> >
>> > +*update_seed_system*::
>> > +This is an optional setting supported by stage1 to tell catalyst if
>> > +it should update the seed's system packages or not (valid values: `yes no`).
>> > +This is run after any update_seed_command, updating any remaining upgradable
>> > +system packages.
>> > +This setting requires enabling update_seed.
>>
>> I don't see any need for an update_seed_system option. If someone
>> wants to run emerge @system then they can do:
>>
>> update_seed_command: --options @system
>>
>
> Well, Jorge last night was saying he wanted -uDN1 @world, but settled
> for what was done.
>
> Also if you look at my change for the default update_seed_command.  If
> that is just made to @system, the problem I had updating my seed, it
> would still be broken.  The problem was that mpc was updated which
> changed sonames, so gcc had to be rebuilt or was broken.  Just doing an
> emerge -uDN1 @system would not have rebuilt gcc for the new mpc lib.
> And most system pkgs can not use EAPI 5 subslots to prevent breakage.
>
> This way gcc will get properly updated, rebuilt if necessary, then if
> the user wants, update remaining system pkgs.
>
> It's there, now, only a few lines of code, and for the reasons above,
> not as easy to do it all in one command.  We would have to change the
> update_seed_command spec option from being a run_merge() to a bash
> subshell command.  In that way it can be as complex as the user desires.

So from talking on IRC, it seems that the problem that led to this
patch was that a binpkg of gcc linked against an old mpc was used
during stage1, leading to a broken gcc in stage2. Stripping --usepkg
makes sense for this purpose.

Removing --buildpkg I'm not sure about. It seems to me that anything
that is built during the seed-update should be okay to use for the
stage1.

Adding an option for updating @system still seems unnecessary.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-27  3:22     ` Matt Turner
@ 2013-02-27  3:49       ` Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2013-02-27  3:49 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: zmedico, fuzzyray

On Tue, 2013-02-26 at 19:22 -0800, Matt Turner wrote:

> So from talking on IRC, it seems that the problem that led to this
> patch was that a binpkg of gcc linked against an old mpc was used
> during stage1, leading to a broken gcc in stage2. Stripping --usepkg
> makes sense for this purpose.
> 
> Removing --buildpkg I'm not sure about. It seems to me that anything
> that is built during the seed-update should be okay to use for the
> stage1.
> 

Yeah, I thought it should be ok too, but so far opted to leave it out

I thought I'd wait for more feedback.  That's also why I cc'd Zac, since
I didn't know if he was on this list.


> Adding an option for updating @system still seems unnecessary.
> 

 If everyone wants it nuked, is easy todo :)



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [gentoo-catalyst] patch, fix broken seed stage update
  2013-02-27  2:04     ` Brian Dolbec
  2013-02-27  2:37       ` Matt Turner
@ 2013-02-27 12:12       ` W. Trevor King
  1 sibling, 0 replies; 19+ messages in thread
From: W. Trevor King @ 2013-02-27 12:12 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 1949 bytes --]

On Tue, Feb 26, 2013 at 06:04:54PM -0800, Brian Dolbec wrote:
> I tried using git to send this patch, but it did not work.  I'll look
> into how to make it work with email.
> …
> I will continue to spam the list with all my rebased commits, which I
> intended to do when I had more time.  I sent this one off this morning
> before I went to work.  I know Jorge was interested in the changes.  I'm
> back now, so will manually prepare more patch mails.

It looks like you're pasting diffs into your email client, which makes
it harder for others to apply them with `git am`.  When I'm submitting
patches via email, I usually do something like:

  $ git format-patch --cover-letter -v3 -o my-fix $(git merge-base my-fix master)
  $ emacs my-fix/v3-0000-cover-letter.patch
    … fill in subject and summarize changes since v2 …
  $ git send-email --to gentoo-catalyst@lists.gentoo.org \
      --in-reply-to '<message-id-for-v2@me.invalid>' my-fix/v3-*

Where `my-fix` is the name of my feature branch.  The `-v3` option
requires Git ≥1.8.2 for -v/--reroll-count, before that you had to use
something like `--subject-prefix 'PATCH v3'` [1].

By default, `send-email` will try and send the emails with `sendmail`.
If you don't have a working version of sendmail installed, you can
configure it to use SMTP instead [2,3].

By using the format-patch/send-email pair, you avoid copy/paste errors
and tedium.  You also have author information and commit messages
preserved in a form that `git am` understands.  Wins for everybody ;).

Cheers,
Trevor

[1]: http://kernel.org/pub/software/scm/git/docs/git-format-patch.html
[2]: http://kernel.org/pub/software/scm/git/docs/git-send-email.html
[3]: http://kernel.org/pub/software/scm/git/docs/git-config.html

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [gentoo-catalyst] [PATCH] Fix broken seed stage update...
@ 2013-02-27 21:56 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2013-02-27 21:56 UTC (permalink / raw
  To: brian.dolbec, gentoo-catalyst; +Cc: Brian Dolbec

Strip --usepkg and --buildpkg from emerge options for user defined update_seed_command.
Add a check for the update_seed option to set the correct update options.
Fix default seed stage update command to properly update gcc and it's deps.
Add a seed stage update system command and option.
Add --binpkg-respect-use=y for all cases --usepkg is enabled.

Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 catalyst/targets/stage1.py          |  3 ++-
 doc/catalyst-spec.5.txt             | 12 +++++++++++-
 targets/stage1/stage1-chroot.sh     | 17 ++++++++++++++---
 targets/support/chroot-functions.sh | 11 ++++++++++-
 4 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
index e936929..e067c8c 100644
--- a/catalyst/targets/stage1.py
+++ b/catalyst/targets/stage1.py
@@ -18,7 +18,8 @@ class stage1(StageBase):
 	def __init__(self,spec,addlargs):
 		self.required_values=[]
 		self.valid_values=["chost"]
-		self.valid_values.extend(["update_seed","update_seed_command"])
+		self.valid_values.extend(["update_seed","update_seed_command",
+			"update_seed_system"])
 		StageBase.__init__(self,spec,addlargs)
 
 	def set_stage_path(self):
diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt
index 4a6e06c..196bdc3 100644
--- a/doc/catalyst-spec.5.txt
+++ b/doc/catalyst-spec.5.txt
@@ -138,9 +138,19 @@ it should update the seed stage or not (valid values: `yes no`).
 *update_seed_command*::
 This is an optional command to pass to emerge for updating the seed
 stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
-If not specified, catalyst will update gcc deps.
+If not specified, catalyst will update gcc's deps, and rebuild gcc if any of
+it's deps are updated with a new version. Even if it itself is not updated.
+This prevents gcc breakage when it's dependency lib sonames have changed.
 This setting requires enabling update_seed.
 
+*update_seed_system*::
+This is an optional setting supported by stage1 to tell catalyst if
+it should update the seed's system packages or not (valid values: `yes no`).
+This is run after any update_seed_command, updating any remaining upgradable
+system packages.
+This setting requires enabling update_seed.
+
+
 Compilation
 ~~~~~~~~~~~
 
diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh
index 97aef7f..65c2d81 100755
--- a/targets/stage1/stage1-chroot.sh
+++ b/targets/stage1/stage1-chroot.sh
@@ -26,12 +26,23 @@ clst_root_path=/ setup_pkgmgr
 # Update stage3
 if [ -n "${clst_update_seed}" ]; then
 	if [ "${clst_update_seed}" == "yes" ]; then
-		echo "Updating seed stage..."
 		if [ -n "${clst_update_seed_command}" ]; then
-			clst_root_path=/ run_merge "--buildpkg=n ${clst_update_seed_command}"
+			echo "--- Updating seed stage with USER defined update_seed_command"
+			update_cmd=${clst_update_seed_command/--usepkg /}
+			update_cmd=${clst_update_seed_command/--buildpkg /}
+			clst_root_path=/ run_merge "${update_cmd}"
 		else
-			clst_root_path=/ run_merge "--buildpkg=n --update --deep --newuse --onlydeps gcc"
+			echo "--- Updating seed stage with DEFAULT update_seed_command"
+			update_cmd="--update --deep --complete-graph --rebuild-if-new-ver gcc"
+			clst_root_path=/ run_merge ${update_cmd}
 		fi
+		if [ "${clst_update_seed_system}" == "yes" ]; then
+			echo "--- Updating seed stage system packages"
+			update_cmd="--update --deep --complete-graph @system"
+			clst_root_path=/ run_merge ${update_cmd}
+		fi
+		# now reset the emerge options for the target
+		clst_update_seed=no setup_myemergeopts
 	elif [ "${clst_update_seed}" != "no" ]; then
 		echo "Invalid setting for update_seed: ${clst_update_seed}"
 		exit 1
diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
index 2524b4f..69d2923 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -133,9 +133,18 @@ setup_myemergeopts(){
 	then
 		export bootstrap_opts="${bootstrap_opts} -f"
 		export clst_myemergeopts="${clst_myemergeopts} -f"
+	# now intercept normal target options if we're updating the seed
+	# to update the seed we do not want binpkgs that may have links to
+	# sonames no longer installed, due to dependency updates.
+	# this function will be re-run later with clst_update_seed=no
+	elif [ "${clst_update_seed}" == "yes" ]
+	then
+		export clst_myemergeopts="${clst_myemergeopts} --newuse"
+		export bootstrap_opts="${bootstrap_opts} -r"
 	elif [ -n "${clst_PKGCACHE}" ]
 	then
-		export clst_myemergeopts="${clst_myemergeopts} --usepkg --buildpkg --newuse"
+		# if you add --usepkg, then also add --binpkg-respect-use=y
+		export clst_myemergeopts="${clst_myemergeopts} --usepkg --binpkg-respect-use=y --buildpkg --newuse"
 		export bootstrap_opts="${bootstrap_opts} -r"
 	fi
 }
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-02-27 21:58 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-27 21:56 [gentoo-catalyst] [PATCH] Fix broken seed stage update Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2013-02-26 16:20 [gentoo-catalyst] patch, fix " Brian Dolbec
2013-02-26 16:37 ` W. Trevor King
2013-02-26 16:47   ` Brian Dolbec
2013-02-03 12:44     ` [gentoo-catalyst] More proposed Catalyst changes W. Trevor King
2013-01-31 19:46       ` W. Trevor King
2013-02-03 12:20         ` W. Trevor King
2013-01-31 18:39           ` W. Trevor King
2013-02-26 18:04             ` [gentoo-catalyst] patch, fix broken seed stage update W. Trevor King
2013-02-27  1:30               ` Brian Dolbec
2013-02-27  1:40                 ` W. Trevor King
2013-02-27  2:35                   ` Brian Dolbec
2013-02-27  2:41                     ` Matt Turner
2013-02-26 16:48     ` Peter Stuge
2013-02-26 17:29 ` Rick "Zero_Chaos" Farina
2013-02-26 19:39   ` Matt Turner
2013-02-27  2:04     ` Brian Dolbec
2013-02-27  2:37       ` Matt Turner
2013-02-27 12:12       ` W. Trevor King
2013-02-27  2:37 ` Matt Turner
2013-02-27  3:03   ` Brian Dolbec
2013-02-27  3:22     ` Matt Turner
2013-02-27  3:49       ` Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox