From: Jorge Manuel B. S. Vicetto (jmbsvicetto) Date: Thu, 6 Dec 2012 23:27:03 +0000 (+0000) Subject: Rework update_seed support. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4dc9de305df003ecc732cd76fa2b5ac39a358166;p=catalyst.git Rework update_seed support. 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. --- diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt index 9a44558d..4a6e06c6 100644 --- a/doc/catalyst-spec.5.txt +++ b/doc/catalyst-spec.5.txt @@ -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 ~~~~~~~~~~~ diff --git a/modules/stage1_target.py b/modules/stage1_target.py index 9f0bff42..6a439eca 100644 --- a/modules/stage1_target.py +++ b/modules/stage1_target.py @@ -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 diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index 377a7cf7..72c741ab 100644 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -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