1 |
Strip --usepkg and --buildpkg from emerge options for user defined update_seed_command. |
2 |
Add a check for the update_seed option to set the correct update options. |
3 |
Fix default seed stage update command to properly update gcc and it's deps. |
4 |
Add a seed stage update system command and option. |
5 |
Add --binpkg-respect-use=y for all cases --usepkg is enabled. |
6 |
|
7 |
Signed-off-by: Brian Dolbec <dolsen@g.o> |
8 |
--- |
9 |
catalyst/targets/stage1.py | 3 ++- |
10 |
doc/catalyst-spec.5.txt | 12 +++++++++++- |
11 |
targets/stage1/stage1-chroot.sh | 17 ++++++++++++++--- |
12 |
targets/support/chroot-functions.sh | 11 ++++++++++- |
13 |
4 files changed, 37 insertions(+), 6 deletions(-) |
14 |
|
15 |
diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py |
16 |
index e936929..e067c8c 100644 |
17 |
--- a/catalyst/targets/stage1.py |
18 |
+++ b/catalyst/targets/stage1.py |
19 |
@@ -18,7 +18,8 @@ class stage1(StageBase): |
20 |
def __init__(self,spec,addlargs): |
21 |
self.required_values=[] |
22 |
self.valid_values=["chost"] |
23 |
- self.valid_values.extend(["update_seed","update_seed_command"]) |
24 |
+ self.valid_values.extend(["update_seed","update_seed_command", |
25 |
+ "update_seed_system"]) |
26 |
StageBase.__init__(self,spec,addlargs) |
27 |
|
28 |
def set_stage_path(self): |
29 |
diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt |
30 |
index 4a6e06c..196bdc3 100644 |
31 |
--- a/doc/catalyst-spec.5.txt |
32 |
+++ b/doc/catalyst-spec.5.txt |
33 |
@@ -138,9 +138,19 @@ it should update the seed stage or not (valid values: `yes no`). |
34 |
*update_seed_command*:: |
35 |
This is an optional command to pass to emerge for updating the seed |
36 |
stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`) |
37 |
-If not specified, catalyst will update gcc deps. |
38 |
+If not specified, catalyst will update gcc's deps, and rebuild gcc if any of |
39 |
+it's deps are updated with a new version. Even if it itself is not updated. |
40 |
+This prevents gcc breakage when it's dependency lib sonames have changed. |
41 |
This setting requires enabling update_seed. |
42 |
|
43 |
+*update_seed_system*:: |
44 |
+This is an optional setting supported by stage1 to tell catalyst if |
45 |
+it should update the seed's system packages or not (valid values: `yes no`). |
46 |
+This is run after any update_seed_command, updating any remaining upgradable |
47 |
+system packages. |
48 |
+This setting requires enabling update_seed. |
49 |
+ |
50 |
+ |
51 |
Compilation |
52 |
~~~~~~~~~~~ |
53 |
|
54 |
diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh |
55 |
index 97aef7f..65c2d81 100755 |
56 |
--- a/targets/stage1/stage1-chroot.sh |
57 |
+++ b/targets/stage1/stage1-chroot.sh |
58 |
@@ -26,12 +26,23 @@ clst_root_path=/ setup_pkgmgr |
59 |
# Update stage3 |
60 |
if [ -n "${clst_update_seed}" ]; then |
61 |
if [ "${clst_update_seed}" == "yes" ]; then |
62 |
- echo "Updating seed stage..." |
63 |
if [ -n "${clst_update_seed_command}" ]; then |
64 |
- clst_root_path=/ run_merge "--buildpkg=n ${clst_update_seed_command}" |
65 |
+ echo "--- Updating seed stage with USER defined update_seed_command" |
66 |
+ update_cmd=${clst_update_seed_command/--usepkg /} |
67 |
+ update_cmd=${clst_update_seed_command/--buildpkg /} |
68 |
+ clst_root_path=/ run_merge "${update_cmd}" |
69 |
else |
70 |
- clst_root_path=/ run_merge "--buildpkg=n --update --deep --newuse --onlydeps gcc" |
71 |
+ echo "--- Updating seed stage with DEFAULT update_seed_command" |
72 |
+ update_cmd="--update --deep --complete-graph --rebuild-if-new-ver gcc" |
73 |
+ clst_root_path=/ run_merge ${update_cmd} |
74 |
fi |
75 |
+ if [ "${clst_update_seed_system}" == "yes" ]; then |
76 |
+ echo "--- Updating seed stage system packages" |
77 |
+ update_cmd="--update --deep --complete-graph @system" |
78 |
+ clst_root_path=/ run_merge ${update_cmd} |
79 |
+ fi |
80 |
+ # now reset the emerge options for the target |
81 |
+ clst_update_seed=no setup_myemergeopts |
82 |
elif [ "${clst_update_seed}" != "no" ]; then |
83 |
echo "Invalid setting for update_seed: ${clst_update_seed}" |
84 |
exit 1 |
85 |
diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh |
86 |
index 2524b4f..69d2923 100755 |
87 |
--- a/targets/support/chroot-functions.sh |
88 |
+++ b/targets/support/chroot-functions.sh |
89 |
@@ -133,9 +133,18 @@ setup_myemergeopts(){ |
90 |
then |
91 |
export bootstrap_opts="${bootstrap_opts} -f" |
92 |
export clst_myemergeopts="${clst_myemergeopts} -f" |
93 |
+ # now intercept normal target options if we're updating the seed |
94 |
+ # to update the seed we do not want binpkgs that may have links to |
95 |
+ # sonames no longer installed, due to dependency updates. |
96 |
+ # this function will be re-run later with clst_update_seed=no |
97 |
+ elif [ "${clst_update_seed}" == "yes" ] |
98 |
+ then |
99 |
+ export clst_myemergeopts="${clst_myemergeopts} --newuse" |
100 |
+ export bootstrap_opts="${bootstrap_opts} -r" |
101 |
elif [ -n "${clst_PKGCACHE}" ] |
102 |
then |
103 |
- export clst_myemergeopts="${clst_myemergeopts} --usepkg --buildpkg --newuse" |
104 |
+ # if you add --usepkg, then also add --binpkg-respect-use=y |
105 |
+ export clst_myemergeopts="${clst_myemergeopts} --usepkg --binpkg-respect-use=y --buildpkg --newuse" |
106 |
export bootstrap_opts="${bootstrap_opts} -r" |
107 |
fi |
108 |
} |
109 |
-- |
110 |
1.8.1.2 |