Rework update_seed support.
authorJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
Thu, 6 Dec 2012 23:27:03 +0000 (23:27 +0000)
committerJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
Thu, 6 Dec 2012 23:27:03 +0000 (23:27 +0000)
Split it between update_seed (do we want to update the seed or not) and update_seed_command (custom command to run when updating).
The later is left for advanced uses / users. If not present, catalyst will update gcc deps.

doc/catalyst-spec.5.txt
modules/stage1_target.py
targets/stage1/stage1-chroot.sh

index 9a44558d2bccb4fa53a88841f9b2dd673b095a78..4a6e06c601a322ecf55dfc50ced9daa47b93bb96 100644 (file)
@@ -132,9 +132,14 @@ one CD, this defines the layout for the directories under
 `$storedir/builds` (example: `src cd2`).
 
 *update_seed*::
-This is an optional setting supported by stage1 that runs an emerge
-command on the seed stage before starting the stage1 build. (example:
-`--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
+This is an optional setting supported by stage1 to tell catalyst if
+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.
+This setting requires enabling update_seed.
 
 Compilation
 ~~~~~~~~~~~
index 9f0bff42bc75d7750d5933510282d1e2f3b5b795..6a439ecac9ba7f1c9f612e39cbd530d7289608ee 100644 (file)
@@ -13,9 +13,8 @@ class stage1_target(generic_stage_target):
        def __init__(self,spec,addlargs):
                self.required_values=[]
                self.valid_values=["chost"]
-               self.valid_values.extend(["update_seed"])
+               self.valid_values.extend(["update_seed","update_seed_command"])
                generic_stage_target.__init__(self,spec,addlargs)
-               self.set_update_seed()
 
        def set_stage_path(self):
                self.settings["stage_path"]=normpath(self.settings["chroot_path"]+self.settings["root_path"])
@@ -92,10 +91,6 @@ class stage1_target(generic_stage_target):
                self.mounts.append("/tmp/stage1root/proc")
                self.mountmap["/tmp/stage1root/proc"]="/proc"
 
-       def set_update_seed(self):
-               if self.settings.has_key("update_seed"):
-                       self.settings["update_seed_cache"]=self.settings["update_seed"]
-
 def register(foo):
        foo.update({"stage1":stage1_target})
        return foo
index 377a7cf7826b12f7462a1b88b7c55eefb8abc441..72c741abe48165d844d2571f0356b828f757972d 100644 (file)
@@ -22,9 +22,18 @@ fi
 clst_root_path=/ setup_pkgmgr
 
 # Update stage3
-if [ -n "${clst_update_seed_cache}" ]; then
-       echo "Updating seed stage..."
-       clst_root_path=/ run_merge "${clst_update_seed_cache}"
+if [ -n "${clst_update_seed}" ]; then
+       if [ "${clst_update_seed}" == "yes" ]; then
+               echo "Updating seed stage..."
+               if [ -n "${clst_update_command}" ]; then
+                       clst_root_path=/ run_merge "${clst_update_command}"
+               else
+                       clst_root_path=/ run_merge "--update --deep --newuse --onlydeps gcc"
+               fi
+       else if [ "${clst_update_seed}" != "no" ];
+               echo "Invalid setting for update_seed: ${clst_update_seed}"
+               exit 1
+       fi
 else
        echo "Skipping seed stage update..."
 fi