[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/, targets/stage3/, catalyst/base/
commit: 7d0d7fda6bdf8d2fe73a7623eba1b943bfabb9ce Author: Brian Dolbec gentoo org> AuthorDate: Wed Nov 29 17:15:41 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 29 17:33:43 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=7d0d7fda WIP: Add an updates step to stage3 just before the pre-clean step Can be used to correct an issue with the stage that hats the precean step. catalyst/base/stagebase.py | 16 catalyst/targets/stage3.py | 9 + targets/stage3/stage3-controller.sh | 4 targets/stage3/stage3-updates.sh| 10 ++ 4 files changed, 39 insertions(+) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 7a41973c..63a577a0 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -882,6 +882,22 @@ class StageBase(TargetBase, ClearBase, GenBase): if "snapcache" in self.settings["options"]: self.snapcache_lock.unlock() + def update_stage(self): + if "autoresume" in self.settings["options"] \ + and self.resume.is_enabled("update_stage"): + log.notice('Resume point detected, skipping update_stage operation...') + else: + if self.settings["update_stage_command"]: + try: + if os.path.exists(self.settings["controller_file"]): + cmd([self.settings['controller_file'], 'update_stage'], + env=self.env) + self.resume.enable("update_stage") + + except: + self.unbind() + raise CatalystError("Build failed, could not execute update_stage") + def config_profile_link(self): if "autoresume" in self.settings["options"] \ and self.resume.is_enabled("config_profile_link"): diff --git a/catalyst/targets/stage3.py b/catalyst/targets/stage3.py index f0831932..1120349f 100644 --- a/catalyst/targets/stage3.py +++ b/catalyst/targets/stage3.py @@ -14,6 +14,7 @@ class stage3(StageBase): def __init__(self,spec,addlargs): self.required_values=[] self.valid_values=[] + self.valid_values.extend(["update_stage_command"]) StageBase.__init__(self,spec,addlargs) def set_portage_overlay(self): @@ -24,5 +25,13 @@ class stage3(StageBase): "If you break it, you buy it. Don't complain to us about it.\n" "Don't say we did not warn you.") + def set_action_sequence(self): + """Set basic stage1, 2, 3 action sequences""" + self.settings["action_sequence"] = ["unpack", "unpack_snapshot", + "setup_confdir", "portage_overlay", + "base_dirs", "bind", "chroot_setup", "setup_environment", + "run_local", "update_stage", "preclean", "unbind", "clean"] + self.set_completion_action_sequences() + def set_cleanables(self): StageBase.set_cleanables(self) diff --git a/targets/stage3/stage3-controller.sh b/targets/stage3/stage3-controller.sh index df1479ea..ff958d67 100755 --- a/targets/stage3/stage3-controller.sh +++ b/targets/stage3/stage3-controller.sh @@ -15,6 +15,10 @@ case $1 in exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-chroot.sh ;; + update_stage) + exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-updates.sh + ;; + preclean) exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ;; diff --git a/targets/stage3/stage3-updates.sh b/targets/stage3/stage3-updates.sh new file mode 100644 index ..1b376de5 --- /dev/null +++ b/targets/stage3/stage3-updates.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Update stage3 (rebuilds, etc. needed to fix emerge complaints) +if [ -n "${clst_update_stage_command}" ]; then + echo "Updating stage..." + ${clst_update_stage_command} +else + echo "Skipping seed stage update..." +fi +
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/targets/, targets/stage3/
commit: 7d55d5609676afb32c612fbdad56d4d3b49e8f84 Author: Brian Dolbec gentoo org> AuthorDate: Wed Nov 29 17:15:41 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 29 17:15:41 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=7d55d560 WIP: Add an updates step to stage3 just before the pre-clean step Can be used to correct an issue with the stage that hats the precean step. catalyst/base/stagebase.py | 16 catalyst/targets/stage3.py | 9 + targets/stage3/stage3-controller.sh | 4 targets/stage3/stage3-updates.sh| 10 ++ 4 files changed, 39 insertions(+) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 7a41973c..63a577a0 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -882,6 +882,22 @@ class StageBase(TargetBase, ClearBase, GenBase): if "snapcache" in self.settings["options"]: self.snapcache_lock.unlock() + def update_stage(self): + if "autoresume" in self.settings["options"] \ + and self.resume.is_enabled("update_stage"): + log.notice('Resume point detected, skipping update_stage operation...') + else: + if self.settings["update_stage_command"]: + try: + if os.path.exists(self.settings["controller_file"]): + cmd([self.settings['controller_file'], 'update_stage'], + env=self.env) + self.resume.enable("update_stage") + + except: + self.unbind() + raise CatalystError("Build failed, could not execute update_stage") + def config_profile_link(self): if "autoresume" in self.settings["options"] \ and self.resume.is_enabled("config_profile_link"): diff --git a/catalyst/targets/stage3.py b/catalyst/targets/stage3.py index f0831932..1120349f 100644 --- a/catalyst/targets/stage3.py +++ b/catalyst/targets/stage3.py @@ -14,6 +14,7 @@ class stage3(StageBase): def __init__(self,spec,addlargs): self.required_values=[] self.valid_values=[] + self.valid_values.extend(["update_stage_command"]) StageBase.__init__(self,spec,addlargs) def set_portage_overlay(self): @@ -24,5 +25,13 @@ class stage3(StageBase): "If you break it, you buy it. Don't complain to us about it.\n" "Don't say we did not warn you.") + def set_action_sequence(self): + """Set basic stage1, 2, 3 action sequences""" + self.settings["action_sequence"] = ["unpack", "unpack_snapshot", + "setup_confdir", "portage_overlay", + "base_dirs", "bind", "chroot_setup", "setup_environment", + "run_local", "update_stage", "preclean", "unbind", "clean"] + self.set_completion_action_sequences() + def set_cleanables(self): StageBase.set_cleanables(self) diff --git a/targets/stage3/stage3-controller.sh b/targets/stage3/stage3-controller.sh index df1479ea..ff958d67 100755 --- a/targets/stage3/stage3-controller.sh +++ b/targets/stage3/stage3-controller.sh @@ -15,6 +15,10 @@ case $1 in exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-chroot.sh ;; + update_stage) + exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-updates.sh + ;; + preclean) exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ;; diff --git a/targets/stage3/stage3-updates.sh b/targets/stage3/stage3-updates.sh new file mode 100644 index ..1b376de5 --- /dev/null +++ b/targets/stage3/stage3-updates.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Update stage3 (rebuilds, etc. needed to fix emerge complaints) +if [ -n "${clst_update_stage_command}" ]; then + echo "Updating stage..." + ${clst_update_stage_command} +else + echo "Skipping seed stage update..." +fi +
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 03d8e9d832dcf2b3e52f4aa84e0782e47f3c9b71 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:56:45 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 22 01:16:20 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=03d8e9d8 base/stagebase.py: Rename unpack_portage resume point to unpack_repo One part of the effort to separate the portage name from the repository. catalyst/base/stagebase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index b857a64b..93c13902 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -808,7 +808,7 @@ class StageBase(TargetBase, ClearBase, GenBase): def unpack_snapshot(self): unpack = True - snapshot_hash = self.resume.get("unpack_portage") + snapshot_hash = self.resume.get("unpack_repo") unpack_errmsg = "Error unpacking snapshot using mode %(mode)s" @@ -847,7 +847,7 @@ class StageBase(TargetBase, ClearBase, GenBase): if "autoresume" in self.settings["options"] \ and os.path.exists(target_portdir) \ - and self.resume.is_enabled("unpack_portage") \ + and self.resume.is_enabled("unpack_repo") \ and self.settings["snapshot_path_hash"] == snapshot_hash: log.notice('Valid Resume point detected, skipping unpack of portage tree...') unpack = False @@ -868,7 +868,7 @@ class StageBase(TargetBase, ClearBase, GenBase): myf.write(self.settings["snapshot_path_hash"]) else: log.info('Setting snapshot autoresume point') - self.resume.enable("unpack_portage", + self.resume.enable("unpack_repo", data = self.settings["snapshot_path_hash"]) if "snapcache" in self.settings["options"]:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/
commit: 61527e6db7c2ac195741a243f3ab504f2652e26e Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:17:07 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 22 01:16:21 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=61527e6d targets/snapshot.py: Update the code and log messages to use the configured repo_name One more portage name seperation from being used to represent the ebuild repository. catalyst/targets/snapshot.py | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 8a9acdd9..087834eb 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -22,7 +22,7 @@ class snapshot(TargetBase, GenBase): TargetBase.__init__(self, myspec, addlargs) GenBase.__init__(self,myspec) #self.settings=myspec - self.settings["target_subpath"]="portage" + self.settings["target_subpath"]="repos" st=self.settings["storedir"] self.settings["snapshot_path"] = normpath(st + "/snapshots/" + self.settings["snapshot_name"] @@ -46,8 +46,9 @@ class snapshot(TargetBase, GenBase): success = True self.setup() - log.notice('Creating Portage tree snapshot %s from %s ...', - self.settings['version_stamp'], self.settings['portdir']) + log.notice('Creating %s tree snapshot %s from %s ...', + self.settings["repo_name"], self.settings['version_stamp'], + self.settings['portdir']) mytmp=self.settings["tmp_path"] ensure_dirs(mytmp) @@ -63,7 +64,7 @@ class snapshot(TargetBase, GenBase): mytmp + '/' + self.settings['repo_name'] + '/'], env=self.env) - log.notice('Compressing Portage snapshot tarball ...') + log.notice('Compressing %s snapshot tarball ...', self.settings["repo_name"]) compressor = CompressMap(self.settings["compress_definitions"], env=self.env, default_mode=self.settings['compression_mode'], comp_prog=self.settings["comp_prog"]) @@ -93,9 +94,9 @@ class snapshot(TargetBase, GenBase): def kill_chroot_pids(self): pass - @staticmethod - def cleanup(): + def cleanup(self): log.info('Cleaning up ...') + self.purge() def purge(self): clear_dir(self.settings['tmp_path'])
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: b9f2806724077740c8fdbf8bcdb5a431cb085e9d Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:24:22 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 22 01:16:21 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b9f28067 defaults.py: Update all repository, DISTDIR, PKGDIR settings to new /var paths All settings are still configurable in catalyst.conf. These are new reasonable settings for a relocated tree system. A user can still set their own locations during install, or at a later time. Default catalyst.conf settings will be changed at a later time after additional testing and the automatic stage building scripts have been updated. catalyst/defaults.py | 37 +++-- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 84ed2822..ed5766d6 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -31,6 +31,15 @@ valid_config_file_values.extend([ "distcc", "envscript", "compression_mode", "compressor_options", "decompressor_search_order", ]) +# set our base defaults here to keep +# them in one location. +BASE_GENTOO_DIR = "/var/gentoo" +REPODIR = BASE_GENTOO_DIR + "/repos" +DISTDIR = BASE_GENTOO_DIR + "/distfiles" +PKGDIR = BASE_GENTOO_DIR + "/packages" +MAINREPO = "gentoo" +PORTDIR = REPODIR + "/" + MAINREPO + confdefaults={ "archdir": "%(PythonDir)s/arch", "comp_prog": COMPRESSOR_PROGRAM_OPTIONS[TAR], @@ -39,28 +48,28 @@ confdefaults={ "compressor_options": XATTRS_OPTIONS[TAR], "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS[TAR], "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER, - "distdir": "/usr/portage/distfiles", + "distdir": DISTDIR[:], "hash_function": "crc32", "icecream": "/var/cache/icecream", 'list_xattrs_opt': LIST_XATTRS_OPTIONS[TAR], - "local_overlay": "/usr/local/portage", + "local_overlay": REPODIR[:] + "/local", "port_conf": "/etc/portage", "make_conf": "%(port_conf)s/make.conf", "options": set(), - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": PKGDIR[:], + "portdir": PORTDIR[:], "port_tmpdir": "/var/tmp/portage", "PythonDir": "./catalyst", - "repo_basedir": "/usr", - "repo_name": "portage", + "repo_basedir": REPODIR[:], + "repo_name": MAINREPO[:], "sharedir": "/usr/share/catalyst", "shdir": "/usr/share/catalyst/targets/", "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", - "snapshot_name": "portage-", + "snapshot_name": "%(repo_name)s-", "source_matching": "strict", "storedir": "/var/tmp/catalyst", - "target_distdir": "/var/portage/distfiles", - "target_pkgdir":"/var/portage/packages", + "target_distdir": DISTDIR[:], + "target_pkgdir": PKGDIR[:], } DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf' @@ -72,11 +81,11 @@ TARGET_MOUNT_DEFAULTS = { "ccache": "/var/tmp/ccache", "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", + "distdir": DISTDIR[:], "icecream": "/usr/lib/icecc/bin", "kerncache": "/tmp/kerncache", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": PKGDIR[:], + "portdir": PORTDIR[:], "port_tmpdir": "/var/tmp/portage", "port_logdir": "/var/log/portage", "proc": "/proc", @@ -86,8 +95,8 @@ TARGET_MOUNT_DEFAULTS = { SOURCE_MOUNT_DEFAULTS = { "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", - "portdir": "/usr/portage", + "distdir": DISTDIR[:], + "portdir": PORTDIR[:], "port_tmpdir": "tmpfs", "proc": "/proc", "shm": "shmfs",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/
commit: 57055cb085a23358febf61b2c7d36627fc2815dd Author: Brian Dolbec gentoo org> AuthorDate: Thu Apr 6 20:51:23 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 22 01:16:22 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=57055cb0 stage1: Fix seedcache to clean out the original seed root, keep only the stage1root Signed-off-by: Brian Dolbec gentoo.org> catalyst/fileops.py| 23 +++ catalyst/targets/stage1.py | 39 ++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/catalyst/fileops.py b/catalyst/fileops.py index ef4ee8d1..5e51f1fc 100644 --- a/catalyst/fileops.py +++ b/catalyst/fileops.py @@ -107,3 +107,26 @@ def clear_dir(target, mode=0o755, chg_flags=False, remove=False, def clear_path(target): """Nuke |target| regardless of it being a dir or file.""" clear_dir(target, remove=True) + + +def move_path(src, dest): + '''Move a source target to a new destination + + :param src: source path to move + :param dest: destination path to move it to + :returns: boolean + ''' + log.debug('Start move_path(%s, %s)', src, dest) + if os.path.isdir(src) and not os.path.islink(src): + if os.path.exists(dest): + log.warning('Removing existing target destination: %s', dest) + if not clear_dir(dest, remove=True): + return False + log.debug('Moving source...') + try: + shutil.move(src, dest) + except Exception: + log.error('move_path failed', exc_info=True) + return False + return True + return False diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py index 18ef520d..cc4366b6 100644 --- a/catalyst/targets/stage1.py +++ b/catalyst/targets/stage1.py @@ -9,7 +9,7 @@ from snakeoil import fileutils from catalyst import log from catalyst.support import normpath -from catalyst.fileops import ensure_dirs +from catalyst.fileops import ensure_dirs, move_path from catalyst.base.stagebase import StageBase @@ -86,3 +86,40 @@ class stage1(StageBase): self.mounts.append("stage1root/proc") self.target_mounts["stage1root/proc"] = "/tmp/stage1root/proc" self.mountmap["stage1root/proc"] = "/proc" + + def set_completion_action_sequences(self): + '''Override function for stage1 + + Its purpose is to move the new stage1root out of the seed stage + and rename it to the stage1 chroot_path after cleaning the seed stage + chroot for re-use in stage2 without the need to unpack it. + ''' + if "fetch" not in self.settings["options"]: + self.settings["action_sequence"].append("capture") + if "keepwork" in self.settings["options"]: + self.settings["action_sequence"].append("clear_autoresume") + elif "seedcache" in self.settings["options"]: + self.settings["action_sequence"].append("remove_autoresume") + self.settings["action_sequence"].append("clean_stage1") + else: + self.settings["action_sequence"].append("remove_autoresume") + self.settings["action_sequence"].append("remove_chroot") + return + + + def clean_stage1(self): + '''seedcache is enabled, so salvage the /tmp/stage1root, + remove the seed chroot''' + log.notice('Salvaging the stage1root from the chroot path ...') + # move the self.settings["stage_path"] outside of the self.settings["chroot_path"] + tmp_path = normpath(self.settings["storedir"] + "/tmp/" + "stage1root") + if move_path(self.settings["stage_path"], tmp_path): + self.remove_chroot() + # move it to self.settings["chroot_path"] + if not move_path(tmp_path, self.settings["chroot_path"]): + log.error('clean_stage1 failed, see previous log messages for details') + return False + log.notice('Successfully moved and cleaned the stage1root for the seedcache') + return True + log.error('clean_stage1 failed to move the stage1root to a temporary loation') + return False
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, targets/stage3/, catalyst/base/, targets/stage2/, targets/support/, ...
commit: 1eb7a1208dfe34d126f0f700b62214f01042b271 Author: Brian Dolbec gentoo org> AuthorDate: Sun Mar 19 22:06:11 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 22 01:16:22 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1eb7a120 Unify stage cleaning Move the clear_portage() code to the python side clean(). Put that code behind the sticky-config option. catalyst/base/stagebase.py | 9 + catalyst/fileops.py | 2 +- targets/stage2/stage2-controller.sh | 1 - targets/stage3/stage3-controller.sh | 1 - targets/stage4/stage4-controller.sh | 1 - targets/support/functions.sh| 11 --- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index a7aa7f41..7a41973c 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1201,6 +1201,15 @@ class StageBase(TargetBase, ClearBase, GenBase): if os.path.exists(hosts_file + '.catalyst'): os.rename(hosts_file + '.catalyst', hosts_file) + # optionally clean up portage configs + if ("portage_prefix" in self.settings and + "sticky-config" not in self.settings["options"]): + for _dir in "keywords", "mask", "unmask", "use": + target = pjoin([self.settings['chroot_path'], + "/etc/portage/package.%s" % _dir, + self.settings["portage_prefix"]]) + clear_path(target) + # Remove our overlay if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]): clear_path(self.settings["chroot_path"] + self.settings["local_overlay"]) diff --git a/catalyst/fileops.py b/catalyst/fileops.py index d2bd4530..ef4ee8d1 100644 --- a/catalyst/fileops.py +++ b/catalyst/fileops.py @@ -71,7 +71,7 @@ def clear_dir(target, mode=0o755, chg_flags=False, remove=False, mystat = None if os.path.isdir(target) and not os.path.islink(target): - log.info('Emptying directory: %s', target) + log.notice('Emptying directory: %s', target) # stat the dir, delete the dir, recreate the dir and set # the proper perms and ownership try: diff --git a/targets/stage2/stage2-controller.sh b/targets/stage2/stage2-controller.sh index 2eee79f3..25e51208 100755 --- a/targets/stage2/stage2-controller.sh +++ b/targets/stage2/stage2-controller.sh @@ -17,7 +17,6 @@ case $1 in ;; preclean) - clear_portage exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ;; diff --git a/targets/stage3/stage3-controller.sh b/targets/stage3/stage3-controller.sh index 2d415e40..df1479ea 100755 --- a/targets/stage3/stage3-controller.sh +++ b/targets/stage3/stage3-controller.sh @@ -16,7 +16,6 @@ case $1 in ;; preclean) - clear_portage exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ;; diff --git a/targets/stage4/stage4-controller.sh b/targets/stage4/stage4-controller.sh index 6a876c82..d42f302f 100755 --- a/targets/stage4/stage4-controller.sh +++ b/targets/stage4/stage4-controller.sh @@ -41,7 +41,6 @@ case $1 in ;; preclean) - clear_portage exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ${clst_root_path} ;; diff --git a/targets/support/functions.sh b/targets/support/functions.sh index ac4ec6c7..cca2fd82 100755 --- a/targets/support/functions.sh +++ b/targets/support/functions.sh @@ -16,17 +16,6 @@ delete_from_chroot(){ fi } -clear_portage() { - if [ -n "${clst_portage_prefix}" ]; then - for dir in "keywords", "mask", "unmask", "use"; do - [ -d ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix} ] && - echo "Clear ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix}" - [ -d ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix} ] && - rm -R "${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix}" - done - fi -} - exec_in_chroot(){ # Takes the full path to the source file as its argument # copies the file to the /tmp directory of the chroot
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 40c83b1e77efc539ca80709ae3ae0a56b065a7d1 Author: Brian Dolbec gentoo org> AuthorDate: Sat Mar 11 08:25:15 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 22 01:16:21 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=40c83b1e base/stagebase.py: Update the cleanables to the new repo variables catalyst/base/stagebase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 67382b9a..d44db985 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -452,7 +452,8 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_cleanables(self): self.settings["cleanables"] = ["/etc/resolv.conf", "/var/tmp/*", "/tmp/*", - "/root/*", self.settings["portdir"]] + "/root/*", self.settings["repo_basedir"] + "/" + + self.settings["repo_name"]] def set_snapshot_path(self): self.settings["snapshot_path"] = file_check(
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 739a1a78513a27b5234fce708acb64211c43cb74 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:58:10 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 22 01:16:20 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=739a1a78 base/stagebase.py: Correctly log the correct function name for unpack_snapshot() catalyst/base/stagebase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 93c13902..532f0997 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -822,7 +822,7 @@ class StageBase(TargetBase, ClearBase, GenBase): target_portdir = normpath(self.settings["chroot_path"] + self.settings["repo_basedir"] + "/" + self.settings["repo_name"]) log.info('%s', self.settings['chroot_path']) - log.info('unpack(), target_portdir = %s', target_portdir) + log.info('unpack_snapshot(), target_portdir = %s', target_portdir) if "snapcache" in self.settings["options"]: snapshot_cache_hash_path = pjoin( self.settings['snapshot_cache_path'], 'catalyst-hash')
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/, catalyst/
commit: 42747d0193e1914270a65cfa81df5e3a017a53e2 Author: Brian Dolbec gentoo org> AuthorDate: Thu Apr 6 20:51:23 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Apr 6 20:52:26 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=42747d01 stage1: Fix seedcache to clean out the original seed root, keep only the stage1root Signed-off-by: Brian Dolbec gentoo.org> catalyst/fileops.py| 23 +++ catalyst/targets/stage1.py | 39 ++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/catalyst/fileops.py b/catalyst/fileops.py index ef4ee8d1..5e51f1fc 100644 --- a/catalyst/fileops.py +++ b/catalyst/fileops.py @@ -107,3 +107,26 @@ def clear_dir(target, mode=0o755, chg_flags=False, remove=False, def clear_path(target): """Nuke |target| regardless of it being a dir or file.""" clear_dir(target, remove=True) + + +def move_path(src, dest): + '''Move a source target to a new destination + + :param src: source path to move + :param dest: destination path to move it to + :returns: boolean + ''' + log.debug('Start move_path(%s, %s)', src, dest) + if os.path.isdir(src) and not os.path.islink(src): + if os.path.exists(dest): + log.warning('Removing existing target destination: %s', dest) + if not clear_dir(dest, remove=True): + return False + log.debug('Moving source...') + try: + shutil.move(src, dest) + except Exception: + log.error('move_path failed', exc_info=True) + return False + return True + return False diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py index 18ef520d..cc4366b6 100644 --- a/catalyst/targets/stage1.py +++ b/catalyst/targets/stage1.py @@ -9,7 +9,7 @@ from snakeoil import fileutils from catalyst import log from catalyst.support import normpath -from catalyst.fileops import ensure_dirs +from catalyst.fileops import ensure_dirs, move_path from catalyst.base.stagebase import StageBase @@ -86,3 +86,40 @@ class stage1(StageBase): self.mounts.append("stage1root/proc") self.target_mounts["stage1root/proc"] = "/tmp/stage1root/proc" self.mountmap["stage1root/proc"] = "/proc" + + def set_completion_action_sequences(self): + '''Override function for stage1 + + Its purpose is to move the new stage1root out of the seed stage + and rename it to the stage1 chroot_path after cleaning the seed stage + chroot for re-use in stage2 without the need to unpack it. + ''' + if "fetch" not in self.settings["options"]: + self.settings["action_sequence"].append("capture") + if "keepwork" in self.settings["options"]: + self.settings["action_sequence"].append("clear_autoresume") + elif "seedcache" in self.settings["options"]: + self.settings["action_sequence"].append("remove_autoresume") + self.settings["action_sequence"].append("clean_stage1") + else: + self.settings["action_sequence"].append("remove_autoresume") + self.settings["action_sequence"].append("remove_chroot") + return + + + def clean_stage1(self): + '''seedcache is enabled, so salvage the /tmp/stage1root, + remove the seed chroot''' + log.notice('Salvaging the stage1root from the chroot path ...') + # move the self.settings["stage_path"] outside of the self.settings["chroot_path"] + tmp_path = normpath(self.settings["storedir"] + "/tmp/" + "stage1root") + if move_path(self.settings["stage_path"], tmp_path): + self.remove_chroot() + # move it to self.settings["chroot_path"] + if not move_path(tmp_path, self.settings["chroot_path"]): + log.error('clean_stage1 failed, see previous log messages for details') + return False + log.notice('Successfully moved and cleaned the stage1root for the seedcache') + return True + log.error('clean_stage1 failed to move the stage1root to a temporary loation') + return False
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, targets/stage2/, targets/support/, targets/stage3/, targets/stage4/, ...
commit: 2e9135319c1fca1f6d3ed84d9f13b0e300db49c7 Author: Brian Dolbec gentoo org> AuthorDate: Sun Mar 19 22:06:11 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Mar 19 22:06:11 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=2e913531 Unify stage cleaning Move the clear_portage() code to the python side clean(). Put that code behind the sticky-config option. catalyst/base/stagebase.py | 9 + catalyst/fileops.py | 2 +- targets/stage2/stage2-controller.sh | 1 - targets/stage3/stage3-controller.sh | 1 - targets/stage4/stage4-controller.sh | 1 - targets/support/functions.sh| 11 --- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index a7aa7f41..7a41973c 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1201,6 +1201,15 @@ class StageBase(TargetBase, ClearBase, GenBase): if os.path.exists(hosts_file + '.catalyst'): os.rename(hosts_file + '.catalyst', hosts_file) + # optionally clean up portage configs + if ("portage_prefix" in self.settings and + "sticky-config" not in self.settings["options"]): + for _dir in "keywords", "mask", "unmask", "use": + target = pjoin([self.settings['chroot_path'], + "/etc/portage/package.%s" % _dir, + self.settings["portage_prefix"]]) + clear_path(target) + # Remove our overlay if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]): clear_path(self.settings["chroot_path"] + self.settings["local_overlay"]) diff --git a/catalyst/fileops.py b/catalyst/fileops.py index d2bd4530..ef4ee8d1 100644 --- a/catalyst/fileops.py +++ b/catalyst/fileops.py @@ -71,7 +71,7 @@ def clear_dir(target, mode=0o755, chg_flags=False, remove=False, mystat = None if os.path.isdir(target) and not os.path.islink(target): - log.info('Emptying directory: %s', target) + log.notice('Emptying directory: %s', target) # stat the dir, delete the dir, recreate the dir and set # the proper perms and ownership try: diff --git a/targets/stage2/stage2-controller.sh b/targets/stage2/stage2-controller.sh index 2eee79f3..25e51208 100755 --- a/targets/stage2/stage2-controller.sh +++ b/targets/stage2/stage2-controller.sh @@ -17,7 +17,6 @@ case $1 in ;; preclean) - clear_portage exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ;; diff --git a/targets/stage3/stage3-controller.sh b/targets/stage3/stage3-controller.sh index 2d415e40..df1479ea 100755 --- a/targets/stage3/stage3-controller.sh +++ b/targets/stage3/stage3-controller.sh @@ -16,7 +16,6 @@ case $1 in ;; preclean) - clear_portage exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ;; diff --git a/targets/stage4/stage4-controller.sh b/targets/stage4/stage4-controller.sh index 6a876c82..d42f302f 100755 --- a/targets/stage4/stage4-controller.sh +++ b/targets/stage4/stage4-controller.sh @@ -41,7 +41,6 @@ case $1 in ;; preclean) - clear_portage exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ${clst_root_path} ;; diff --git a/targets/support/functions.sh b/targets/support/functions.sh index ac4ec6c7..cca2fd82 100755 --- a/targets/support/functions.sh +++ b/targets/support/functions.sh @@ -16,17 +16,6 @@ delete_from_chroot(){ fi } -clear_portage() { - if [ -n "${clst_portage_prefix}" ]; then - for dir in "keywords", "mask", "unmask", "use"; do - [ -d ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix} ] && - echo "Clear ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix}" - [ -d ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix} ] && - rm -R "${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix}" - done - fi -} - exec_in_chroot(){ # Takes the full path to the source file as its argument # copies the file to the /tmp directory of the chroot
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/, targets/stage3/, etc/, targets/stage4/, catalyst/base/, ...
commit: 587b7e303c4cbd01185d832a19e6b58bfe081d07 Author: Brian Dolbec gentoo org> AuthorDate: Sun Mar 19 07:58:13 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Mar 19 07:58:13 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=587b7e30 Unify all make.conf settings and writing This excludes stage1 builds which needs to modify the seed stage's make.conf for initial stage building. catalyst/base/stagebase.py | 220 ++-- catalyst/targets/stage1.py | 2 + etc/catalyst.conf | 8 ++ targets/stage2/stage2-controller.sh | 2 - targets/stage3/stage3-controller.sh | 2 - targets/stage4/stage4-controller.sh | 2 - targets/support/chroot-functions.sh | 16 +-- targets/support/functions.sh| 12 -- 8 files changed, 130 insertions(+), 134 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index d44db985..11a9f178 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -548,27 +548,29 @@ class StageBase(TargetBase, ClearBase, GenBase): return def set_use(self): - if self.settings["spec_prefix"] + "/use" in self.settings: - self.settings["use"] = \ - self.settings[self.settings["spec_prefix"] + "/use"] - del self.settings[self.settings["spec_prefix"] + "/use"] - if "use" not in self.settings: - self.settings["use"] = "" - if isinstance(self.settings['use'], str): - self.settings["use"] = self.settings["use"].split() + use = self.settings["spec_prefix"] + "/use" + if use in self.settings: + if isinstance(self.settings[use], str): + self.settings["use"] = self.settings[use].split() + self.settings["use"] = self.settings[use] + del self.settings[use] + else: + self.settings["use"] = [] def set_catalyst_use(self): - if self.settings["spec_prefix"] + "/catalyst_use" in self.settings: - self.settings["catalyst_use"] = \ - self.settings[self.settings["spec_prefix"]+"/catalyst_use"] - del self.settings[self.settings["spec_prefix"]+"/catalyst_use"] - if "catalyst_use" not in self.settings: - self.settings["catalyst_use"] = "" - if isinstance(self.settings['catalyst_use'], str): - self.settings["catalyst_use"] = self.settings["catalyst_use"].split() + catalyst_use = self.settings["spec_prefix"] + "/catalyst_use" + if catalyst_use in self.settings: + if isinstance(self.settings[catalyst_use], str): + self.settings["catalyst_use"] = self.settings[catalyst_use].split() + else: + self.settings["catalyst_use"] = self.settings[catalyst_use] + del self.settings[catalyst_use] + else: + self.settings["catalyst_use"] = [] # Force bindist when options ask for it - if "BINDIST" in self.settings: + if "bindist" in self.settings["options"]: + log.debug("Enabling bindist USE flag") self.settings["catalyst_use"].append("bindist") def set_stage_path(self): @@ -1071,92 +1073,98 @@ class StageBase(TargetBase, ClearBase, GenBase): makepath = normpath(self.settings["chroot_path"] + self.settings["make_conf"]) clear_path(makepath) - myf = open(makepath, "w") - myf.write("# These settings were set by the catalyst build script " - "that automatically\n# built this stage.\n") - myf.write("# Please consult " - "/usr/share/portage/config/make.conf.example " - "for a more\n# detailed example.\n") - - for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS", - "ASFLAGS"]: - if not flags in self.settings: - continue - if flags in ["LDFLAGS", "ASFLAGS"]: - myf.write("# %s is unsupported. USE AT YOUR OWN RISK!\n" - % flags) - if (flags is not "CFLAGS" and - self.settings[flags] == self.settings["CFLAGS"]): - myf.write('%s="${CFLAGS}"\n' % flags) - elif isinstance(self.
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: e2293d1c1dd2c30c9479b74ed243722bca36846f Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:24:22 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 16 22:56:11 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e2293d1c defaults.py: Update all repository, DISTDIR, PKGDIR settings to new /var paths All settings are still configurable in catalyst.conf. These are new reasonable settings for a relocated tree system. A user can still set their own locations during install, or at a later time. Default catalyst.conf settings will be changed at a later time after additional testing and the automatic stage building scripts have been updated. catalyst/defaults.py | 37 +++-- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 84ed282..ed5766d 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -31,6 +31,15 @@ valid_config_file_values.extend([ "distcc", "envscript", "compression_mode", "compressor_options", "decompressor_search_order", ]) +# set our base defaults here to keep +# them in one location. +BASE_GENTOO_DIR = "/var/gentoo" +REPODIR = BASE_GENTOO_DIR + "/repos" +DISTDIR = BASE_GENTOO_DIR + "/distfiles" +PKGDIR = BASE_GENTOO_DIR + "/packages" +MAINREPO = "gentoo" +PORTDIR = REPODIR + "/" + MAINREPO + confdefaults={ "archdir": "%(PythonDir)s/arch", "comp_prog": COMPRESSOR_PROGRAM_OPTIONS[TAR], @@ -39,28 +48,28 @@ confdefaults={ "compressor_options": XATTRS_OPTIONS[TAR], "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS[TAR], "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER, - "distdir": "/usr/portage/distfiles", + "distdir": DISTDIR[:], "hash_function": "crc32", "icecream": "/var/cache/icecream", 'list_xattrs_opt': LIST_XATTRS_OPTIONS[TAR], - "local_overlay": "/usr/local/portage", + "local_overlay": REPODIR[:] + "/local", "port_conf": "/etc/portage", "make_conf": "%(port_conf)s/make.conf", "options": set(), - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": PKGDIR[:], + "portdir": PORTDIR[:], "port_tmpdir": "/var/tmp/portage", "PythonDir": "./catalyst", - "repo_basedir": "/usr", - "repo_name": "portage", + "repo_basedir": REPODIR[:], + "repo_name": MAINREPO[:], "sharedir": "/usr/share/catalyst", "shdir": "/usr/share/catalyst/targets/", "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", - "snapshot_name": "portage-", + "snapshot_name": "%(repo_name)s-", "source_matching": "strict", "storedir": "/var/tmp/catalyst", - "target_distdir": "/var/portage/distfiles", - "target_pkgdir":"/var/portage/packages", + "target_distdir": DISTDIR[:], + "target_pkgdir": PKGDIR[:], } DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf' @@ -72,11 +81,11 @@ TARGET_MOUNT_DEFAULTS = { "ccache": "/var/tmp/ccache", "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", + "distdir": DISTDIR[:], "icecream": "/usr/lib/icecc/bin", "kerncache": "/tmp/kerncache", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": PKGDIR[:], + "portdir": PORTDIR[:], "port_tmpdir": "/var/tmp/portage", "port_logdir": "/var/log/portage", "proc": "/proc", @@ -86,8 +95,8 @@ TARGET_MOUNT_DEFAULTS = { SOURCE_MOUNT_DEFAULTS = { "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", - "portdir": "/usr/portage", + "distdir": DISTDIR[:], + "portdir": PORTDIR[:], "port_tmpdir": "tmpfs", "proc": "/proc", "shm": "shmfs",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: cd9783a9c232fc2dcfdb6f2aa6d56153e0b95174 Author: Brian Dolbec gentoo org> AuthorDate: Sat Mar 11 08:25:15 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 16 22:56:11 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=cd9783a9 base/stagebase.py: Update the cleanables to the new repo variables catalyst/base/stagebase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 67382b9..d44db98 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -452,7 +452,8 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_cleanables(self): self.settings["cleanables"] = ["/etc/resolv.conf", "/var/tmp/*", "/tmp/*", - "/root/*", self.settings["portdir"]] + "/root/*", self.settings["repo_basedir"] + "/" + + self.settings["repo_name"]] def set_snapshot_path(self): self.settings["snapshot_path"] = file_check(
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/
commit: d463bea02a4d6bae7f3018a297167b1a1fb21953 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:17:07 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 16 22:56:11 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d463bea0 targets/snapshot.py: Update the code and log messages to use the configured repo_name One more portage name seperation from being used to represent the ebuild repository. catalyst/targets/snapshot.py | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 8a9acdd..087834e 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -22,7 +22,7 @@ class snapshot(TargetBase, GenBase): TargetBase.__init__(self, myspec, addlargs) GenBase.__init__(self,myspec) #self.settings=myspec - self.settings["target_subpath"]="portage" + self.settings["target_subpath"]="repos" st=self.settings["storedir"] self.settings["snapshot_path"] = normpath(st + "/snapshots/" + self.settings["snapshot_name"] @@ -46,8 +46,9 @@ class snapshot(TargetBase, GenBase): success = True self.setup() - log.notice('Creating Portage tree snapshot %s from %s ...', - self.settings['version_stamp'], self.settings['portdir']) + log.notice('Creating %s tree snapshot %s from %s ...', + self.settings["repo_name"], self.settings['version_stamp'], + self.settings['portdir']) mytmp=self.settings["tmp_path"] ensure_dirs(mytmp) @@ -63,7 +64,7 @@ class snapshot(TargetBase, GenBase): mytmp + '/' + self.settings['repo_name'] + '/'], env=self.env) - log.notice('Compressing Portage snapshot tarball ...') + log.notice('Compressing %s snapshot tarball ...', self.settings["repo_name"]) compressor = CompressMap(self.settings["compress_definitions"], env=self.env, default_mode=self.settings['compression_mode'], comp_prog=self.settings["comp_prog"]) @@ -93,9 +94,9 @@ class snapshot(TargetBase, GenBase): def kill_chroot_pids(self): pass - @staticmethod - def cleanup(): + def cleanup(self): log.info('Cleaning up ...') + self.purge() def purge(self): clear_dir(self.settings['tmp_path'])
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, etc/, catalyst/base/
commit: 67353c407c0a2dfbd2efb36e7e8b452471faf2cf Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:14:04 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 16 22:56:11 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=67353c40 base/stagebase.py: Seperate out the writing of the make.conf file By sepaerating out the writing of the make.conf file, it keeps all code to do so in one place. I also fixed the code to correctly set the target chroot directories for PORTDIR, DISTDIR, PKGDIR and PORTDIR_OVERLAY. The same code also re-writes make.conf toggling any PORTDIR_OVERLAY setting during the clean() run. Add target_distdir and target_pkgdir settings to defaults and catalyst.conf. This allows for more flexibility between host and target settings. They can be individually configured this way. Update target an source mounts from the configured settings. catalyst/base/stagebase.py | 194 - catalyst/defaults.py | 2 + etc/catalyst.conf | 2 + 3 files changed, 106 insertions(+), 92 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 532f099..67382b9 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -213,8 +213,13 @@ class StageBase(TargetBase, ClearBase, GenBase): self.mounts = ["proc", "dev", "portdir", "distdir", "port_tmpdir"] # initialize our source mounts self.mountmap = SOURCE_MOUNT_DEFAULTS.copy() - # update them from settings + # update these from settings + self.mountmap["portdir"] = self.settings["portdir"] self.mountmap["distdir"] = self.settings["distdir"] + self.target_mounts["portdir"] = normpath(self.settings["repo_basedir"] + + "/" + self.settings["repo_name"]) + self.target_mounts["distdir"] = self.settings["target_distdir"] + self.target_mounts["packagedir"] = self.settings["target_pkgdir"] if "snapcache" not in self.settings["options"]: self.mounts.remove("portdir") self.mountmap["portdir"] = None @@ -1051,96 +1056,106 @@ class StageBase(TargetBase, ClearBase, GenBase): if os.path.exists(hosts_file): os.rename(hosts_file, hosts_file + '.catalyst') shutil.copy('/etc/hosts', hosts_file) + # write out the make.conf + try: + self.write_make_conf(setup=True) + except OSError as e: + raise CatalystError('Could not write %s: %s' % ( + normpath(self.settings["chroot_path"] + + self.settings["make_conf"]), e)) + self.resume.enable("chroot_setup") - # Modify and write out make.conf (for the chroot) - makepath = normpath(self.settings["chroot_path"] + - self.settings["make_conf"]) - clear_path(makepath) - myf = open(makepath, "w") - myf.write("# These settings were set by the catalyst build script " - "that automatically\n# built this stage.\n") - myf.write("# Please consult " - "/usr/share/portage/config/make.conf.example " - "for a more\n# detailed example.\n") - - for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS", - "ASFLAGS"]: - if not flags in self.settings: - continue - if flags in ["LDFLAGS", "ASFLAGS"]: - myf.write("# %s is unsupported. USE AT YOUR OWN RISK!\n" - % flags) - if (flags is not "CFLAGS" and - self.settings[flags] == self.settings["CFLAGS"]): - myf.write('%s="${CFLAGS}"\n' % flags) - elif isinstance(self.settings[flags], list): - myf.write('%s="%s"\n' - % (flags, ' '.join(self.settings[flags]))) - else: - myf.write('%s="%s"\n' - % (flags, self.settings[flags])) - - if "CBUILD" in self.settings: - my
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: e5a53e42022668563965ede6409a3de233af332c Author: Mike Frysinger gentoo org> AuthorDate: Tue Oct 6 20:32:03 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 11 22:01:27 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e5a53e42 catalyst: create namespaces for building This helps isolate the catalyst builds from the rest of the system and allows us to build as non-root user in more cases. We don't support pid or user namespaces yet. catalyst/main.py | 9 + 1 file changed, 9 insertions(+) diff --git a/catalyst/main.py b/catalyst/main.py index 51d2b04..b8ae662 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -12,6 +12,7 @@ import os import sys from snakeoil import process +from snakeoil.process import namespaces from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, CONTENTS_DEFINITIONS) @@ -421,6 +422,14 @@ def _main(parser, opts): # catalyst cannot be run as a normal user due to chroots, mounts, etc log.critical('This script requires root privileges to operate') + # Start off by creating unique namespaces to run in. Would be nice to + # use pid & user namespaces, but snakeoil's namespace module has signal + # transfer issues (CTRL+C doesn't propagate), and user namespaces need + # more work due to Gentoo build process (uses sudo/root/portage). + namespaces.simple_unshare( + mount=True, uts=True, ipc=True, pid=False, net=False, user=False, + hostname='catalyst') + # everything is setup, so the build is a go try: success = build_target(addlargs)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 1e3d3d2914239d92d321648405f6320a7d94cc39 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:58:10 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 16 22:56:10 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1e3d3d29 base/stagebase.py: Correctly log the correct function name for unpack_snapshot() catalyst/base/stagebase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 93c1390..532f099 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -822,7 +822,7 @@ class StageBase(TargetBase, ClearBase, GenBase): target_portdir = normpath(self.settings["chroot_path"] + self.settings["repo_basedir"] + "/" + self.settings["repo_name"]) log.info('%s', self.settings['chroot_path']) - log.info('unpack(), target_portdir = %s', target_portdir) + log.info('unpack_snapshot(), target_portdir = %s', target_portdir) if "snapcache" in self.settings["options"]: snapshot_cache_hash_path = pjoin( self.settings['snapshot_cache_path'], 'catalyst-hash')
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 3a3c953960b807dc2dfc8372b58007eb6becdd41 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:56:45 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 16 22:56:10 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=3a3c9539 base/stagebase.py: Rename unpack_portage resume point to unpack_repo One part of the effort to separate the portage name from the repository. catalyst/base/stagebase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index b857a64..93c1390 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -808,7 +808,7 @@ class StageBase(TargetBase, ClearBase, GenBase): def unpack_snapshot(self): unpack = True - snapshot_hash = self.resume.get("unpack_portage") + snapshot_hash = self.resume.get("unpack_repo") unpack_errmsg = "Error unpacking snapshot using mode %(mode)s" @@ -847,7 +847,7 @@ class StageBase(TargetBase, ClearBase, GenBase): if "autoresume" in self.settings["options"] \ and os.path.exists(target_portdir) \ - and self.resume.is_enabled("unpack_portage") \ + and self.resume.is_enabled("unpack_repo") \ and self.settings["snapshot_path_hash"] == snapshot_hash: log.notice('Valid Resume point detected, skipping unpack of portage tree...') unpack = False @@ -868,7 +868,7 @@ class StageBase(TargetBase, ClearBase, GenBase): myf.write(self.settings["snapshot_path_hash"]) else: log.info('Setting snapshot autoresume point') - self.resume.enable("unpack_portage", + self.resume.enable("unpack_repo", data = self.settings["snapshot_path_hash"]) if "snapcache" in self.settings["options"]:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: a4b4e22c2d91d500198f8b15c14f7a4eb6060998 Author: Brian Dolbec gentoo org> AuthorDate: Sat Mar 11 08:25:15 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 11 09:01:06 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=a4b4e22c base/stagebase.py: Update the cleanables to the new repo variables catalyst/base/stagebase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 31efdf6..01aced0 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -471,7 +471,8 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_cleanables(self): self.settings["cleanables"] = ["/etc/resolv.conf", "/var/tmp/*", "/tmp/*", - "/root/*", self.settings["portdir"]] + "/root/*", self.settings["repo_basedir"] + "/" + + self.settings["repo_name"]] def set_snapshot_path(self): self.settings["snapshot_path"] = file_check(
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 858e2f609360fbc676e2e98931908e2e48710253 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:24:22 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 11 09:00:37 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=858e2f60 defaults.py: Update all repository, DISTDIR, PKGDIR settings to new /var paths All settings are still configurable in catalyst.conf. These are new reasonable settings for a relocated tree system. A user can still set their own locations during install, or at a later time. Default catalyst.conf settings will be changed at a later time after additional testing and the automatic stage building scripts have been updated. catalyst/defaults.py | 37 +++-- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 84ed282..ed5766d 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -31,6 +31,15 @@ valid_config_file_values.extend([ "distcc", "envscript", "compression_mode", "compressor_options", "decompressor_search_order", ]) +# set our base defaults here to keep +# them in one location. +BASE_GENTOO_DIR = "/var/gentoo" +REPODIR = BASE_GENTOO_DIR + "/repos" +DISTDIR = BASE_GENTOO_DIR + "/distfiles" +PKGDIR = BASE_GENTOO_DIR + "/packages" +MAINREPO = "gentoo" +PORTDIR = REPODIR + "/" + MAINREPO + confdefaults={ "archdir": "%(PythonDir)s/arch", "comp_prog": COMPRESSOR_PROGRAM_OPTIONS[TAR], @@ -39,28 +48,28 @@ confdefaults={ "compressor_options": XATTRS_OPTIONS[TAR], "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS[TAR], "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER, - "distdir": "/usr/portage/distfiles", + "distdir": DISTDIR[:], "hash_function": "crc32", "icecream": "/var/cache/icecream", 'list_xattrs_opt': LIST_XATTRS_OPTIONS[TAR], - "local_overlay": "/usr/local/portage", + "local_overlay": REPODIR[:] + "/local", "port_conf": "/etc/portage", "make_conf": "%(port_conf)s/make.conf", "options": set(), - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": PKGDIR[:], + "portdir": PORTDIR[:], "port_tmpdir": "/var/tmp/portage", "PythonDir": "./catalyst", - "repo_basedir": "/usr", - "repo_name": "portage", + "repo_basedir": REPODIR[:], + "repo_name": MAINREPO[:], "sharedir": "/usr/share/catalyst", "shdir": "/usr/share/catalyst/targets/", "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", - "snapshot_name": "portage-", + "snapshot_name": "%(repo_name)s-", "source_matching": "strict", "storedir": "/var/tmp/catalyst", - "target_distdir": "/var/portage/distfiles", - "target_pkgdir":"/var/portage/packages", + "target_distdir": DISTDIR[:], + "target_pkgdir": PKGDIR[:], } DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf' @@ -72,11 +81,11 @@ TARGET_MOUNT_DEFAULTS = { "ccache": "/var/tmp/ccache", "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", + "distdir": DISTDIR[:], "icecream": "/usr/lib/icecc/bin", "kerncache": "/tmp/kerncache", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": PKGDIR[:], + "portdir": PORTDIR[:], "port_tmpdir": "/var/tmp/portage", "port_logdir": "/var/log/portage", "proc": "/proc", @@ -86,8 +95,8 @@ TARGET_MOUNT_DEFAULTS = { SOURCE_MOUNT_DEFAULTS = { "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", - "portdir": "/usr/portage", + "distdir": DISTDIR[:], + "portdir": PORTDIR[:], "port_tmpdir": "tmpfs", "proc": "/proc", "shm": "shmfs",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 178a8b859c8d3e885669a39219edefc1ebb55318 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:24:22 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 11 04:43:28 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=178a8b85 defaults.py: Update all repository, DISTDIR, PKGDIR settings to new /var paths All settings are still configurable in catalyst.conf. These are new reasonable settings for a relocated tree system. A user can still set their own locations during install, or at a later time. Default catalyst.conf settings will be changed at a later time after additional testing and the automatic stage building scripts have been updated. catalyst/defaults.py | 37 +++-- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 84ed282..d6b9243 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -31,6 +31,15 @@ valid_config_file_values.extend([ "distcc", "envscript", "compression_mode", "compressor_options", "decompressor_search_order", ]) +# set our base defaults here to keep +# them in one location. +BASE_GENTOO_DIR = "/var/gentoo" +REPODIR = BASE_GENTOO_DIR + "/repos" +DISTDIR = BASE_GENTOO_DIR + "/distfiles" +PKGDIR = BASE_GENTOO_DIR + "/packages" +MAINREPO = "gentoo" +PORTDIR = REPODIR + "/" + MAINREPO + confdefaults={ "archdir": "%(PythonDir)s/arch", "comp_prog": COMPRESSOR_PROGRAM_OPTIONS[TAR], @@ -39,28 +48,28 @@ confdefaults={ "compressor_options": XATTRS_OPTIONS[TAR], "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS[TAR], "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER, - "distdir": "/usr/portage/distfiles", + "distdir": DISTDIR, "hash_function": "crc32", "icecream": "/var/cache/icecream", 'list_xattrs_opt': LIST_XATTRS_OPTIONS[TAR], - "local_overlay": "/usr/local/portage", + "local_overlay": REPODIR + "/local", "port_conf": "/etc/portage", "make_conf": "%(port_conf)s/make.conf", "options": set(), - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": PKGDIR, + "portdir": PORTDIR, "port_tmpdir": "/var/tmp/portage", "PythonDir": "./catalyst", - "repo_basedir": "/usr", - "repo_name": "portage", + "repo_basedir": REPODIR, + "repo_name": "gentoo", "sharedir": "/usr/share/catalyst", "shdir": "/usr/share/catalyst/targets/", "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", - "snapshot_name": "portage-", + "snapshot_name": "%(repo_name)s-", "source_matching": "strict", "storedir": "/var/tmp/catalyst", - "target_distdir": "/var/portage/distfiles", - "target_pkgdir":"/var/portage/packages", + "target_distdir": DISTDIR, + "target_pkgdir": PKGDIR, } DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf' @@ -72,11 +81,11 @@ TARGET_MOUNT_DEFAULTS = { "ccache": "/var/tmp/ccache", "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", + "distdir": DISTDIR, "icecream": "/usr/lib/icecc/bin", "kerncache": "/tmp/kerncache", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": PKGDIR, + "portdir": PORTDIR, "port_tmpdir": "/var/tmp/portage", "port_logdir": "/var/log/portage", "proc": "/proc", @@ -86,8 +95,8 @@ TARGET_MOUNT_DEFAULTS = { SOURCE_MOUNT_DEFAULTS = { "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", - "portdir": "/usr/portage", + "distdir": DISTDIR, + "portdir": PORTDIR, "port_tmpdir": "tmpfs", "proc": "/proc", "shm": "shmfs",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/
commit: 1d304f0bf42c963d7d830c8b9ab29835ff84217b Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:17:07 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 11 02:58:29 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1d304f0b targets/snapshot.py: Update the code and log messages to use the configured repo_name One more portage name seperation from being used to represent the ebuild repository. catalyst/targets/snapshot.py | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 8a9acdd..087834e 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -22,7 +22,7 @@ class snapshot(TargetBase, GenBase): TargetBase.__init__(self, myspec, addlargs) GenBase.__init__(self,myspec) #self.settings=myspec - self.settings["target_subpath"]="portage" + self.settings["target_subpath"]="repos" st=self.settings["storedir"] self.settings["snapshot_path"] = normpath(st + "/snapshots/" + self.settings["snapshot_name"] @@ -46,8 +46,9 @@ class snapshot(TargetBase, GenBase): success = True self.setup() - log.notice('Creating Portage tree snapshot %s from %s ...', - self.settings['version_stamp'], self.settings['portdir']) + log.notice('Creating %s tree snapshot %s from %s ...', + self.settings["repo_name"], self.settings['version_stamp'], + self.settings['portdir']) mytmp=self.settings["tmp_path"] ensure_dirs(mytmp) @@ -63,7 +64,7 @@ class snapshot(TargetBase, GenBase): mytmp + '/' + self.settings['repo_name'] + '/'], env=self.env) - log.notice('Compressing Portage snapshot tarball ...') + log.notice('Compressing %s snapshot tarball ...', self.settings["repo_name"]) compressor = CompressMap(self.settings["compress_definitions"], env=self.env, default_mode=self.settings['compression_mode'], comp_prog=self.settings["comp_prog"]) @@ -93,9 +94,9 @@ class snapshot(TargetBase, GenBase): def kill_chroot_pids(self): pass - @staticmethod - def cleanup(): + def cleanup(self): log.info('Cleaning up ...') + self.purge() def purge(self): clear_dir(self.settings['tmp_path'])
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: dc273097757f49838e6a586daa2c33c82e378cbe Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:56:45 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 11 02:58:29 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=dc273097 base/stagebase.py: Rename unpack_portage resume point to unpack_repo One part of the effort to separate the portage name from the repository. catalyst/base/stagebase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index eed1458..35556da 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -827,7 +827,7 @@ class StageBase(TargetBase, ClearBase, GenBase): def unpack_snapshot(self): unpack = True - snapshot_hash = self.resume.get("unpack_portage") + snapshot_hash = self.resume.get("unpack_repo") unpack_errmsg = "Error unpacking snapshot using mode %(mode)s" @@ -866,7 +866,7 @@ class StageBase(TargetBase, ClearBase, GenBase): if "autoresume" in self.settings["options"] \ and os.path.exists(target_portdir) \ - and self.resume.is_enabled("unpack_portage") \ + and self.resume.is_enabled("unpack_repo") \ and self.settings["snapshot_path_hash"] == snapshot_hash: log.notice('Valid Resume point detected, skipping unpack of portage tree...') unpack = False @@ -887,7 +887,7 @@ class StageBase(TargetBase, ClearBase, GenBase): myf.write(self.settings["snapshot_path_hash"]) else: log.info('Setting snapshot autoresume point') - self.resume.enable("unpack_portage", + self.resume.enable("unpack_repo", data = self.settings["snapshot_path_hash"]) if "snapcache" in self.settings["options"]:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 36768e1957168bc19574fdfcd9158f8d8c7aeeeb Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:58:10 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 11 02:58:29 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=36768e19 base/stagebase.py: Correctly log the correct function name for unpack_snapshot() catalyst/base/stagebase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 35556da..677e19d 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -841,7 +841,7 @@ class StageBase(TargetBase, ClearBase, GenBase): target_portdir = normpath(self.settings["chroot_path"] + self.settings["repo_basedir"] + "/" + self.settings["repo_name"]) log.info('%s', self.settings['chroot_path']) - log.info('unpack(), target_portdir = %s', target_portdir) + log.info('unpack_snapshot(), target_portdir = %s', target_portdir) if "snapcache" in self.settings["options"]: snapshot_cache_hash_path = pjoin( self.settings['snapshot_cache_path'], 'catalyst-hash')
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/
commit: b5410d1285fca19e01cfdcbb37e87b6f21ff Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:17:07 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Mar 10 18:37:33 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b5410d12 targets/snapshot.py: Update the code and log messages to use the configured repo_name One more portage name seperation from being used to represent the ebuild repository. catalyst/targets/snapshot.py | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 8a9acdd..087834e 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -22,7 +22,7 @@ class snapshot(TargetBase, GenBase): TargetBase.__init__(self, myspec, addlargs) GenBase.__init__(self,myspec) #self.settings=myspec - self.settings["target_subpath"]="portage" + self.settings["target_subpath"]="repos" st=self.settings["storedir"] self.settings["snapshot_path"] = normpath(st + "/snapshots/" + self.settings["snapshot_name"] @@ -46,8 +46,9 @@ class snapshot(TargetBase, GenBase): success = True self.setup() - log.notice('Creating Portage tree snapshot %s from %s ...', - self.settings['version_stamp'], self.settings['portdir']) + log.notice('Creating %s tree snapshot %s from %s ...', + self.settings["repo_name"], self.settings['version_stamp'], + self.settings['portdir']) mytmp=self.settings["tmp_path"] ensure_dirs(mytmp) @@ -63,7 +64,7 @@ class snapshot(TargetBase, GenBase): mytmp + '/' + self.settings['repo_name'] + '/'], env=self.env) - log.notice('Compressing Portage snapshot tarball ...') + log.notice('Compressing %s snapshot tarball ...', self.settings["repo_name"]) compressor = CompressMap(self.settings["compress_definitions"], env=self.env, default_mode=self.settings['compression_mode'], comp_prog=self.settings["comp_prog"]) @@ -93,9 +94,9 @@ class snapshot(TargetBase, GenBase): def kill_chroot_pids(self): pass - @staticmethod - def cleanup(): + def cleanup(self): log.info('Cleaning up ...') + self.purge() def purge(self): clear_dir(self.settings['tmp_path'])
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 926c42c264e2fdb2987e145ae848fccfaa51be39 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:24:22 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Mar 10 18:37:41 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=926c42c2 defaults.py: Update all repository, DISTDIR, PKGDIR settings to new /var paths All settings are still configurable in catalyst.conf. These are new reasonable settings for a relocated tree system. A user can still set their own locations during install, or at a later time. Default catalyst.conf settings will be changed at a later time after additional testing and the automatic stage building scripts have been updated. catalyst/defaults.py | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 84ed282..947e236 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -39,24 +39,24 @@ confdefaults={ "compressor_options": XATTRS_OPTIONS[TAR], "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS[TAR], "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER, - "distdir": "/usr/portage/distfiles", + "distdir": "/var/portage/distfiles", "hash_function": "crc32", "icecream": "/var/cache/icecream", 'list_xattrs_opt': LIST_XATTRS_OPTIONS[TAR], - "local_overlay": "/usr/local/portage", + "local_overlay": "/var/portage/repos/local", "port_conf": "/etc/portage", "make_conf": "%(port_conf)s/make.conf", "options": set(), - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": "/var/portage/packages", + "portdir": "/var/portage/repos", "port_tmpdir": "/var/tmp/portage", "PythonDir": "./catalyst", - "repo_basedir": "/usr", - "repo_name": "portage", + "repo_basedir": "/var/portage/repos", + "repo_name": "gentoo", "sharedir": "/usr/share/catalyst", "shdir": "/usr/share/catalyst/targets/", "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", - "snapshot_name": "portage-", + "snapshot_name": "%(repo_name)s-", "source_matching": "strict", "storedir": "/var/tmp/catalyst", "target_distdir": "/var/portage/distfiles", @@ -75,8 +75,8 @@ TARGET_MOUNT_DEFAULTS = { "distdir": "/usr/portage/distfiles", "icecream": "/usr/lib/icecc/bin", "kerncache": "/tmp/kerncache", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": "/var/portage/packages", + "portdir": "/var/portage/repos", "port_tmpdir": "/var/tmp/portage", "port_logdir": "/var/log/portage", "proc": "/proc", @@ -86,8 +86,8 @@ TARGET_MOUNT_DEFAULTS = { SOURCE_MOUNT_DEFAULTS = { "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", - "portdir": "/usr/portage", + "distdir": "/var/portage/distfiles", + "portdir": "/var/portage/repos", "port_tmpdir": "tmpfs", "proc": "/proc", "shm": "shmfs",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, etc/, catalyst/
commit: 2ca4770bb462f54229a2c84e47d2c7d78794a4c0 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:14:04 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:59:40 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=2ca4770b base/stagebase.py: Seperate out the writing of the make.conf file By sepaerating out the writing of the make.conf file, it keeps all code to do so in one place. I also fixed the code to correctly set the target chroot directories for PORTDIR, DISTDIR, PKGDIR and PORTDIR_OVERLAY. The same code also re-writes make.conf toggling any PORTDIR_OVERLAY setting during the clean() run. Add target_distdir and target_pkgdir settings to defaults and catalyst.conf. This allows for more flexibility between host and target settings. They can be individually configured this way. Update target an source mounts from the configured settings. catalyst/base/stagebase.py | 194 - catalyst/defaults.py | 2 + etc/catalyst.conf | 2 + 3 files changed, 106 insertions(+), 92 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 677e19d..31efdf6 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -225,8 +225,13 @@ class StageBase(TargetBase, ClearBase, GenBase): self.mounts = ["proc", "dev", "portdir", "distdir", "port_tmpdir"] # initialize our source mounts self.mountmap = SOURCE_MOUNT_DEFAULTS.copy() - # update them from settings + # update these from settings + self.mountmap["portdir"] = self.settings["portdir"] self.mountmap["distdir"] = self.settings["distdir"] + self.target_mounts["portdir"] = normpath(self.settings["repo_basedir"] + + "/" + self.settings["repo_name"]) + self.target_mounts["distdir"] = self.settings["target_distdir"] + self.target_mounts["packagedir"] = self.settings["target_pkgdir"] if "snapcache" not in self.settings["options"]: self.mounts.remove("portdir") self.mountmap["portdir"] = None @@ -1070,96 +1075,106 @@ class StageBase(TargetBase, ClearBase, GenBase): if os.path.exists(hosts_file): os.rename(hosts_file, hosts_file + '.catalyst') shutil.copy('/etc/hosts', hosts_file) + # write out the make.conf + try: + self.write_make_conf(setup=True) + except OSError as e: + raise CatalystError('Could not write %s: %s' % ( + normpath(self.settings["chroot_path"] + + self.settings["make_conf"]), e)) + self.resume.enable("chroot_setup") - # Modify and write out make.conf (for the chroot) - makepath = normpath(self.settings["chroot_path"] + - self.settings["make_conf"]) - clear_path(makepath) - myf = open(makepath, "w") - myf.write("# These settings were set by the catalyst build script " - "that automatically\n# built this stage.\n") - myf.write("# Please consult " - "/usr/share/portage/config/make.conf.example " - "for a more\n# detailed example.\n") - - for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS", - "ASFLAGS"]: - if not flags in self.settings: - continue - if flags in ["LDFLAGS", "ASFLAGS"]: - myf.write("# %s is unsupported. USE AT YOUR OWN RISK!\n" - % flags) - if (flags is not "CFLAGS" and - self.settings[flags] == self.settings["CFLAGS"]): - myf.write('%s="${CFLAGS}"\n' % flags) - elif isinstance(self.settings[flags], list): - myf.write('%s="%s"\n' - % (flags, ' '.join(self.settings[flags]))) - else: - myf.write('%s="%s"\n' - % (flags, self.settings[flags])) - - if "CBUILD" in self.settings: - my
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: c4cc183eb75f28596a936526cb8af46ac0c10c78 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:24:22 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:59:40 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=c4cc183e defaults.py: Update all repository, DISTDIR, PKGDIR settings to new /var paths All settings are still configurable in catalyst.conf. These are new reasonable settings for a relocated tree system. A user can still set their own locations during install, or at a later time. Default catalyst.conf settings will be changed at a later time after additional testing and the automatic stage building scripts have been updated. catalyst/defaults.py | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 84ed282..947e236 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -39,24 +39,24 @@ confdefaults={ "compressor_options": XATTRS_OPTIONS[TAR], "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS[TAR], "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER, - "distdir": "/usr/portage/distfiles", + "distdir": "/var/portage/distfiles", "hash_function": "crc32", "icecream": "/var/cache/icecream", 'list_xattrs_opt': LIST_XATTRS_OPTIONS[TAR], - "local_overlay": "/usr/local/portage", + "local_overlay": "/var/portage/repos/local", "port_conf": "/etc/portage", "make_conf": "%(port_conf)s/make.conf", "options": set(), - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": "/var/portage/packages", + "portdir": "/var/portage/repos", "port_tmpdir": "/var/tmp/portage", "PythonDir": "./catalyst", - "repo_basedir": "/usr", - "repo_name": "portage", + "repo_basedir": "/var/portage/repos", + "repo_name": "gentoo", "sharedir": "/usr/share/catalyst", "shdir": "/usr/share/catalyst/targets/", "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", - "snapshot_name": "portage-", + "snapshot_name": "%(repo_name)s-", "source_matching": "strict", "storedir": "/var/tmp/catalyst", "target_distdir": "/var/portage/distfiles", @@ -75,8 +75,8 @@ TARGET_MOUNT_DEFAULTS = { "distdir": "/usr/portage/distfiles", "icecream": "/usr/lib/icecc/bin", "kerncache": "/tmp/kerncache", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": "/var/portage/packages", + "portdir": "/var/portage/repos", "port_tmpdir": "/var/tmp/portage", "port_logdir": "/var/log/portage", "proc": "/proc", @@ -86,8 +86,8 @@ TARGET_MOUNT_DEFAULTS = { SOURCE_MOUNT_DEFAULTS = { "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", - "portdir": "/usr/portage", + "distdir": "/var/portage/distfiles", + "portdir": "/var/portage/repos", "port_tmpdir": "tmpfs", "proc": "/proc", "shm": "shmfs",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/
commit: 7e820b90119b020719cda016e2100b1f2e435ee0 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:17:07 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:59:40 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=7e820b90 targets/snapshot.py: Update the code and log messages to use the configured repo_name One more portage name seperation from being used to represent the ebuild repository. catalyst/targets/snapshot.py | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 8a9acdd..904a731 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -46,8 +46,9 @@ class snapshot(TargetBase, GenBase): success = True self.setup() - log.notice('Creating Portage tree snapshot %s from %s ...', - self.settings['version_stamp'], self.settings['portdir']) + log.notice('Creating %s tree snapshot %s from %s ...', + self.settings["repo_name"], self.settings['version_stamp'], + self.settings['portdir']) mytmp=self.settings["tmp_path"] ensure_dirs(mytmp) @@ -63,7 +64,7 @@ class snapshot(TargetBase, GenBase): mytmp + '/' + self.settings['repo_name'] + '/'], env=self.env) - log.notice('Compressing Portage snapshot tarball ...') + log.notice('Compressing %s snapshot tarball ...', self.settings["repo_name"]) compressor = CompressMap(self.settings["compress_definitions"], env=self.env, default_mode=self.settings['compression_mode'], comp_prog=self.settings["comp_prog"])
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: bc5d169b3b4858dcd72b7fb4bae62f99c09457aa Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:56:45 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:59:39 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=bc5d169b base/stagebase.py: Rename unpack_portage resume point to unpack_repo One part of the effort to separate the portage name from the repository. catalyst/base/stagebase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index eed1458..35556da 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -827,7 +827,7 @@ class StageBase(TargetBase, ClearBase, GenBase): def unpack_snapshot(self): unpack = True - snapshot_hash = self.resume.get("unpack_portage") + snapshot_hash = self.resume.get("unpack_repo") unpack_errmsg = "Error unpacking snapshot using mode %(mode)s" @@ -866,7 +866,7 @@ class StageBase(TargetBase, ClearBase, GenBase): if "autoresume" in self.settings["options"] \ and os.path.exists(target_portdir) \ - and self.resume.is_enabled("unpack_portage") \ + and self.resume.is_enabled("unpack_repo") \ and self.settings["snapshot_path_hash"] == snapshot_hash: log.notice('Valid Resume point detected, skipping unpack of portage tree...') unpack = False @@ -887,7 +887,7 @@ class StageBase(TargetBase, ClearBase, GenBase): myf.write(self.settings["snapshot_path_hash"]) else: log.info('Setting snapshot autoresume point') - self.resume.enable("unpack_portage", + self.resume.enable("unpack_repo", data = self.settings["snapshot_path_hash"]) if "snapcache" in self.settings["options"]:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: d235c9e45cc72f68a7cf85a5526ef1c27233b234 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:58:10 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:59:40 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d235c9e4 base/stagebase.py: Correctly log the correct function name for unpack_snapshot() catalyst/base/stagebase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 35556da..677e19d 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -841,7 +841,7 @@ class StageBase(TargetBase, ClearBase, GenBase): target_portdir = normpath(self.settings["chroot_path"] + self.settings["repo_basedir"] + "/" + self.settings["repo_name"]) log.info('%s', self.settings['chroot_path']) - log.info('unpack(), target_portdir = %s', target_portdir) + log.info('unpack_snapshot(), target_portdir = %s', target_portdir) if "snapcache" in self.settings["options"]: snapshot_cache_hash_path = pjoin( self.settings['snapshot_cache_path'], 'catalyst-hash')
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/
commit: a95409751436e4f56045a0e6d6c9528e0922ab36 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:17:07 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:35:39 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=a9540975 targets/snapshot.py: Update the code and log messages to use the configured repo_name One more portage name seperation from being used to represent the ebuild repository. catalyst/targets/snapshot.py | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 8a9acdd..904a731 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -46,8 +46,9 @@ class snapshot(TargetBase, GenBase): success = True self.setup() - log.notice('Creating Portage tree snapshot %s from %s ...', - self.settings['version_stamp'], self.settings['portdir']) + log.notice('Creating %s tree snapshot %s from %s ...', + self.settings["repo_name"], self.settings['version_stamp'], + self.settings['portdir']) mytmp=self.settings["tmp_path"] ensure_dirs(mytmp) @@ -63,7 +64,7 @@ class snapshot(TargetBase, GenBase): mytmp + '/' + self.settings['repo_name'] + '/'], env=self.env) - log.notice('Compressing Portage snapshot tarball ...') + log.notice('Compressing %s snapshot tarball ...', self.settings["repo_name"]) compressor = CompressMap(self.settings["compress_definitions"], env=self.env, default_mode=self.settings['compression_mode'], comp_prog=self.settings["comp_prog"])
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: d56584f32de50a1b2840bafb712656011d5ee2b3 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:24:22 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:35:53 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d56584f3 defaults.py: Update all repository, DISTDIR, PKGDIR settings to new /var paths All settings are still configurable in catalyst.conf. These are new reasonable settings for a relocated tree system. A user can still set their own locations during install, or at a later time. Default catalyst.conf settings will be changed at a later time after additional testing and the automatic stage building scripts have been updated. catalyst/defaults.py | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 84ed282..947e236 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -39,24 +39,24 @@ confdefaults={ "compressor_options": XATTRS_OPTIONS[TAR], "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS[TAR], "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER, - "distdir": "/usr/portage/distfiles", + "distdir": "/var/portage/distfiles", "hash_function": "crc32", "icecream": "/var/cache/icecream", 'list_xattrs_opt': LIST_XATTRS_OPTIONS[TAR], - "local_overlay": "/usr/local/portage", + "local_overlay": "/var/portage/repos/local", "port_conf": "/etc/portage", "make_conf": "%(port_conf)s/make.conf", "options": set(), - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": "/var/portage/packages", + "portdir": "/var/portage/repos", "port_tmpdir": "/var/tmp/portage", "PythonDir": "./catalyst", - "repo_basedir": "/usr", - "repo_name": "portage", + "repo_basedir": "/var/portage/repos", + "repo_name": "gentoo", "sharedir": "/usr/share/catalyst", "shdir": "/usr/share/catalyst/targets/", "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", - "snapshot_name": "portage-", + "snapshot_name": "%(repo_name)s-", "source_matching": "strict", "storedir": "/var/tmp/catalyst", "target_distdir": "/var/portage/distfiles", @@ -75,8 +75,8 @@ TARGET_MOUNT_DEFAULTS = { "distdir": "/usr/portage/distfiles", "icecream": "/usr/lib/icecc/bin", "kerncache": "/tmp/kerncache", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", + "packagedir": "/var/portage/packages", + "portdir": "/var/portage/repos", "port_tmpdir": "/var/tmp/portage", "port_logdir": "/var/log/portage", "proc": "/proc", @@ -86,8 +86,8 @@ TARGET_MOUNT_DEFAULTS = { SOURCE_MOUNT_DEFAULTS = { "dev": "/dev", "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", - "portdir": "/usr/portage", + "distdir": "/var/portage/distfiles", + "portdir": "/var/portage/repos", "port_tmpdir": "tmpfs", "proc": "/proc", "shm": "shmfs",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: e48f720e91e419ed382d55344e5d1e63799b98f6 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:56:45 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:34:53 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e48f720e base/stagebase.py: Rename unpack_portage resume point to unpack_repo One part of the effort to separate the portage name from the repository. catalyst/base/stagebase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index ef58454..7f0e5b1 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -835,7 +835,7 @@ class StageBase(TargetBase, ClearBase, GenBase): def unpack_snapshot(self): unpack = True - snapshot_hash = self.resume.get("unpack_portage") + snapshot_hash = self.resume.get("unpack_repo") unpack_errmsg = "Error unpacking snapshot using mode %(mode)s" @@ -874,7 +874,7 @@ class StageBase(TargetBase, ClearBase, GenBase): if "autoresume" in self.settings["options"] \ and os.path.exists(target_portdir) \ - and self.resume.is_enabled("unpack_portage") \ + and self.resume.is_enabled("unpack_repo") \ and self.settings["snapshot_path_hash"] == snapshot_hash: log.notice('Valid Resume point detected, skipping unpack of portage tree...') unpack = False @@ -895,7 +895,7 @@ class StageBase(TargetBase, ClearBase, GenBase): myf.write(self.settings["snapshot_path_hash"]) else: log.info('Setting snapshot autoresume point') - self.resume.enable("unpack_portage", + self.resume.enable("unpack_repo", data = self.settings["snapshot_path_hash"]) if "snapcache" in self.settings["options"]:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: f0e2c8e3c7c20287adb159647a78cfb0e0f618d8 Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 08:58:10 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:35:12 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f0e2c8e3 base/stagebase.py: Correctly log the correct function name for unpack_snapshot() catalyst/base/stagebase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 7f0e5b1..0fe3c9e 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -849,7 +849,7 @@ class StageBase(TargetBase, ClearBase, GenBase): target_portdir = normpath(self.settings["chroot_path"] + self.settings["repo_basedir"] + "/" + self.settings["repo_name"]) log.info('%s', self.settings['chroot_path']) - log.info('unpack(), target_portdir = %s', target_portdir) + log.info('unpack_snapshot(), target_portdir = %s', target_portdir) if "snapcache" in self.settings["options"]: snapshot_cache_hash_path = pjoin( self.settings['snapshot_cache_path'], 'catalyst-hash')
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/, etc/
commit: 312a7b30466a6908f92f798854110949aa9444ae Author: Brian Dolbec gentoo org> AuthorDate: Thu Mar 9 09:14:04 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 9 09:35:24 2017 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=312a7b30 base/stagebase.py: Seperate out the writing of the make.conf file By sepaerating out the writing of the make.conf file, it keeps all code to do so in one place. I also fixed the code to correctly set the target chroot directories for PORTDIR, DISTDIR, PKGDIR and PORTDIR_OVERLAY. The same code also re-writes make.conf toggling any PORTDIR_OVERLAY setting during the clean() run. Add target_distdir and target_pkgdir settings to defaults and catalyst.conf. This allows for more flexibility between host and target settings. They can be individually configured this way. Update target an source mounts from the configured settings. catalyst/base/stagebase.py | 194 - catalyst/defaults.py | 2 + etc/catalyst.conf | 2 + 3 files changed, 106 insertions(+), 92 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 0fe3c9e..c7b1b41 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -225,8 +225,13 @@ class StageBase(TargetBase, ClearBase, GenBase): self.mounts = ["proc", "dev", "portdir", "distdir", "port_tmpdir"] # initialize our source mounts self.mountmap = SOURCE_MOUNT_DEFAULTS.copy() - # update them from settings + # update these from settings + self.mountmap["portdir"] = self.settings["portdir"] self.mountmap["distdir"] = self.settings["distdir"] + self.target_mounts["portdir"] = normpath(self.settings["repo_basedir"] + + "/" + self.settings["repo_name"]) + self.target_mounts["distdir"] = self.settings["target_distdir"] + self.target_mounts["packagedir"] = self.settings["target_pkgdir"] if "snapcache" not in self.settings["options"]: self.mounts.remove("portdir") self.mountmap["portdir"] = None @@ -1078,96 +1083,106 @@ class StageBase(TargetBase, ClearBase, GenBase): if os.path.exists(hosts_file): os.rename(hosts_file, hosts_file + '.catalyst') shutil.copy('/etc/hosts', hosts_file) + # write out the make.conf + try: + self.write_make_conf(setup=True) + except OSError as e: + raise CatalystError('Could not write %s: %s' % ( + normpath(self.settings["chroot_path"] + + self.settings["make_conf"]), e)) + self.resume.enable("chroot_setup") - # Modify and write out make.conf (for the chroot) - makepath = normpath(self.settings["chroot_path"] + - self.settings["make_conf"]) - clear_path(makepath) - myf = open(makepath, "w") - myf.write("# These settings were set by the catalyst build script " - "that automatically\n# built this stage.\n") - myf.write("# Please consult " - "/usr/share/portage/config/make.conf.example " - "for a more\n# detailed example.\n") - - for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS", - "ASFLAGS"]: - if not flags in self.settings: - continue - if flags in ["LDFLAGS", "ASFLAGS"]: - myf.write("# %s is unsupported. USE AT YOUR OWN RISK!\n" - % flags) - if (flags is not "CFLAGS" and - self.settings[flags] == self.settings["CFLAGS"]): - myf.write('%s="${CFLAGS}"\n' % flags) - elif isinstance(self.settings[flags], list): - myf.write('%s="%s"\n' - % (flags, ' '.join(self.settings[flags]))) - else: - myf.write('%s="%s"\n' - % (flags, self.settings[flags])) - - if "CBUILD" in self.settings: - my
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: e606f764a51f3cfa9e8810bc6018fb88f3f813c9 Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Tue Oct 27 21:41:36 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Oct 27 21:41:36 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e606f764 use cp -a for portage_overlay if makes sense to preserve things like time stamps when copying in portage_overlay to avoid emerge thinking the files changed with every new stage. most other places in the code use cp -a or rsync -a catalyst/base/stagebase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 8ea1dc4..3c24dbd 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -908,7 +908,7 @@ class StageBase(TargetBase, ClearBase, GenBase): cmd("mkdir -p "+self.settings["chroot_path"]+\ self.settings["local_overlay"],\ "Could not make portage_overlay dir",env=self.env) - cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+\ + cmd("cp -a "+x+"/* "+self.settings["chroot_path"]+\ self.settings["local_overlay"],\ "Could not copy portage_overlay",env=self.env)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 328650032448425d64ec186fe24d84930f95d037 Author: Mike Frysinger gentoo org> AuthorDate: Mon Oct 12 03:28:59 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Oct 28 16:49:56 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=32865003 hash_utils: decode output of popen In py3, the return of popen is binary data. We need to decode it to get a string we can work with. catalyst/hash_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/hash_utils.py b/catalyst/hash_utils.py index 1161da3..6e08967 100644 --- a/catalyst/hash_utils.py +++ b/catalyst/hash_utils.py @@ -117,7 +117,7 @@ class HashMap(object): log.debug('args = %r', args) source = Popen(args, stdout=PIPE) output = source.communicate() - lines = output[0].split('\n') + lines = output[0].decode('ascii').split('\n') log.debug('output = %s', output) header = lines[0] h_f = lines[1].split()
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: bed0a9c2c1585a50738ceb49561d73d37bc6e050 Author: Brian Dolbec gentoo org> AuthorDate: Sat Oct 31 20:30:35 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Oct 31 20:30:35 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=bed0a9c2 stagebase.py: Clean up some long lines While I was changing code nearby, shorten some overly long lines. catalyst/base/stagebase.py | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 5ba9cfc..ffd84de 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1053,8 +1053,11 @@ class StageBase(TargetBase, ClearBase, GenBase): cmd("rm -f " + makepath,\ "Could not remove " + makepath, env=self.env) myf=open(makepath, "w") - myf.write("# These settings were set by the catalyst build script that automatically\n# built this stage.\n") - myf.write("# Please consult /usr/share/portage/config/make.conf.example for a more\n# detailed example.\n") + myf.write("# These settings were set by the catalyst build script " + "that automatically\n# built this stage.\n") + myf.write("# Please consult " + "/usr/share/portage/config/make.conf.example " + "for a more\n# detailed example.\n") for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS", "ASFLAGS"]: @@ -1074,11 +1077,16 @@ class StageBase(TargetBase, ClearBase, GenBase): % (flags, self.settings[flags])) if "CBUILD" in self.settings: - myf.write("# This should not be changed unless you know exactly what you are doing. You\n# should probably be using a different stage, instead.\n") + myf.write("# This should not be changed unless you know exactly" + " what you are doing. You\n# should probably be " + "using a different stage, instead.\n") myf.write('CBUILD="'+self.settings["CBUILD"]+'"\n') if "CHOST" in self.settings: - myf.write("# WARNING: Changing your CHOST is not something that should be done lightly.\n# Please consult https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable before changing.\n") + myf.write("# WARNING: Changing your CHOST is not something " + "that should be done lightly.\n# Please consult " + "https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable " + "before changing.\n") myf.write('CHOST="'+self.settings["CHOST"]+'"\n') # Figure out what our USE vars are for building @@ -1090,7 +1098,9 @@ class StageBase(TargetBase, ClearBase, GenBase): myusevars.extend(self.settings["use"]) if myusevars: - myf.write("# These are the USE and USE_EXPAND flags that were used for\n# building in addition to what is provided by the profile.\n") + myf.write("# These are the USE and USE_EXPAND flags that were " + "used for\n# building in addition to what is provided " + "by the profile.\n") myusevars = sorted(set(myusevars)) myf.write('USE="' + ' '.join(myusevars) + '"\n') if '-*' in myusevars:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: b409bd9bb4b50f69a555e4e148057ade86a7ed16 Author: Brian Dolbec gentoo org> AuthorDate: Sat Oct 31 20:26:40 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Oct 31 20:26:40 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b409bd9b stagebase.py: Refactor the *FLAGS handling code in chroot_setup() *FLAGS settings in spec files are loaded as a list. Although the config loading code has not changed in quite some time, the code was still treating these settings as strings. I don't know why the error was not triggered long ago. The code now handle catalyst/base/stagebase.py | 46 +- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 0e4d8c2..5ba9cfc 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1055,36 +1055,24 @@ class StageBase(TargetBase, ClearBase, GenBase): myf=open(makepath, "w") myf.write("# These settings were set by the catalyst build script that automatically\n# built this stage.\n") myf.write("# Please consult /usr/share/portage/config/make.conf.example for a more\n# detailed example.\n") - if "CFLAGS" in self.settings: - myf.write('CFLAGS="'+self.settings["CFLAGS"]+'"\n') - if "CXXFLAGS" in self.settings: - if self.settings["CXXFLAGS"]!=self.settings["CFLAGS"]: - myf.write('CXXFLAGS="'+self.settings["CXXFLAGS"]+'"\n') - else: - myf.write('CXXFLAGS="${CFLAGS}"\n') - else: - myf.write('CXXFLAGS="${CFLAGS}"\n') - if "FCFLAGS" in self.settings: - if self.settings["FCFLAGS"]!=self.settings["CFLAGS"]: - myf.write('FCFLAGS="'+self.settings["FCFLAGS"]+'"\n') - else: - myf.write('FCFLAGS="${CFLAGS}"\n') - else: - myf.write('FCFLAGS="${CFLAGS}"\n') - if "FFLAGS" in self.settings: - if self.settings["FFLAGS"]!=self.settings["CFLAGS"]: - myf.write('FFLAGS="'+self.settings["FFLAGS"]+'"\n') + + for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS", + "ASFLAGS"]: + if not flags in self.settings: + continue + if flags in ["LDFLAGS", "ASFLAGS"]: + myf.write("# %s is unsupported. USE AT YOUR OWN RISK!\n" + % flags) + if (flags is not "CFLAGS" and + self.settings[flags] == self.settings["CFLAGS"]): + myf.write('%s="${CFLAGS}"\n' % flags) + elif isinstance(self.settings[flags], list): + myf.write('%s="%s"\n' + % (flags, ' '.join(self.settings[flags]))) else: - myf.write('FFLAGS="${CFLAGS}"\n') - else: - myf.write('FFLAGS="${CFLAGS}"\n') - - if "LDFLAGS" in self.settings: - myf.write("# LDFLAGS is unsupported. USE AT YOUR OWN RISK!\n") - myf.write('LDFLAGS="'+self.settings["LDFLAGS"]+'"\n') - if "ASFLAGS" in self.settings: - myf.write("# ASFLAGS is unsupported. USE AT YOUR OWN RISK!\n") - myf.write('ASFLAGS="'+self.settings["ASFLAGS"]+'"\n') + myf.write('%s="%s"\n' + % (flags, self.settings[flags])) + if "CBUILD" in self.settings: myf.write("# This should not be changed unless you know exactly what you are doing. You\n# should probably be using a different stage, instead.\n") myf.write('CBUILD="'+self.settings["CBUILD"]+'"\n')
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: f3eea23c5cf7cf4e54073f59796a25db17d18613 Author: Mike Frysinger gentoo org> AuthorDate: Mon Oct 12 02:17:26 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Oct 12 02:17:26 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f3eea23c log: make sure NOTICE is an int The log module wants ints for its levels, so make sure NOTICE is not a float due to the division. This doesn't show up so much in py2, but py3 barfs on floats. catalyst/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/log.py b/catalyst/log.py index 871c53c..5938199 100644 --- a/catalyst/log.py +++ b/catalyst/log.py @@ -39,7 +39,7 @@ del _klass # Set the notice level between warning and info. -NOTICE = (logging.WARNING + logging.INFO) / 2 +NOTICE = (logging.WARNING + logging.INFO) // 2 logging.addLevelName(NOTICE, 'NOTICE')
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 986ef3f2a80c688059840d781d962bd3f3644538 Author: Mike Frysinger gentoo org> AuthorDate: Mon Oct 12 02:18:17 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Oct 12 02:18:17 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=986ef3f2 genbase: use sorted() with dict keys In py3, the dict keys func returns a view which doesn't have a sort member. Pass the result through sorted() which works with py2 and py3. catalyst/base/genbase.py | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py index a33f924..8a1af8d 100644 --- a/catalyst/base/genbase.py +++ b/catalyst/base/genbase.py @@ -22,8 +22,7 @@ class GenBase(object): keys={} for i in self.settings["contents"].split(): keys[i]=1 - array=keys.keys() - array.sort() + array = sorted(keys.keys()) for j in array: contents = contents_map.contents(path, j, verbose=self.settings["VERBOSE"]) @@ -42,8 +41,7 @@ class GenBase(object): keys={} for i in self.settings["digests"].split(): keys[i]=1 - array=keys.keys() - array.sort() + array = sorted(keys.keys()) for f in [path, path + '.CONTENTS']: if os.path.exists(f): if "all" in array:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, /, catalyst/, catalyst/targets/
commit: 9b0ba31859207264f5bf7af048d5d89725dd4025 Author: Mike Frysinger gentoo org> AuthorDate: Mon Oct 12 03:54:33 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Oct 28 16:49:56 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=9b0ba318 lint: convert type/types to isinstance pylint complains about using (type(...) == types.xxx) checks as it prefers isinstance(..., xxx) instead. Convert the code base to it. .pylintrc | 3 +-- catalyst/base/stagebase.py| 57 +-- catalyst/support.py | 3 +-- catalyst/targets/grp.py | 5 ++-- catalyst/targets/livecd_stage1.py | 5 ++-- catalyst/targets/netboot.py | 9 +++ catalyst/targets/netboot2.py | 11 7 files changed, 39 insertions(+), 54 deletions(-) diff --git a/.pylintrc b/.pylintrc index b3327cf..2a03f23 100644 --- a/.pylintrc +++ b/.pylintrc @@ -32,11 +32,10 @@ load-plugins= # bad-continuation -- might be hard with tab indentation policy # invalid-name -- need to manage constants better # line-too-long -- figure out a length and stick to it -# unidiomatic-typecheck -- convert to isinstance # redefined-outer-name -- clean up code to not do this # super-init-not-called -- fix the classes __init__ structure # no-init -- update classes w/missing __init__ functions -disable=missing-docstring, too-many-lines, too-many-branches, too-many-statements, too-few-public-methods, too-many-instance-attributes, too-many-public-methods, too-many-locals, too-many-arguments, locally-enabled, locally-disabled, fixme, broad-except, bad-whitespace, bad-continuation, invalid-name, line-too-long, unidiomatic-typecheck, redefined-outer-name, super-init-not-called, no-init +disable=missing-docstring, too-many-lines, too-many-branches, too-many-statements, too-few-public-methods, too-many-instance-attributes, too-many-public-methods, too-many-locals, too-many-arguments, locally-enabled, locally-disabled, fixme, broad-except, bad-whitespace, bad-continuation, invalid-name, line-too-long, redefined-outer-name, super-init-not-called, no-init [REPORTS] diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 6094109..0e4d8c2 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1,7 +1,6 @@ import os import imp -import types import shutil import sys from stat import ST_UID, ST_GID, ST_MODE @@ -297,7 +296,7 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_install_mask(self): if "install_mask" in self.settings: - if type(self.settings["install_mask"])!=types.StringType: + if not isinstance(self.settings['install_mask'], str): self.settings["install_mask"]=\ ' '.join(self.settings["install_mask"]) @@ -313,14 +312,14 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["version_stamp"] +'/' def set_source_subpath(self): - if type(self.settings["source_subpath"])!=types.StringType: + if not isinstance(self.settings['source_subpath'], str): raise CatalystError( "source_subpath should have been a string. Perhaps you have " +\ "something wrong in your spec file?") def set_pkgcache_path(self): if "pkgcache_path" in self.settings: - if type(self.settings["pkgcache_path"])!=types.StringType: + if not isinstance(self.settings['pkgcache_path'], str): self.settings["pkgcache_path"]=\ normpath(self.settings["pkgcache_path"]) else: @@ -330,7 +329,7 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_kerncache_path(self): if "kerncache_path" in self.settings: - if type(self.settings["kerncache_path"])!=types.StringType: + if not isinstance(self.settings['kerncache_path'], str): self.settings["kerncache_path"]=\ normpath(self.settings["kerncache_path"]) else: @@ -536,7 +535,7 @@ class StageBase(TargetBase, ClearBase, GenBase): del self.settings[self.settings["spec_prefix"]+"/use"] if "use" not in self.settings: self.settings["use"]="" - if type(self.settings["use"])==types.StringType: + if isinstance(self.settings['use'], str): self.settings["use"]=self.settings["use"].split() # Force bindist when options ask for it @@ -554,30 +553,27 @@ class StageBase(TargetBase, ClearBase, GenBase):
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: d307242bf41554640a8966d79f6f36738d3391ee Author: Mike Frysinger gentoo org> AuthorDate: Tue Oct 27 05:51:52 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Oct 28 16:49:56 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d307242b main: extend the -c option to accept multiple files There's no real reason people can't load multiple config files, so extend the --config option into --configs and let people specify multiple ones. catalyst/defaults.py | 2 ++ catalyst/main.py | 55 +--- 2 files changed, 20 insertions(+), 37 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 666afca..c5162d6 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -46,6 +46,8 @@ confdefaults={ "storedir": "/var/tmp/catalyst", } +DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf' + PORT_LOGDIR_CLEAN = \ 'find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete' diff --git a/catalyst/main.py b/catalyst/main.py index 9f563cf..176871d 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -21,7 +21,7 @@ from DeComp.contents import ContentsMap from catalyst import log import catalyst.config -from catalyst.defaults import confdefaults, option_messages +from catalyst.defaults import confdefaults, option_messages, DEFAULT_CONFIG_FILE from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.support import CatalystError from catalyst.version import get_version @@ -36,40 +36,19 @@ def version(): log.info('Copyright 2008-2012 various authors') log.info('Distributed under the GNU General Public License version 2.1') -def parse_config(myconfig): +def parse_config(config_files): # search a couple of different areas for the main config file myconf={} - config_file="" - default_config_file = '/etc/catalyst/catalyst.conf' - # first, try the one passed (presumably from the cmdline) - if myconfig: - if os.path.exists(myconfig): - log.notice('Using command line specified Catalyst configuration file: %s', - myconfig) - config_file=myconfig - - else: - log.critical('Specified configuration file does not exist: %s', myconfig) - - # next, try the default location - elif os.path.exists(default_config_file): - log.notice('Using default Catalyst configuration file: %s', - default_config_file) - config_file = default_config_file - - # can't find a config file (we are screwed), so bail out - else: - log.critical('Could not find a suitable configuration file') - - # now, try and parse the config file "config_file" - try: -# execfile(config_file, myconf, myconf) - myconfig = catalyst.config.ConfigParser(config_file) - myconf.update(myconfig.get_values()) - - except Exception: - log.critical('Could not find parse configuration file: %s', myconfig) + # try and parse the config file "config_file" + for config_file in config_files: + log.notice('Loading configuration file: %s', config_file) + try: + config = catalyst.config.ConfigParser(config_file) + myconf.update(config.get_values()) + except Exception as e: + log.critical('Could not find parse configuration file: %s: %s', + config_file, e) # now, load up the values into conf_values so that we can use them for x in list(confdefaults): @@ -209,9 +188,9 @@ $ catalyst -f stage1-specfile.spec""" group.add_argument('-F', '--fetchonly', default=False, action='store_true', help='fetch files only') - group.add_argument('-c', '--config', - type=FilePath(), - help='use specified configuration file') + group.add_argument('-c', '--configs', + type=FilePath(), action='append', + help='use specified configuration files') group.add_argument('-f', '--file', type=FilePath(), help='read specfile') @@ -241,7 +220,9 @@ def main(): color=opts.color) # Parse the command line options. - myconfig = opts.config + myconfigs = opts.configs + if not myconfigs: + myconfigs = [DEFAULT_CONFIG_FILE] myspecfile = opts.file mycmdline = opts.cli[:] @@ -271,7 +252,7 @@ def main(): # made it this far so start by outputting our version info version() # import configuration file and import our main module using those settings - parse_config(myconfig) + parse_config(m
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: ac0f1d1f61ed3ec00831867f2a34eea88e7160ec Author: Mike Frysinger gentoo org> AuthorDate: Mon Oct 12 03:06:02 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Oct 12 03:06:02 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=ac0f1d1f hash_utils: fix bad keyword w/CatalystError The exception takes "print_traceback", not "traceback". catalyst/hash_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/hash_utils.py b/catalyst/hash_utils.py index 3db61f1..1161da3 100644 --- a/catalyst/hash_utils.py +++ b/catalyst/hash_utils.py @@ -79,7 +79,7 @@ class HashMap(object): hash_) except: raise CatalystError("Error generating hash, is appropriate " + \ - "utility installed on your system?", traceback=True) + "utility installed on your system?", print_traceback=True) def calc_hash(self, file_, hash_):
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 06fd1a0cd1a957c14343d9c0440dd606a883ee12 Author: Mike Frysinger gentoo org> AuthorDate: Sun Oct 11 18:23:26 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Oct 28 16:49:56 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=06fd1a0c stagebase: robustify portage_confdir setup When setting up the portage_confdir, we should make sure it exists, and that we rsync it properly (regardless of the settings given by the user). Bugzilla: https://bugs.gentoo.org/538652 Reported-by: Joshua Kinard gentoo.org> catalyst/base/stagebase.py | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 3c24dbd..6094109 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -893,8 +893,12 @@ class StageBase(TargetBase, ClearBase, GenBase): else: if "portage_confdir" in self.settings: log.info('Configuring %s...', self.settings['port_conf']) - cmd("rsync -a " + self.settings["portage_confdir"] + "/ " + - self.settings["chroot_path"] + self.settings["port_conf"], + dest = normpath(self.settings['chroot_path'] + '/' + self.settings['port_conf']) + ensure_dirs(dest) + # The trailing slashes on both paths are important: + # We want to make sure rsync copies the dirs into each + # other and not as subdirs. + cmd('rsync -a %s/ %s/' % (self.settings['portage_confdir'], dest), "Error copying %s" % self.settings["port_conf"], env=self.env) self.resume.enable("setup_confdir")
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 1cb701ee64e06badb16a0086bb4e46184633c5da Author: Mike Frysinger gentoo org> AuthorDate: Thu Oct 29 00:27:46 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Oct 29 00:27:46 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1cb701ee config: tweak walking of settings for py3 Since py3 returns an iterator with dict.keys(), trying to add/del values in the loop will throw an exception. Run it through list() so we get a static copy to iterate over. catalyst/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/config.py b/catalyst/config.py index db81a96..5f72e15 100644 --- a/catalyst/config.py +++ b/catalyst/config.py @@ -97,7 +97,8 @@ class ParserBase(object): values[cur_array[0]] = cur_array[1:] if not self.empty_values: - for x in values.keys(): + # Make sure the list of keys is static since we modify inside the loop. + for x in list(values.keys()): # Delete empty key pairs if not values[x]: log.warning('No value set for key "%s"; deleting', x)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, bin/
commit: 2dac8da1679121bf992574d7fb5f8ed41c99c3c9 Author: Brian Dolbec gentoo org> AuthorDate: Tue Sep 8 06:15:25 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Oct 6 19:52:39 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=2dac8da1 Move the signal handler into the StageBase class so it can handle unbind() cleanup Not quite complete, still errors on some unmounting bin/catalyst | 19 --- catalyst/base/stagebase.py | 19 +++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bin/catalyst b/bin/catalyst index 577e899..832399f 100755 --- a/bin/catalyst +++ b/bin/catalyst @@ -12,25 +12,6 @@ from __future__ import print_function import sys -# This block ensures that ^C interrupts are handled quietly. -try: - import signal - - def exithandler(_signum, _frame): - signal.signal(signal.SIGINT, signal.SIG_IGN) - signal.signal(signal.SIGTERM, signal.SIG_IGN) - print() - sys.exit(1) - - signal.signal(signal.SIGINT, exithandler) - signal.signal(signal.SIGTERM, exithandler) - signal.signal(signal.SIGPIPE, signal.SIG_DFL) - -except KeyboardInterrupt: - print() - sys.exit(1) - - from catalyst.main import main try: diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 813e5f1..90e8303 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -3,6 +3,7 @@ import os import imp import types import shutil +import signal import sys from stat import ST_UID, ST_GID, ST_MODE @@ -191,6 +192,17 @@ class StageBase(TargetBase, ClearBase, GenBase): if "portage_confdir" in self.settings: file_locate(self.settings,["portage_confdir"],expand=0) + + # This block ensures that ^C interrupts are handled quietly. + try: + signal.signal(signal.SIGINT, self.exithandler) + signal.signal(signal.SIGTERM, self.exithandler) + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + except KeyboardInterrupt: + print() + sys.exit(1) + # Setup our mount points. # initialize our target mounts. self.target_mounts = TARGET_MOUNT_DEFAULTS.copy() @@ -265,6 +277,13 @@ class StageBase(TargetBase, ClearBase, GenBase): # save resources, it is not always needed self.compressor = None + def exithandler(self, _signum, _frame): + signal.signal(signal.SIGINT, signal.SIG_IGN) + signal.signal(signal.SIGTERM, signal.SIG_IGN) + self.unbind() + print() + sys.exit(1) + def override_cbuild(self): if "CBUILD" in self.makeconf: self.settings["CBUILD"]=self.makeconf["CBUILD"]
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/
commit: 7536857c1a14d2eec224e80ba96ab9f3091e0d1c Author: Brian Dolbec gentoo org> AuthorDate: Tue Sep 8 00:35:41 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 8 14:11:48 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=7536857c Make the new compress code handling compatible with existing specs Clean out old snapshot setting code. Make file_check() not traceback after printing it's error message. Fix source auto extension handling in unpack() catalyst/base/stagebase.py | 53 -- catalyst/support.py| 21 ++ 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index bd6938c..31fbe8b 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -15,7 +15,8 @@ from DeComp.compress import CompressMap from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) from catalyst.support import (CatalystError, msg, file_locate, normpath, - touch, cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount) + touch, cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount, + file_check) from catalyst.base.targetbase import TargetBase from catalyst.base.clearbase import ClearBase from catalyst.base.genbase import GenBase @@ -193,7 +194,7 @@ class StageBase(TargetBase, ClearBase, GenBase): on disk. """ #pdb.set_trace() - file_locate(self.settings,["source_path","snapshot_path","distdir"],\ + file_locate(self.settings,["distdir"],\ expand=0) """ If we are using portage_confdir, check that as well. """ if "portage_confdir" in self.settings: @@ -430,8 +431,10 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["source_path"] = normpath(self.settings["storedir"] + "/tmp/" + self.settings["source_subpath"] + "/") else: - self.settings["source_path"]=normpath(self.settings["storedir"]+\ - "/builds/"+self.settings["source_subpath"]) + self.settings["source_path"] = file_check( + normpath(self.settings["storedir"] + "/builds/" + + self.settings["source_subpath"]) + ) if os.path.isfile(self.settings["source_path"]): # XXX: Is this even necessary if the previous check passes? if os.path.exists(self.settings["source_path"]): @@ -460,27 +463,15 @@ class StageBase(TargetBase, ClearBase, GenBase): "/root/*", self.settings["portdir"]] def set_snapshot_path(self): - self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ + self.settings["snapshot_path"]= file_check(normpath(self.settings["storedir"]+\ "/snapshots/" + self.settings["snapshot_name"] + - self.settings["snapshot"].rstrip('/')+".tar.xz") - - if os.path.exists(self.settings["snapshot_path"]): - self.settings["snapshot_path_hash"] = \ - self.settings["hash_map"].generate_hash( - self.settings["snapshot_path"], - hash_ = self.settings["hash_function"], - verbose = False) - else: - self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ - "/snapshots/" + self.settings["snapshot_name"] + - self.settings["snapshot"]) - - if os.path.exists(self.settings["snapshot_path"]): - self.settings["snapshot_path_hash"] = \ - self.settings["hash_map"].generate_hash( - self.settings["snapshot_path"], - hash_ = self.settings["hash_function"], - verbose = False) + self.settings["snapshot"])) + print "*** SNAPSHOT_PATH set to:", self.settings["snapshot_path"] + self.settings["snapshot_path_hash"] = \ + self.settings["hash_map"].generate_hash( + self.settings["snapshot_path"], + hash_ = self.settings["hash_function"], + verbose = False) def set_snapcache_path(self): self.settings["snapshot_cache_path"]=\ @@ -723,12 +714,1
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 36830d602086d0b5dc00e548dc10619a77d9b30f Author: Brian Dolbec gentoo org> AuthorDate: Tue Sep 8 06:34:06 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 8 14:11:48 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=36830d60 Fix snapshot setting print message catalyst/base/stagebase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 31fbe8b..17d88cd 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -483,7 +483,7 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["snapshot"])) self.snapcache_lock=\ LockDir(self.settings["snapshot_cache_path"]) - print "Caching snapshot to "+self.settings["snapshot_cache_path"] + print "Setting snapshot cache to "+self.settings["snapshot_cache_path"] def set_chroot_path(self): """
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 85de4ce7be209e29ef661256293b6168bcadd1a0 Author: Brian Dolbec gentoo org> AuthorDate: Tue Sep 8 06:35:17 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 8 14:11:48 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=85de4ce7 stagebase.py: run() Add in an exception trap to cleanup mounts catalyst/base/stagebase.py | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index a6694e6..bd6938c 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1421,7 +1421,14 @@ class StageBase(TargetBase, ClearBase, GenBase): for x in self.settings["action_sequence"]: print "--- Running action sequence: "+x sys.stdout.flush() - apply(getattr(self,x)) + try: + apply(getattr(self,x)) + except Exception as error: + print "Exception running action sequence %s" % x + print "Error:", str(error) + print "Running unbind()" + self.unbind() + break def unmerge(self):
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, bin/
commit: 8524792afc755906b50f276f6c3d22a00af21e0c Author: Brian Dolbec gentoo org> AuthorDate: Tue Sep 8 06:15:25 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 8 14:11:48 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=8524792a Move the signal handler into the StageBase class so it can handle unbind() cleanup Not quite complete, still errors on some unmounting bin/catalyst | 19 --- catalyst/base/stagebase.py | 19 +++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bin/catalyst b/bin/catalyst index 19f5289..5560d41 100755 --- a/bin/catalyst +++ b/bin/catalyst @@ -12,25 +12,6 @@ from __future__ import print_function import sys -# This block ensures that ^C interrupts are handled quietly. -try: - import signal - - def exithandler(signum,frame): - signal.signal(signal.SIGINT, signal.SIG_IGN) - signal.signal(signal.SIGTERM, signal.SIG_IGN) - print() - sys.exit(1) - - signal.signal(signal.SIGINT, exithandler) - signal.signal(signal.SIGTERM, exithandler) - signal.signal(signal.SIGPIPE, signal.SIG_DFL) - -except KeyboardInterrupt: - print() - sys.exit(1) - - from catalyst.main import main from catalyst import __maintainer__ from catalyst import __version__ diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 17d88cd..077b663 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -4,6 +4,7 @@ import string import imp import types import shutil +import signal import sys from stat import ST_UID, ST_GID, ST_MODE @@ -200,6 +201,17 @@ class StageBase(TargetBase, ClearBase, GenBase): if "portage_confdir" in self.settings: file_locate(self.settings,["portage_confdir"],expand=0) + + # This block ensures that ^C interrupts are handled quietly. + try: + signal.signal(signal.SIGINT, self.exithandler) + signal.signal(signal.SIGTERM, self.exithandler) + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + except KeyboardInterrupt: + print() + sys.exit(1) + """ Setup our mount points """ # initialize our target mounts. self.target_mounts = TARGET_MOUNT_DEFAULTS.copy() @@ -276,6 +288,13 @@ class StageBase(TargetBase, ClearBase, GenBase): # save resources, it is not always needed self.compressor = None + def exithandler(self, signum,frame): + signal.signal(signal.SIGINT, signal.SIG_IGN) + signal.signal(signal.SIGTERM, signal.SIG_IGN) + self.unbind() + print() + sys.exit(1) + def override_cbuild(self): if "CBUILD" in self.makeconf: self.settings["CBUILD"]=self.makeconf["CBUILD"]
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: ce64d85fdd92920cae60cd93039f6cae35de51ad Author: Brian Dolbec gentoo org> AuthorDate: Tue Sep 8 06:13:30 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 8 14:11:48 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=ce64d85f main.py: Add an exception for CatalystError which would have been already handled Cleanup some dead code. catalyst/main.py | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index dc9342b..2a5bdd3 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -163,13 +163,10 @@ def build_target(addlargs): raise CatalystError( "Target \"%s\" not available." % target, print_traceback=True) - - #try: + except CatalystError: + return target.run() - #except: - #print "!!! catalyst: Error encountered during run of target " + \ - # addlargs["target"] - #sys.exit(1) + def main():
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 5de472ce61d13d242e185a9f6d88b26610fb014b Author: Brian Dolbec gentoo org> AuthorDate: Tue Sep 8 06:26:27 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 8 14:05:13 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=5de472ce stagebase.py: strip a trailing slash from the croot_path for consistency target_subpath must have a trailing slash to prevent some failures. See commit: 5b08b471611670b4cc996e45c387ecd951fb2142 Subject: Fix livecd source and target paths not ending with a slash Author: Brian Dolbec gentoo.org> (Wed 12 Jun 2013 07:40:12 AM PDT) catalyst/base/stagebase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 8f12ac6..a6694e6 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -500,7 +500,7 @@ class StageBase(TargetBase, ClearBase, GenBase): Things *could* break if you don't use a proper join() """ self.settings["chroot_path"]=normpath(self.settings["storedir"]+\ - "/tmp/"+self.settings["target_subpath"]) + "/tmp/"+self.settings["target_subpath"].rstrip('/')) self.chroot_lock=LockDir(self.settings["chroot_path"]) def set_autoresume_path(self):
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/, catalyst/base/, catalyst/, etc/, examples/
commit: 9a280f3988a20e7d5e66dd42aaba4033be0ddba0 Author: Brian Dolbec gentoo org> AuthorDate: Sun May 24 07:36:49 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Sep 6 21:18:00 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=9a280f39 Apply new compress code, normalize paths Fix the target_filename ending in a slash catalyst/base/stagebase.py | 171 +++ catalyst/defaults.py | 4 + catalyst/main.py | 8 ++ catalyst/targets/grp.py | 2 +- catalyst/targets/livecd_stage1.py| 2 +- catalyst/targets/livecd_stage2.py| 6 +- catalyst/targets/netboot.py | 8 +- catalyst/targets/netboot2.py | 2 +- catalyst/targets/stage2.py | 8 +- etc/catalyst.conf| 11 ++- examples/generic_stage_template.spec | 32 ++- 11 files changed, 159 insertions(+), 95 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index d898e95..655ea06 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,6 +10,8 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join +from decomp.compress import CompressMap + from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) from catalyst.support import (CatalystError, msg, file_locate, normpath, @@ -264,6 +266,14 @@ class StageBase(TargetBase, ClearBase, GenBase): self.env["PORT_LOGDIR"] = self.settings["port_logdir"] self.env["PORT_LOGDIR_CLEAN"] = PORT_LOGDIR_CLEAN + # Initialize our (de)compressor's) + self.decompressor = CompressMap(self.settings["decompress_definitions"], + env=self.env, + search_order=self.settings["decompressor_search_order"]) + + # save resources, it is not always needed + self.compressor = None + def override_cbuild(self): if "CBUILD" in self.makeconf: self.settings["CBUILD"]=self.makeconf["CBUILD"] @@ -332,11 +342,11 @@ class StageBase(TargetBase, ClearBase, GenBase): normpath(self.settings["kerncache_path"]) else: self.settings["kerncache_path"]=normpath(self.settings["storedir"]+\ - "/kerncache/"+self.settings["target_subpath"]+"/") + "/kerncache/"+self.settings["target_subpath"]) def set_target_path(self): self.settings["target_path"]=normpath(self.settings["storedir"]+\ - "/builds/"+self.settings["target_subpath"].rstrip('/')+".tar.bz2") + "/builds/"+self.settings["target_subpath"]) if "autoresume" in self.settings["options"]\ and self.resume.is_enabled("setup_target_path"): print \ @@ -420,7 +430,7 @@ class StageBase(TargetBase, ClearBase, GenBase): "/tmp/" + self.settings["source_subpath"] + "/") else: self.settings["source_path"]=normpath(self.settings["storedir"]+\ - "/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2") + "/builds/"+self.settings["source_subpath"]) if os.path.isfile(self.settings["source_path"]): # XXX: Is this even necessary if the previous check passes? if os.path.exists(self.settings["source_path"]): @@ -435,7 +445,7 @@ class StageBase(TargetBase, ClearBase, GenBase): print "\tseedcache in the options of catalyst.conf the source path" print "\twill then be "+\ normpath(self.settings["storedir"]+"/builds/"+\ - self.settings["source_subpath"].rstrip('/')+".tar.bz2\n") + self.settings["source_subpath"]+"\n") def set_dest_path(self): if "root_path" in self.settings: @@ -462,7 +472,7 @@ class StageBase(TargetBase, ClearBase, GenBase): else: self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ "/snapshots/" + self.settings["snapshot_name"] + - self.settings["snapshot"].rstrip('/')+".tar.bz2") + self.settings["snapshot"]) if os.path.exists(self.settings["snapshot_path"]): self.settings["snapshot_path_hash"] = \ @@ -472,6 +482,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/targets/
commit: a708728d812020ee630fe4182e07b1f3ddbbb1e2 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 23:10:50 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Sep 6 21:18:00 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=a708728d Fix a couple print() uses back to print statements for consistency catalyst/base/stagebase.py | 4 ++-- catalyst/targets/snapshot.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 7212409..8f12ac6 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1308,8 +1308,8 @@ class StageBase(TargetBase, ClearBase, GenBase): target_filename = ".".join([self.settings["target_path"].rstrip('/'), self.compressor.extension(pack_info['mode'])]) - print("Creating stage tarball... mode:", - self.settings["compression_mode"]) + print "Creating stage tarball... mode:", \ + self.settings["compression_mode"] if self.compressor.compress(pack_info): self.gen_contents_file(target_filename) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index ad96d37..1edcd02 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -72,11 +72,11 @@ class snapshot(TargetBase, GenBase): auto_extension=True ) if not compressor.compress(infodict): - print("Snapshot compression failure") + print "Snapshot compression failure" else: filename = '.'.join([self.settings["snapshot_path"], compressor.extension(self.settings["compression_mode"])]) - print("COMPRESSOR success filename", filename) + print "COMPRESSOR success filename", filename self.gen_contents_file(filename) self.gen_digest_file(filename)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 8ebde1b8598e34caa83f8bcae6185ee4f6e38264 Author: Brian Dolbec gentoo org> AuthorDate: Sun May 24 07:38:32 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Sep 6 21:18:00 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=8ebde1b8 catalyst/main.py: Comment out the try: except: pair for target.run() catalyst/main.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 0ba81b9..7e3b55e 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -163,12 +163,12 @@ def build_target(addlargs): "Target \"%s\" not available." % target, print_traceback=True) - try: - target.run() - except: - print "!!! catalyst: Error encountered during run of target " + \ - addlargs["target"] - sys.exit(1) + #try: + target.run() + #except: + #print "!!! catalyst: Error encountered during run of target " + \ + # addlargs["target"] + #sys.exit(1) def main():
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 1039b4beef11da6dfd8d54b1ab3724b1e817bcdf Author: Brian Dolbec gentoo org> AuthorDate: Sat Sep 5 16:23:30 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Sep 6 21:18:00 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1039b4be defaults.py: Update for the new xattr variations of the definitions This should allow to not define the decompressor_search_order in the spec file. catalyst/defaults.py | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 5ce2858..5db7ab6 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -1,5 +1,8 @@ +from DeComp.definitions import DECOMPRESSOR_XATTR_SEARCH_ORDER + + # these should never be touched required_build_targets = ["targetbase", "generic_stage_target"] @@ -23,8 +26,8 @@ verbosity = 1 confdefaults={ "archdir": "%(PythonDir)s/arch", - "compression_mode": 'lbzip2', - "decompressor_search_order": 'lbzip2 bzip2 tar pixz xz gzip squashfs', + "compression_mode": 'lbzip2_x', + "decompressor_search_order": DECOMPRESSOR_XATTR_SEARCH_ORDER, "distdir": "/usr/portage/distfiles", "hash_function": "crc32", "icecream": "/var/cache/icecream",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 16f6184fc18508fc4604d4ddc85624701bb15176 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:31:33 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Sep 6 21:18:00 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=16f6184f catalyst/base/stagebase.py: Fix "Creating stage tarball..." print() catalyst/base/stagebase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 655ea06..ea37591 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1307,7 +1307,8 @@ class StageBase(TargetBase, ClearBase, GenBase): target_filename = ".".join([self.settings["target_path"].rstrip('/'), self.compressor.extension(pack_info['mode'])]) - print "Creating stage tarball..." + print("Creating stage tarball... mode:", + self.settings["compression_mode"]) if self.compressor.compress(pack_info): self.gen_contents_file(target_filename)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/
commit: 99e9ceabe0532f5fb1b12ab55d35097b5be3cfa8 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:33:29 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Sep 6 21:18:00 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=99e9ceab DeComp bug fixes catalyst/base/genbase.py | 2 +- catalyst/base/stagebase.py | 14 +- catalyst/main.py | 5 +++-- catalyst/targets/snapshot.py | 34 +- 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py index e818781..c05b36d 100644 --- a/catalyst/base/genbase.py +++ b/catalyst/base/genbase.py @@ -24,7 +24,7 @@ class GenBase(object): array=keys.keys() array.sort() for j in array: - contents = contents_map.generate_contents(file, j, + contents = contents_map.contents(file, j, verbose="VERBOSE" in self.settings) if contents: myf.write(contents) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index ea37591..7212409 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,7 +10,7 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join -from decomp.compress import CompressMap +from DeComp.compress import CompressMap from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) @@ -38,10 +38,11 @@ class StageBase(TargetBase, ClearBase, GenBase): self.required_values.extend(["version_stamp","target","subarch",\ "rel_type","profile","snapshot","source_subpath"]) - self.valid_values.extend(["version_stamp","target","subarch",\ - "rel_type","profile","snapshot","source_subpath","portage_confdir",\ - "cflags","cxxflags","fcflags","fflags","ldflags","cbuild","hostuse","portage_overlay",\ - "distcc_hosts","makeopts","pkgcache_path","kerncache_path"]) + self.valid_values.extend(["version_stamp","target","subarch", + "rel_type","profile","snapshot","source_subpath","portage_confdir", + "cflags","cxxflags","fcflags","fflags","ldflags","cbuild","hostuse","portage_overlay", + "distcc_hosts","makeopts","pkgcache_path","kerncache_path", + "compression_mode", "decompression_mode"]) self.set_valid_build_kernel_vars(addlargs) TargetBase.__init__(self, myspec, addlargs) @@ -1371,6 +1372,9 @@ class StageBase(TargetBase, ClearBase, GenBase): # lists in arch/amd64.py and friends. If we wanted self.settigs[var] # of any depth, we should make this function recursive. elif type(self.settings[x]) == types.DictType: + if x in ["compress_definitions", + "decompress_definitions"]: + continue self.env[varname] = string.join(self.settings[x].keys()) for y in self.settings[x].keys(): varname2 = "clst_"+string.replace(y,"/","_") diff --git a/catalyst/main.py b/catalyst/main.py index 7e3b55e..dc9342b 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -13,11 +13,12 @@ import os.path __selfpath__ = os.path.abspath(os.path.dirname(__file__)) -from decomp.compress import COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS +from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, + CONTENTS_DEFINITIONS) +from DeComp.contents import ContentsMap import catalyst.config import catalyst.util -from catalyst.contents import ContentsMap, CONTENTS_DEFINITIONS from catalyst.defaults import confdefaults, option_messages from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.lock import LockInUse diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 1887110..ad96d37 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -6,18 +6,21 @@ import os import shutil from stat import ST_UID, ST_GID, ST_MODE +from DeComp.compress import CompressMap from catalyst.support import normpath, cmd from catalyst.base.targetbase import TargetBase from catalyst.base.genbase import GenBase from catalyst.fileops import ensure_dirs + + class snapshot(TargetBase, GenBase): """ Builder class for snapshots. """ def __init__(self,myspec,addlar
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: b5f83751008c8f3757841b9bff59a02af1ac0ce1 Author: Brian Dolbec gentoo org> AuthorDate: Sat Sep 5 16:23:30 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Sep 6 20:22:44 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b5f83751 defaults.py: Update for the new xattr variations of the definitions This should allow to not define the decompressor_search_order in the spec file. catalyst/defaults.py | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 5ce2858..5db7ab6 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -1,5 +1,8 @@ +from DeComp.definitions import DECOMPRESSOR_XATTR_SEARCH_ORDER + + # these should never be touched required_build_targets = ["targetbase", "generic_stage_target"] @@ -23,8 +26,8 @@ verbosity = 1 confdefaults={ "archdir": "%(PythonDir)s/arch", - "compression_mode": 'lbzip2', - "decompressor_search_order": 'lbzip2 bzip2 tar pixz xz gzip squashfs', + "compression_mode": 'lbzip2_x', + "decompressor_search_order": DECOMPRESSOR_XATTR_SEARCH_ORDER, "distdir": "/usr/portage/distfiles", "hash_function": "crc32", "icecream": "/var/cache/icecream",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 42d2c23f979b9f2ca2b96fbe87cbbc561691f751 Author: Brian Dolbec gentoo org> AuthorDate: Sat Sep 5 16:23:30 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Sep 5 16:23:30 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=42d2c23f defaults.py: Update for the new xattr variations of the definitions This should allow to not define the decompressor_search_order in the spec file. catalyst/defaults.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 5ce2858..5af60a9 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -1,5 +1,8 @@ +from DeComp.definitions import DECOMPRESSOR_XATTR_SEARCH_ORDER + + # these should never be touched required_build_targets = ["targetbase", "generic_stage_target"] @@ -24,7 +27,7 @@ verbosity = 1 confdefaults={ "archdir": "%(PythonDir)s/arch", "compression_mode": 'lbzip2', - "decompressor_search_order": 'lbzip2 bzip2 tar pixz xz gzip squashfs', + "decompressor_search_order": DECOMPRESSOR_XATTR_SEARCH_ORDER, "distdir": "/usr/portage/distfiles", "hash_function": "crc32", "icecream": "/var/cache/icecream",
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, examples/, catalyst/base/, catalyst/targets/, etc/
commit: cf4003fb4d60674f2e6a13cb974ef42a00748a25 Author: Brian Dolbec gentoo org> AuthorDate: Sun May 24 07:36:49 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Sep 4 15:19:03 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=cf4003fb Apply new compress code, normalize paths Fix the target_filename ending in a slash catalyst/base/stagebase.py | 171 +++ catalyst/defaults.py | 4 + catalyst/main.py | 8 ++ catalyst/targets/grp.py | 2 +- catalyst/targets/livecd_stage1.py| 2 +- catalyst/targets/livecd_stage2.py| 6 +- catalyst/targets/netboot.py | 8 +- catalyst/targets/netboot2.py | 2 +- catalyst/targets/stage2.py | 8 +- etc/catalyst.conf| 11 ++- examples/generic_stage_template.spec | 32 ++- 11 files changed, 159 insertions(+), 95 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index d898e95..655ea06 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,6 +10,8 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join +from decomp.compress import CompressMap + from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) from catalyst.support import (CatalystError, msg, file_locate, normpath, @@ -264,6 +266,14 @@ class StageBase(TargetBase, ClearBase, GenBase): self.env["PORT_LOGDIR"] = self.settings["port_logdir"] self.env["PORT_LOGDIR_CLEAN"] = PORT_LOGDIR_CLEAN + # Initialize our (de)compressor's) + self.decompressor = CompressMap(self.settings["decompress_definitions"], + env=self.env, + search_order=self.settings["decompressor_search_order"]) + + # save resources, it is not always needed + self.compressor = None + def override_cbuild(self): if "CBUILD" in self.makeconf: self.settings["CBUILD"]=self.makeconf["CBUILD"] @@ -332,11 +342,11 @@ class StageBase(TargetBase, ClearBase, GenBase): normpath(self.settings["kerncache_path"]) else: self.settings["kerncache_path"]=normpath(self.settings["storedir"]+\ - "/kerncache/"+self.settings["target_subpath"]+"/") + "/kerncache/"+self.settings["target_subpath"]) def set_target_path(self): self.settings["target_path"]=normpath(self.settings["storedir"]+\ - "/builds/"+self.settings["target_subpath"].rstrip('/')+".tar.bz2") + "/builds/"+self.settings["target_subpath"]) if "autoresume" in self.settings["options"]\ and self.resume.is_enabled("setup_target_path"): print \ @@ -420,7 +430,7 @@ class StageBase(TargetBase, ClearBase, GenBase): "/tmp/" + self.settings["source_subpath"] + "/") else: self.settings["source_path"]=normpath(self.settings["storedir"]+\ - "/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2") + "/builds/"+self.settings["source_subpath"]) if os.path.isfile(self.settings["source_path"]): # XXX: Is this even necessary if the previous check passes? if os.path.exists(self.settings["source_path"]): @@ -435,7 +445,7 @@ class StageBase(TargetBase, ClearBase, GenBase): print "\tseedcache in the options of catalyst.conf the source path" print "\twill then be "+\ normpath(self.settings["storedir"]+"/builds/"+\ - self.settings["source_subpath"].rstrip('/')+".tar.bz2\n") + self.settings["source_subpath"]+"\n") def set_dest_path(self): if "root_path" in self.settings: @@ -462,7 +472,7 @@ class StageBase(TargetBase, ClearBase, GenBase): else: self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ "/snapshots/" + self.settings["snapshot_name"] + - self.settings["snapshot"].rstrip('/')+".tar.bz2") + self.settings["snapshot"]) if os.path.exists(self.settings["snapshot_path"]): self.settings["snapshot_path_hash"] = \ @@ -472,6 +482,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 524debef567a28fdf9506c8bb1d9818599c48204 Author: Brian Dolbec gentoo org> AuthorDate: Sun May 24 07:38:32 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Sep 4 15:19:57 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=524debef catalyst/main.py: Comment out the try: except: pair for target.run() catalyst/main.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 0ba81b9..7e3b55e 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -163,12 +163,12 @@ def build_target(addlargs): "Target \"%s\" not available." % target, print_traceback=True) - try: - target.run() - except: - print "!!! catalyst: Error encountered during run of target " + \ - addlargs["target"] - sys.exit(1) + #try: + target.run() + #except: + #print "!!! catalyst: Error encountered during run of target " + \ + # addlargs["target"] + #sys.exit(1) def main():
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/targets/
commit: 28f158b701e7984a9982c2916825f729bb79c7ea Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 23:10:50 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Sep 4 15:19:57 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=28f158b7 Fix a couple print() uses back to print statements for consistency catalyst/base/stagebase.py | 4 ++-- catalyst/targets/snapshot.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 7212409..8f12ac6 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1308,8 +1308,8 @@ class StageBase(TargetBase, ClearBase, GenBase): target_filename = ".".join([self.settings["target_path"].rstrip('/'), self.compressor.extension(pack_info['mode'])]) - print("Creating stage tarball... mode:", - self.settings["compression_mode"]) + print "Creating stage tarball... mode:", \ + self.settings["compression_mode"] if self.compressor.compress(pack_info): self.gen_contents_file(target_filename) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index ad96d37..1edcd02 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -72,11 +72,11 @@ class snapshot(TargetBase, GenBase): auto_extension=True ) if not compressor.compress(infodict): - print("Snapshot compression failure") + print "Snapshot compression failure" else: filename = '.'.join([self.settings["snapshot_path"], compressor.extension(self.settings["compression_mode"])]) - print("COMPRESSOR success filename", filename) + print "COMPRESSOR success filename", filename self.gen_contents_file(filename) self.gen_digest_file(filename)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 60ad85c8bc992c8eebacb8ba7a7edbe4462eef9e Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:31:33 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Sep 4 15:19:57 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=60ad85c8 catalyst/base/stagebase.py: Fix "Creating stage tarball..." print() catalyst/base/stagebase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 655ea06..ea37591 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1307,7 +1307,8 @@ class StageBase(TargetBase, ClearBase, GenBase): target_filename = ".".join([self.settings["target_path"].rstrip('/'), self.compressor.extension(pack_info['mode'])]) - print "Creating stage tarball..." + print("Creating stage tarball... mode:", + self.settings["compression_mode"]) if self.compressor.compress(pack_info): self.gen_contents_file(target_filename)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/, catalyst/targets/
commit: 6ef8ef293f9a08e58a7a632ceed631332b1cab87 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:33:29 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Sep 4 15:19:57 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=6ef8ef29 DeComp bug fixes catalyst/base/genbase.py | 2 +- catalyst/base/stagebase.py | 14 +- catalyst/main.py | 5 +++-- catalyst/targets/snapshot.py | 34 +- 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py index e818781..c05b36d 100644 --- a/catalyst/base/genbase.py +++ b/catalyst/base/genbase.py @@ -24,7 +24,7 @@ class GenBase(object): array=keys.keys() array.sort() for j in array: - contents = contents_map.generate_contents(file, j, + contents = contents_map.contents(file, j, verbose="VERBOSE" in self.settings) if contents: myf.write(contents) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index ea37591..7212409 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,7 +10,7 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join -from decomp.compress import CompressMap +from DeComp.compress import CompressMap from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) @@ -38,10 +38,11 @@ class StageBase(TargetBase, ClearBase, GenBase): self.required_values.extend(["version_stamp","target","subarch",\ "rel_type","profile","snapshot","source_subpath"]) - self.valid_values.extend(["version_stamp","target","subarch",\ - "rel_type","profile","snapshot","source_subpath","portage_confdir",\ - "cflags","cxxflags","fcflags","fflags","ldflags","cbuild","hostuse","portage_overlay",\ - "distcc_hosts","makeopts","pkgcache_path","kerncache_path"]) + self.valid_values.extend(["version_stamp","target","subarch", + "rel_type","profile","snapshot","source_subpath","portage_confdir", + "cflags","cxxflags","fcflags","fflags","ldflags","cbuild","hostuse","portage_overlay", + "distcc_hosts","makeopts","pkgcache_path","kerncache_path", + "compression_mode", "decompression_mode"]) self.set_valid_build_kernel_vars(addlargs) TargetBase.__init__(self, myspec, addlargs) @@ -1371,6 +1372,9 @@ class StageBase(TargetBase, ClearBase, GenBase): # lists in arch/amd64.py and friends. If we wanted self.settigs[var] # of any depth, we should make this function recursive. elif type(self.settings[x]) == types.DictType: + if x in ["compress_definitions", + "decompress_definitions"]: + continue self.env[varname] = string.join(self.settings[x].keys()) for y in self.settings[x].keys(): varname2 = "clst_"+string.replace(y,"/","_") diff --git a/catalyst/main.py b/catalyst/main.py index 7e3b55e..dc9342b 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -13,11 +13,12 @@ import os.path __selfpath__ = os.path.abspath(os.path.dirname(__file__)) -from decomp.compress import COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS +from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, + CONTENTS_DEFINITIONS) +from DeComp.contents import ContentsMap import catalyst.config import catalyst.util -from catalyst.contents import ContentsMap, CONTENTS_DEFINITIONS from catalyst.defaults import confdefaults, option_messages from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.lock import LockInUse diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 1887110..ad96d37 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -6,18 +6,21 @@ import os import shutil from stat import ST_UID, ST_GID, ST_MODE +from DeComp.compress import CompressMap from catalyst.support import normpath, cmd from catalyst.base.targetbase import TargetBase from catalyst.base.genbase import GenBase from catalyst.fileops import ensure_dirs + + class snapshot(TargetBase, GenBase): """ Builder class for snapshots. """ def __init__(self,myspec,addlar
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 75cdef7e4593d3de0c407610ae2f3a55b1859336 Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Wed Sep 2 21:23:10 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Sep 2 21:23:10 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=75cdef7e fix minor typo catalyst/base/stagebase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index c0bafc2..23491aa 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1097,7 +1097,7 @@ class StageBase(TargetBase, ClearBase, GenBase): myusevars.extend(self.settings["use"]) if myusevars: - myf.write("# These are the USE and USE_EXPAND flags that were used for\n# buidling in addition to what is provided by the profile.\n") + myf.write("# These are the USE and USE_EXPAND flags that were used for\n# building in addition to what is provided by the profile.\n") myusevars = sorted(set(myusevars)) myf.write('USE="'+string.join(myusevars)+'"\n') if '-*' in myusevars:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/
commit: 171e7e154c2629d85cd9979bd31f03d639fe8182 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:33:29 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Sep 3 15:12:38 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=171e7e15 DeComp bug fixes catalyst/base/genbase.py | 2 +- catalyst/base/stagebase.py | 14 +- catalyst/main.py | 5 +++-- catalyst/targets/snapshot.py | 34 +- 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py index e818781..c05b36d 100644 --- a/catalyst/base/genbase.py +++ b/catalyst/base/genbase.py @@ -24,7 +24,7 @@ class GenBase(object): array=keys.keys() array.sort() for j in array: - contents = contents_map.generate_contents(file, j, + contents = contents_map.contents(file, j, verbose="VERBOSE" in self.settings) if contents: myf.write(contents) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 7231303..e0e9023 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,7 +10,7 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join -from decomp.compress import CompressMap +from DeComp.compress import CompressMap from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) @@ -38,10 +38,11 @@ class StageBase(TargetBase, ClearBase, GenBase): self.required_values.extend(["version_stamp","target","subarch",\ "rel_type","profile","snapshot","source_subpath"]) - self.valid_values.extend(["version_stamp","target","subarch",\ - "rel_type","profile","snapshot","source_subpath","portage_confdir",\ - "cflags","cxxflags","fcflags","fflags","ldflags","cbuild","hostuse","portage_overlay",\ - "distcc_hosts","makeopts","pkgcache_path","kerncache_path"]) + self.valid_values.extend(["version_stamp","target","subarch", + "rel_type","profile","snapshot","source_subpath","portage_confdir", + "cflags","cxxflags","fcflags","fflags","ldflags","cbuild","hostuse","portage_overlay", + "distcc_hosts","makeopts","pkgcache_path","kerncache_path", + "compression_mode", "decompression_mode"]) self.set_valid_build_kernel_vars(addlargs) TargetBase.__init__(self, myspec, addlargs) @@ -1371,6 +1372,9 @@ class StageBase(TargetBase, ClearBase, GenBase): # lists in arch/amd64.py and friends. If we wanted self.settigs[var] # of any depth, we should make this function recursive. elif type(self.settings[x]) == types.DictType: + if x in ["compress_definitions", + "decompress_definitions"]: + continue self.env[varname] = string.join(self.settings[x].keys()) for y in self.settings[x].keys(): varname2 = "clst_"+string.replace(y,"/","_") diff --git a/catalyst/main.py b/catalyst/main.py index 7e3b55e..dc9342b 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -13,11 +13,12 @@ import os.path __selfpath__ = os.path.abspath(os.path.dirname(__file__)) -from decomp.compress import COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS +from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, + CONTENTS_DEFINITIONS) +from DeComp.contents import ContentsMap import catalyst.config import catalyst.util -from catalyst.contents import ContentsMap, CONTENTS_DEFINITIONS from catalyst.defaults import confdefaults, option_messages from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.lock import LockInUse diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 1887110..ad96d37 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -6,18 +6,21 @@ import os import shutil from stat import ST_UID, ST_GID, ST_MODE +from DeComp.compress import CompressMap from catalyst.support import normpath, cmd from catalyst.base.targetbase import TargetBase from catalyst.base.genbase import GenBase from catalyst.fileops import ensure_dirs + + class snapshot(TargetBase, GenBase): """ Builder class for snapshots. """ def __init__(self,myspec,addlar
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/, catalyst/base/
commit: 07d13a24c6b28369c63c9cfcc955df6547300243 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 23:10:50 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Sep 3 15:12:39 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=07d13a24 Fix a couple print() uses back to print statements for consistency catalyst/base/stagebase.py | 4 ++-- catalyst/targets/snapshot.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index e0e9023..f774ce8 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1308,8 +1308,8 @@ class StageBase(TargetBase, ClearBase, GenBase): target_filename = ".".join([self.settings["target_path"], self.compressor.extension(pack_info['mode'])]) - print("Creating stage tarball... mode:", - self.settings["compression_mode"]) + print "Creating stage tarball... mode:", \ + self.settings["compression_mode"] if self.compressor.compress(pack_info): self.gen_contents_file(target_filename) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index ad96d37..1edcd02 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -72,11 +72,11 @@ class snapshot(TargetBase, GenBase): auto_extension=True ) if not compressor.compress(infodict): - print("Snapshot compression failure") + print "Snapshot compression failure" else: filename = '.'.join([self.settings["snapshot_path"], compressor.extension(self.settings["compression_mode"])]) - print("COMPRESSOR success filename", filename) + print "COMPRESSOR success filename", filename self.gen_contents_file(filename) self.gen_digest_file(filename)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 827a9cd7ea1863242920651752a8265acc8d57ad Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Wed Sep 2 21:52:48 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Sep 2 21:52:48 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=827a9cd7 support setting/overriding fcflags and fflags, specifically for use with CFLAGS=-frecord-gcc-switches catalyst/base/stagebase.py | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 23491aa..d898e95 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -38,7 +38,7 @@ class StageBase(TargetBase, ClearBase, GenBase): self.valid_values.extend(["version_stamp","target","subarch",\ "rel_type","profile","snapshot","source_subpath","portage_confdir",\ - "cflags","cxxflags","ldflags","cbuild","hostuse","portage_overlay",\ + "cflags","cxxflags","fcflags","fflags","ldflags","cbuild","hostuse","portage_overlay",\ "distcc_hosts","makeopts","pkgcache_path","kerncache_path"]) self.set_valid_build_kernel_vars(addlargs) @@ -280,6 +280,14 @@ class StageBase(TargetBase, ClearBase, GenBase): if "CXXFLAGS" in self.makeconf: self.settings["CXXFLAGS"]=self.makeconf["CXXFLAGS"] + def override_fcflags(self): + if "FCFLAGS" in self.makeconf: + self.settings["FCFLAGS"]=self.makeconf["FCFLAGS"] + + def override_fflags(self): + if "FFLAGS" in self.makeconf: + self.settings["FFLAGS"]=self.makeconf["FFLAGS"] + def override_ldflags(self): if "LDFLAGS" in self.makeconf: self.settings["LDFLAGS"]=self.makeconf["LDFLAGS"] @@ -1020,6 +1028,8 @@ class StageBase(TargetBase, ClearBase, GenBase): self.override_chost() self.override_cflags() self.override_cxxflags() + self.override_fcflags() + self.override_fflags() self.override_ldflags() if "autoresume" in self.settings["options"] \ and self.resume.is_enabled("chroot_setup"): @@ -1077,6 +1087,20 @@ class StageBase(TargetBase, ClearBase, GenBase): myf.write('CXXFLAGS="${CFLAGS}"\n') else: myf.write('CXXFLAGS="${CFLAGS}"\n') + if "FCFLAGS" in self.settings: + if self.settings["FCFLAGS"]!=self.settings["CFLAGS"]: + myf.write('FCFLAGS="'+self.settings["FCFLAGS"]+'"\n') + else: + myf.write('FCFLAGS="${CFLAGS}"\n') + else: + myf.write('FCFLAGS="${CFLAGS}"\n') + if "FFLAGS" in self.settings: + if self.settings["FFLAGS"]!=self.settings["CFLAGS"]: + myf.write('FFLAGS="'+self.settings["FFLAGS"]+'"\n') + else: + myf.write('FFLAGS="${CFLAGS}"\n') + else: + myf.write('FFLAGS="${CFLAGS}"\n') if "LDFLAGS" in self.settings: myf.write("# LDFLAGS is unsupported. USE AT YOUR OWN RISK!\n")
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/targets/, etc/, examples/, catalyst/
commit: e1beae5aee64b474b73a68c790b612c732c0b835 Author: Brian Dolbec gentoo org> AuthorDate: Sun May 24 07:36:49 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Sep 3 15:09:02 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e1beae5a apply new compress code, normalize paths catalyst/base/stagebase.py | 171 +++ catalyst/defaults.py | 4 + catalyst/main.py | 8 ++ catalyst/targets/grp.py | 2 +- catalyst/targets/livecd_stage1.py| 2 +- catalyst/targets/livecd_stage2.py| 6 +- catalyst/targets/netboot.py | 8 +- catalyst/targets/netboot2.py | 2 +- catalyst/targets/stage2.py | 8 +- etc/catalyst.conf| 11 ++- examples/generic_stage_template.spec | 32 ++- 11 files changed, 159 insertions(+), 95 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index d898e95..aba330e 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,6 +10,8 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join +from decomp.compress import CompressMap + from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) from catalyst.support import (CatalystError, msg, file_locate, normpath, @@ -264,6 +266,14 @@ class StageBase(TargetBase, ClearBase, GenBase): self.env["PORT_LOGDIR"] = self.settings["port_logdir"] self.env["PORT_LOGDIR_CLEAN"] = PORT_LOGDIR_CLEAN + # Initialize our (de)compressor's) + self.decompressor = CompressMap(self.settings["decompress_definitions"], + env=self.env, + search_order=self.settings["decompressor_search_order"]) + + # save resources, it is not always needed + self.compressor = None + def override_cbuild(self): if "CBUILD" in self.makeconf: self.settings["CBUILD"]=self.makeconf["CBUILD"] @@ -332,11 +342,11 @@ class StageBase(TargetBase, ClearBase, GenBase): normpath(self.settings["kerncache_path"]) else: self.settings["kerncache_path"]=normpath(self.settings["storedir"]+\ - "/kerncache/"+self.settings["target_subpath"]+"/") + "/kerncache/"+self.settings["target_subpath"]) def set_target_path(self): self.settings["target_path"]=normpath(self.settings["storedir"]+\ - "/builds/"+self.settings["target_subpath"].rstrip('/')+".tar.bz2") + "/builds/"+self.settings["target_subpath"]) if "autoresume" in self.settings["options"]\ and self.resume.is_enabled("setup_target_path"): print \ @@ -420,7 +430,7 @@ class StageBase(TargetBase, ClearBase, GenBase): "/tmp/" + self.settings["source_subpath"] + "/") else: self.settings["source_path"]=normpath(self.settings["storedir"]+\ - "/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2") + "/builds/"+self.settings["source_subpath"]) if os.path.isfile(self.settings["source_path"]): # XXX: Is this even necessary if the previous check passes? if os.path.exists(self.settings["source_path"]): @@ -435,7 +445,7 @@ class StageBase(TargetBase, ClearBase, GenBase): print "\tseedcache in the options of catalyst.conf the source path" print "\twill then be "+\ normpath(self.settings["storedir"]+"/builds/"+\ - self.settings["source_subpath"].rstrip('/')+".tar.bz2\n") + self.settings["source_subpath"]+"\n") def set_dest_path(self): if "root_path" in self.settings: @@ -462,7 +472,7 @@ class StageBase(TargetBase, ClearBase, GenBase): else: self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ "/snapshots/" + self.settings["snapshot_name"] + - self.settings["snapshot"].rstrip('/')+".tar.bz2") + self.settings["snapshot"]) if os.path.exists(self.settings["snapshot_path"]): self.settings["snapshot_path_hash"] = \ @@ -472,6 +482,9 @@ class StageBase(TargetBase, ClearBase, GenBase): verbose = False) def set_snapca
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: fc30e2ab67dd74c6f52a042587a32d528fa576cf Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:31:33 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Sep 3 15:09:02 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=fc30e2ab catalyst/base/stagebase.py: Fix "Creating stage tarball..." print() catalyst/base/stagebase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index aba330e..7231303 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1307,7 +1307,8 @@ class StageBase(TargetBase, ClearBase, GenBase): target_filename = ".".join([self.settings["target_path"], self.compressor.extension(pack_info['mode'])]) - print "Creating stage tarball..." + print("Creating stage tarball... mode:", + self.settings["compression_mode"]) if self.compressor.compress(pack_info): self.gen_contents_file(target_filename)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 6428baba7e9f7aa6fc4ede457804adbe793c3ac4 Author: Brian Dolbec gentoo org> AuthorDate: Sun May 24 07:38:32 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Sep 3 15:09:02 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=6428baba catalyst/main.py: Comment out the try: except: pair for target.run() catalyst/main.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 0ba81b9..7e3b55e 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -163,12 +163,12 @@ def build_target(addlargs): "Target \"%s\" not available." % target, print_traceback=True) - try: - target.run() - except: - print "!!! catalyst: Error encountered during run of target " + \ - addlargs["target"] - sys.exit(1) + #try: + target.run() + #except: + #print "!!! catalyst: Error encountered during run of target " + \ + # addlargs["target"] + #sys.exit(1) def main():
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 99fc43024db4be08fbfbff3a6a79c90db920e927 Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Tue Sep 1 19:40:15 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 1 19:40:15 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=99fc4302 drop --selinux switch from tar tar --selinux isn't support unless you are on selinux, and in that case things are still not likely to be right do to the dark magic that is selinux. >From the head of the selinux team: <@SwifT> Zero_Chaos: let's not use tar --selinux right now until we have updated catalyst to create selinux-enabled chroots catalyst/base/stagebase.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 6adc3b9..25e5b6c 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -696,10 +696,10 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["chroot_path"]+\ " (This may take some time) ...\n" if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] else: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] error_msg="Tarball extraction of "+\ self.settings["source_path"]+" to "+\ @@ -711,10 +711,10 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["chroot_path"]+\ " (This may take some time) ...\n" if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] else: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] error_msg="Tarball extraction of "+self.settings["source_path"]+\ " to "+self.settings["chroot_path"]+" failed." @@ -806,9 +806,9 @@ class StageBase(TargetBase, ClearBase, GenBase): "catalyst-hash") destdir=self.settings["snapshot_cache_path"] if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir else: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -xpf "+self.settings["snapshot_path"]+" -C "+destdir + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags -xpf "+self.settings["snapshot_path"]+" -C "+destdir unpack_errmsg="Error unpacking snapshot" cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\ self.settings["snapshot_cache_path"]+\ @@ -825,10 +
[gentoo-commits] proj/catalyst:pending commit in: catalyst/targets/, catalyst/base/
commit: 515546abb3859533a1a64a64253e661b19676b77 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 23:10:50 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 1 05:54:12 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=515546ab Fix a couple print() uses back to print statements for consistency catalyst/base/stagebase.py | 4 ++-- catalyst/targets/snapshot.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index c23c8b7..f4bed03 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1279,8 +1279,8 @@ class StageBase(TargetBase, ClearBase, GenBase): target_filename = ".".join([self.settings["target_path"], self.compressor.extension(pack_info['mode'])]) - print("Creating stage tarball... mode:", - self.settings["compression_mode"]) + print "Creating stage tarball... mode:", \ + self.settings["compression_mode"] if self.compressor.compress(pack_info): self.gen_contents_file(target_filename) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index ad96d37..1edcd02 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -72,11 +72,11 @@ class snapshot(TargetBase, GenBase): auto_extension=True ) if not compressor.compress(infodict): - print("Snapshot compression failure") + print "Snapshot compression failure" else: filename = '.'.join([self.settings["snapshot_path"], compressor.extension(self.settings["compression_mode"])]) - print("COMPRESSOR success filename", filename) + print "COMPRESSOR success filename", filename self.gen_contents_file(filename) self.gen_digest_file(filename)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/, catalyst/targets/
commit: 12f2040646c17c2145b0685deeed2e46e582f964 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:33:29 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 1 05:54:11 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=12f20406 DeComp bug fixes catalyst/base/genbase.py | 2 +- catalyst/base/stagebase.py | 8 ++-- catalyst/main.py | 5 +++-- catalyst/targets/snapshot.py | 34 +- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py index e818781..c05b36d 100644 --- a/catalyst/base/genbase.py +++ b/catalyst/base/genbase.py @@ -24,7 +24,7 @@ class GenBase(object): array=keys.keys() array.sort() for j in array: - contents = contents_map.generate_contents(file, j, + contents = contents_map.contents(file, j, verbose="VERBOSE" in self.settings) if contents: myf.write(contents) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index e07e2c2..c23c8b7 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,7 +10,7 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join -from decomp.compress import CompressMap +from DeComp.compress import CompressMap from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) @@ -36,7 +36,8 @@ class StageBase(TargetBase, ClearBase, GenBase): self.valid_values.extend(["version_stamp","target","subarch",\ "rel_type","profile","snapshot","source_subpath","portage_confdir",\ "cflags","cxxflags","ldflags","cbuild","hostuse","portage_overlay",\ - "distcc_hosts","makeopts","pkgcache_path","kerncache_path"]) + "distcc_hosts","makeopts","pkgcache_path","kerncache_path", + "compression_mode", "decompression_mode"]) self.set_valid_build_kernel_vars(addlargs) TargetBase.__init__(self, myspec, addlargs) @@ -1342,6 +1343,9 @@ class StageBase(TargetBase, ClearBase, GenBase): # lists in arch/amd64.py and friends. If we wanted self.settigs[var] # of any depth, we should make this function recursive. elif type(self.settings[x]) == types.DictType: + if x in ["compress_definitions", + "decompress_definitions"]: + continue self.env[varname] = string.join(self.settings[x].keys()) for y in self.settings[x].keys(): varname2 = "clst_"+string.replace(y,"/","_") diff --git a/catalyst/main.py b/catalyst/main.py index 7e3b55e..dc9342b 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -13,11 +13,12 @@ import os.path __selfpath__ = os.path.abspath(os.path.dirname(__file__)) -from decomp.compress import COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS +from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, + CONTENTS_DEFINITIONS) +from DeComp.contents import ContentsMap import catalyst.config import catalyst.util -from catalyst.contents import ContentsMap, CONTENTS_DEFINITIONS from catalyst.defaults import confdefaults, option_messages from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.lock import LockInUse diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 1887110..ad96d37 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -6,18 +6,21 @@ import os import shutil from stat import ST_UID, ST_GID, ST_MODE +from DeComp.compress import CompressMap from catalyst.support import normpath, cmd from catalyst.base.targetbase import TargetBase from catalyst.base.genbase import GenBase from catalyst.fileops import ensure_dirs + + class snapshot(TargetBase, GenBase): """ Builder class for snapshots. """ def __init__(self,myspec,addlargs): self.required_values=["version_stamp","target"] - self.valid_values=["version_stamp","target"] + self.valid_values=["version_stamp","target", "compression_mode"] TargetBase.__init__(self, myspec, addlargs) GenBase.__init__(self,myspec) @@ -26,7 +29,7 @@ class snapshot(TargetBase, GenBase): st=self.settings["storedir"] self.settings["snapshot_path"] = no
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 7795237bfce897bf0b2f9531c902c72adb87907d Author: Brian Dolbec gentoo org> AuthorDate: Sun May 24 07:38:32 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 1 05:54:11 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=7795237b catalyst/main.py: Comment out the try: except: pair for target.run() catalyst/main.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 0ba81b9..7e3b55e 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -163,12 +163,12 @@ def build_target(addlargs): "Target \"%s\" not available." % target, print_traceback=True) - try: - target.run() - except: - print "!!! catalyst: Error encountered during run of target " + \ - addlargs["target"] - sys.exit(1) + #try: + target.run() + #except: + #print "!!! catalyst: Error encountered during run of target " + \ + # addlargs["target"] + #sys.exit(1) def main():
[gentoo-commits] proj/catalyst:pending commit in: catalyst/arch/
commit: be6d7f0b7f0a36d4bbfa30704dbccf6bd76f5754 Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Mon Aug 31 17:49:38 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Aug 31 17:49:38 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=be6d7f0b use profile for CPU_FLAGS_X86 where appropriate a number of the CPU_FLAGS_X86 settings appeared to be trying to use something very much like the default from the profile but missing mmxext. Due to this, a number of packages like ffmpeg would be broken, where using the profile is better. Modified to remove (comment out) the ones that appeared to be attempting to use the default (and failing) while leaving in the settings which are intentionally disabling certain unavailable features per sub-arch. catalyst/arch/amd64.py | 15 --- catalyst/arch/x86.py | 7 --- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/catalyst/arch/amd64.py b/catalyst/arch/amd64.py index dccfa46..1e11be9 100644 --- a/catalyst/arch/amd64.py +++ b/catalyst/arch/amd64.py @@ -13,7 +13,8 @@ class arch_amd64(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} + #lines like this appears to be trying to set the profile default, better to use the profile + #self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} class arch_nocona(generic_amd64): "improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE, SSE2 and SSE3 support" @@ -21,7 +22,7 @@ class arch_nocona(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=nocona -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} + #self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} # Requires gcc 4.3 to use this class class arch_core2(generic_amd64): @@ -30,7 +31,7 @@ class arch_core2(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=core2 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","ssse3"]} + #self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","ssse3"]} class arch_k8(generic_amd64): "generic k8, opteron and athlon64 support" @@ -38,7 +39,7 @@ class arch_k8(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=k8 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","3dnow"]} + #self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","3dnow"]} class arch_k8_sse3(generic_amd64): "improved versions of k8, opteron and athlon64 with SSE3 support" @@ -46,7 +47,7 @@ class arch_k8_sse3(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=k8-sse3 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","3dnow"]} + #self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","3dnow"]} class arch_amdfam10(generic_amd64): "AMD Family 10h core based CPUs with x86-64 instruction set support" @@ -54,7 +55,7 @@ class arch_amdfam10(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=amdfam10 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","3dnow"]} + #self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","3dnow"]} class arch_x32(generic_amd64): "builder class for generic x32 (Intel and AMD)" @@ -62,7 +63,7 @@ class arch_x32(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnux32" - self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} + #self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} def register(): "inform main catalyst program of the contents of this plugin" diff --git a/catalyst/arch/x86.py b/catalyst/arch/x86.py index 08ba6d4..eb4470c 100644 --- a/catalyst/arch/x86.py +++ b/catalyst/arch/x86.py @@ -78,21 +78,22 @@ class arch_pentium4(generic_x86): def __in
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 8c02a9bcfae418c2e48b05299c54e437bf97d246 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:31:33 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Sep 1 05:54:11 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=8c02a9bc catalyst/base/stagebase.py: Fix "Creating stage tarball..." print() catalyst/base/stagebase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 2e175f1..e07e2c2 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1278,7 +1278,8 @@ class StageBase(TargetBase, ClearBase, GenBase): target_filename = ".".join([self.settings["target_path"], self.compressor.extension(pack_info['mode'])]) - print "Creating stage tarball..." + print("Creating stage tarball... mode:", + self.settings["compression_mode"]) if self.compressor.compress(pack_info): self.gen_contents_file(target_filename)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 3768757b9f31bcf34f8aac853f24cf97096dabb9 Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Mon Aug 31 19:21:50 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Aug 31 19:21:50 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=3768757b drop redundant make.conf.catalyst catalyst/base/stagebase.py | 4 1 file changed, 4 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 4c7f029..6adc3b9 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1119,10 +1119,6 @@ class StageBase(TargetBase, ClearBase, GenBase): myf.write('PORTDIR_OVERLAY="/usr/local/portage"\n') myf.close() - makepath = normpath(self.settings["chroot_path"] + - self.settings["make_conf"]) - cmd("cp " + makepath + " " + makepath + ".catalyst",\ - "Could not backup " + self.settings["make_conf"],env=self.env) self.resume.enable("chroot_setup") def fsscript(self):
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: f499da75fe51ed8ae2830a20fef5a27bce633173 Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Mon Aug 31 03:15:50 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Aug 31 03:15:50 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f499da75 Revert "catalyst/main.py: Fix variables not being substituted with correct values" This reverts commit 4328dcd693ae02a77c519e5186e5430171c16ac5. Reverting due to : Envscript support enabled. Traceback (most recent call last): File "/usr/lib/python-exec/python2.7/catalyst", line 39, in main() File "/usr/lib64/python2.7/site-packages/catalyst/main.py", line 343, in main build_target(addlargs) File "/usr/lib64/python2.7/site-packages/catalyst/main.py", line 158, in build_target target = getattr(module, target)(conf_values, addlargs) File "/usr/lib64/python2.7/site-packages/catalyst/targets/stage1.py", line 21, in __init__ StageBase.__init__(self,spec,addlargs) File "/usr/lib64/python2.7/site-packages/catalyst/base/stagebase.py", line 72, in __init__ for x in [x[:-3] for x in os.listdir(arch_dir) if x.endswith(".py") and x != "__init__.py"]: OSError: [Errno 2] No such file or directory: './catalyst/arch/' catalyst/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 2335495..a09 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -107,8 +107,8 @@ def parse_config(myconfig): else: conf_values[x]=myconf[x] else: - conf_values[x] = confdefaults[x] % confdefaults - print "Setting",x,"to default value \"" + conf_values[x] + "\"" + print "Setting",x,"to default value \""+confdefaults[x]+"\"" + conf_values[x]=confdefaults[x] # add our python base directory to use for loading target arch's conf_values["PythonDir"] = __selfpath__
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: eebe07d435107f67418e838b34ecd036039bd453 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:31:33 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Jun 15 16:31:33 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=eebe07d4 catalyst/base/stagebase.py: Fix "Creating stage tarball..." print() catalyst/base/stagebase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 20b9e69..73b930b 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1279,7 +1279,8 @@ class StageBase(TargetBase, ClearBase, GenBase): target_filename = ".".join([self.settings["target_path"], self.compressor.extension(pack_info['mode'])]) - print "Creating stage tarball..." + print("Creating stage tarball... mode:", + self.settings["compression_mode"]) if self.compressor.compress(pack_info): self.gen_contents_file(target_filename)
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/targets/, examples/, catalyst/, etc/
commit: 37a123f49b34e9189b52225645431de5896af985 Author: Brian Dolbec gentoo org> AuthorDate: Sun May 24 07:36:49 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sun May 24 16:32:43 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=37a123f4 apply new compress code, normalize paths catalyst/base/stagebase.py | 171 +++ catalyst/defaults.py | 4 + catalyst/main.py | 8 ++ catalyst/targets/grp.py | 2 +- catalyst/targets/livecd_stage1.py| 2 +- catalyst/targets/livecd_stage2.py| 6 +- catalyst/targets/netboot.py | 8 +- catalyst/targets/netboot2.py | 2 +- catalyst/targets/stage2.py | 8 +- etc/catalyst.conf| 11 ++- examples/generic_stage_template.spec | 32 ++- 11 files changed, 159 insertions(+), 95 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 644bd7c..20b9e69 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,6 +10,8 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join +from decomp.compress import CompressMap + from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) from catalyst.support import (CatalystError, msg, file_locate, normpath, @@ -259,6 +261,14 @@ class StageBase(TargetBase, ClearBase, GenBase): self.env["PORT_LOGDIR"] = self.settings["port_logdir"] self.env["PORT_LOGDIR_CLEAN"] = PORT_LOGDIR_CLEAN + # Initialize our (de)compressor's) + self.decompressor = CompressMap(self.settings["decompress_definitions"], + env=self.env, + search_order=self.settings["decompressor_search_order"]) + + # save resources, it is not always needed + self.compressor = None + def override_cbuild(self): if "CBUILD" in self.makeconf: self.settings["CBUILD"]=self.makeconf["CBUILD"] @@ -319,11 +329,11 @@ class StageBase(TargetBase, ClearBase, GenBase): normpath(self.settings["kerncache_path"]) else: self.settings["kerncache_path"]=normpath(self.settings["storedir"]+\ - "/kerncache/"+self.settings["target_subpath"]+"/") + "/kerncache/"+self.settings["target_subpath"]) def set_target_path(self): self.settings["target_path"]=normpath(self.settings["storedir"]+\ - "/builds/"+self.settings["target_subpath"].rstrip('/')+".tar.bz2") + "/builds/"+self.settings["target_subpath"]) if "autoresume" in self.settings["options"]\ and self.resume.is_enabled("setup_target_path"): print \ @@ -407,7 +417,7 @@ class StageBase(TargetBase, ClearBase, GenBase): "/tmp/" + self.settings["source_subpath"] + "/") else: self.settings["source_path"]=normpath(self.settings["storedir"]+\ - "/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2") + "/builds/"+self.settings["source_subpath"]) if os.path.isfile(self.settings["source_path"]): # XXX: Is this even necessary if the previous check passes? if os.path.exists(self.settings["source_path"]): @@ -422,7 +432,7 @@ class StageBase(TargetBase, ClearBase, GenBase): print "\tseedcache in the options of catalyst.conf the source path" print "\twill then be "+\ normpath(self.settings["storedir"]+"/builds/"+\ - self.settings["source_subpath"].rstrip('/')+".tar.bz2\n") + self.settings["source_subpath"]+"\n") def set_dest_path(self): if "root_path" in self.settings: @@ -449,7 +459,7 @@ class StageBase(TargetBase, ClearBase, GenBase): else: self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ "/snapshots/" + self.settings["snapshot_name"] + - self.settings["snapshot"].rstrip('/')+".tar.bz2") + self.settings["snapshot"]) if os.path.exists(self.settings["snapshot_path"]): self.settings["snapshot_path_hash"] = \ @@ -459,6 +469,9 @@ class StageBase(TargetBase, ClearBase, GenBase): verbose = False) def set_snapca
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 13b3075b46020847b077b8efe797075b6ecceaf4 Author: Brian Dolbec gentoo org> AuthorDate: Sun May 24 07:38:32 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sun May 24 16:32:53 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=13b3075b catalyst/main.py: Comment out the try: except: pair for target.run() catalyst/main.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 35a4edc..b498f11 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -164,12 +164,12 @@ def build_target(addlargs): "Target \"%s\" not available." % target, print_traceback=True) - try: - target.run() - except: - print "!!! catalyst: Error encountered during run of target " + \ - addlargs["target"] - sys.exit(1) + #try: + target.run() + #except: + #print "!!! catalyst: Error encountered during run of target " + \ + # addlargs["target"] + #sys.exit(1) def main():
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/
commit: 89c0fa2a9b1d79c726d25d8fc73fbd8b90587db0 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:33:29 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Jun 15 16:33:29 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=89c0fa2a DeComp bug fixes catalyst/base/genbase.py | 2 +- catalyst/base/stagebase.py | 8 ++-- catalyst/main.py | 5 +++-- catalyst/targets/snapshot.py | 34 +- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py index e818781..c05b36d 100644 --- a/catalyst/base/genbase.py +++ b/catalyst/base/genbase.py @@ -24,7 +24,7 @@ class GenBase(object): array=keys.keys() array.sort() for j in array: - contents = contents_map.generate_contents(file, j, + contents = contents_map.contents(file, j, verbose="VERBOSE" in self.settings) if contents: myf.write(contents) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 73b930b..1942a33 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,7 +10,7 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join -from decomp.compress import CompressMap +from DeComp.compress import CompressMap from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) @@ -36,7 +36,8 @@ class StageBase(TargetBase, ClearBase, GenBase): self.valid_values.extend(["version_stamp","target","subarch",\ "rel_type","profile","snapshot","source_subpath","portage_confdir",\ "cflags","cxxflags","ldflags","cbuild","hostuse","portage_overlay",\ - "distcc_hosts","makeopts","pkgcache_path","kerncache_path"]) + "distcc_hosts","makeopts","pkgcache_path","kerncache_path", + "compression_mode", "decompression_mode"]) self.set_valid_build_kernel_vars(addlargs) TargetBase.__init__(self, myspec, addlargs) @@ -1343,6 +1344,9 @@ class StageBase(TargetBase, ClearBase, GenBase): # lists in arch/amd64.py and friends. If we wanted self.settigs[var] # of any depth, we should make this function recursive. elif type(self.settings[x]) == types.DictType: + if x in ["compress_definitions", + "decompress_definitions"]: + continue self.env[varname] = string.join(self.settings[x].keys()) for y in self.settings[x].keys(): varname2 = "clst_"+string.replace(y,"/","_") diff --git a/catalyst/main.py b/catalyst/main.py index b498f11..c845120 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -13,11 +13,12 @@ import os.path __selfpath__ = os.path.abspath(os.path.dirname(__file__)) -from decomp.compress import COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS +from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, + CONTENTS_DEFINITIONS) +from DeComp.contents import ContentsMap import catalyst.config import catalyst.util -from catalyst.contents import ContentsMap, CONTENTS_DEFINITIONS from catalyst.defaults import confdefaults, option_messages from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.lock import LockInUse diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index 1887110..ad96d37 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -6,18 +6,21 @@ import os import shutil from stat import ST_UID, ST_GID, ST_MODE +from DeComp.compress import CompressMap from catalyst.support import normpath, cmd from catalyst.base.targetbase import TargetBase from catalyst.base.genbase import GenBase from catalyst.fileops import ensure_dirs + + class snapshot(TargetBase, GenBase): """ Builder class for snapshots. """ def __init__(self,myspec,addlargs): self.required_values=["version_stamp","target"] - self.valid_values=["version_stamp","target"] + self.valid_values=["version_stamp","target", "compression_mode"] TargetBase.__init__(self, myspec, addlargs) GenBase.__init__(self,myspec) @@ -26,7 +29,7 @@ class snapshot(TargetBase, GenBase): st=self.settings["storedir"] self.settings["snapshot_path"] = no
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 4f3065cbefa8976f77a52689298bb4ab38ab2317 Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) gentoo org> AuthorDate: Sat Dec 6 17:30:01 2014 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 28 02:32:23 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=4f3065cb Use -xpf instead of xpf with tar so it doesn't complain about missing option. Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) gentoo.org> catalyst/base/stagebase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index a33cae4..4d9ff0d 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -808,7 +808,7 @@ class StageBase(TargetBase, ClearBase, GenBase): if "bz2" == self.settings["chroot_path"][-3:]: unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir else: - unpack_cmd="tar --xattrs --acls xpf "+self.settings["snapshot_path"]+" -C "+destdir + unpack_cmd="tar --xattrs --acls -xpf "+self.settings["snapshot_path"]+" -C "+destdir unpack_errmsg="Error unpacking snapshot" cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\ self.settings["snapshot_cache_path"]+\ @@ -828,7 +828,7 @@ class StageBase(TargetBase, ClearBase, GenBase): unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+\ self.settings["chroot_path"]+"/usr" else: - unpack_cmd="tar --xattrs --acls xpf "+self.settings["snapshot_path"]+" -C "+\ + unpack_cmd="tar --xattrs --acls -xpf "+self.settings["snapshot_path"]+" -C "+\ self.settings["chroot_path"]+"/usr" unpack_errmsg="Error unpacking snapshot"
[gentoo-commits] proj/catalyst:pending commit in: catalyst/arch/, catalyst/base/, targets/stage1/
commit: 4d0b925842bb8e16e4c561b1ebe9d653da97e176 Author: Anthony G. Basile gentoo org> AuthorDate: Sat Feb 14 18:35:57 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 28 03:04:39 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=4d0b9258 modules/generic_stage_target.py: handle USE_EXPAND flags Currently catalyst does not handle USE_EXPAND flags. However, the recent move of mmx, sse and friends from the global USE flags to the new CPU_FLAGS_X86 USE_EXPAND flag requires this. This commit adds code to handle a new syntax for self.setting[x] values which can now contain dictionaries to objects. We use these to build environment variables for USE_EXPAND flags. Eg. in arch/amd64.py we set self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} which is later exported in the environtment as: clst_HOSTUSEEXPAND="CPU_FLAGS_X86" and clst_CPU_FLAGS_X86="mmx sse sse2" In general one could have: self.settings["A"]={"B":[1,2,3],"C":[4,5,6]} which would export clst_A="B C" and clst_B="1 2 3" clst_C="4 5 6" Signed-off-by: Anthony G. Basile gentoo.org> catalyst/arch/amd64.py | 14 +++--- catalyst/arch/x86.py| 20 ++-- catalyst/base/stagebase.py | 31 ++- targets/stage1/stage1-chroot.sh | 13 - 4 files changed, 59 insertions(+), 19 deletions(-) diff --git a/catalyst/arch/amd64.py b/catalyst/arch/amd64.py index 13e7563..dccfa46 100644 --- a/catalyst/arch/amd64.py +++ b/catalyst/arch/amd64.py @@ -13,7 +13,7 @@ class arch_amd64(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSE"]=["mmx","sse","sse2"] + self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} class arch_nocona(generic_amd64): "improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE, SSE2 and SSE3 support" @@ -21,7 +21,7 @@ class arch_nocona(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=nocona -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSE"]=["mmx","sse","sse2"] + self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} # Requires gcc 4.3 to use this class class arch_core2(generic_amd64): @@ -30,7 +30,7 @@ class arch_core2(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=core2 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSE"]=["mmx","sse","sse2","ssse3"] + self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","ssse3"]} class arch_k8(generic_amd64): "generic k8, opteron and athlon64 support" @@ -38,7 +38,7 @@ class arch_k8(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=k8 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSE"]=["mmx","sse","sse2","3dnow"] + self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","3dnow"]} class arch_k8_sse3(generic_amd64): "improved versions of k8, opteron and athlon64 with SSE3 support" @@ -46,7 +46,7 @@ class arch_k8_sse3(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=k8-sse3 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSE"]=["mmx","sse","sse2","3dnow"] + self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","3dnow"]} class arch_amdfam10(generic_amd64): "AMD Family 10h core based CPUs with x86-64 instruction set support" @@ -54,7 +54,7 @@ class arch_amdfam10(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=amdfam10 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" - self.settings["HOSTUSE"]=["mmx","sse","sse2","3dnow"] + self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2","3dnow"]} class arch_x32(generic_amd64): "builder class for generic x32 (Intel and AMD)" @@ -62,7 +62,7 @@ class arch_x32(generic_amd64): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnux32" - self.settings["HOSTUSE"]=["mmx","sse","sse2"] + self.settings["HOSTUSEEXPAND"]={"CPU_FLAGS_X86":["mmx","sse","sse2"]} def register(): "inform main catalyst program of the contents of this plugin" di
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: de00f5ffe2b626881dc90aa3d8ff322eba5c5c5d Author: Anthony G. Basile gentoo org> AuthorDate: Mon Jan 19 03:21:16 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 28 02:34:20 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=de00f5ff Do not untar with --acls, fixes bug #536762 catalyst/base/stagebase.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index dee947f..5200182 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -696,10 +696,10 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["chroot_path"]+\ " (This may take some time) ...\n" if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] else: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] error_msg="Tarball extraction of "+\ self.settings["source_path"]+" to "+\ @@ -711,10 +711,10 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["chroot_path"]+\ " (This may take some time) ...\n" if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] else: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] error_msg="Tarball extraction of "+self.settings["source_path"]+\ " to "+self.settings["chroot_path"]+" failed." @@ -806,9 +806,9 @@ class StageBase(TargetBase, ClearBase, GenBase): "catalyst-hash") destdir=self.settings["snapshot_cache_path"] if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir else: - unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -xpf "+self.settings["snapshot_path"]+" -C "+destdir + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux -xpf "+self.settings["snapshot_path"]+" -C "+destdir unpack_errmsg="Error unpacking snapshot" cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\ self.settings["snapshot_cache_path"]+\ @@ -825,10 +825,10 @@ class StageBase(TargetBase, ClearBase, GenBase): cleanup_msg=\ "Cleaning up existing portage tree (This can take a long time)..."
[gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
commit: 64cae407aa8e334a2b925fd5aab1f6a4d164a47a Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) gentoo org> AuthorDate: Sat Dec 6 16:48:27 2014 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 28 02:28:16 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=64cae407 Add --xattrs and --acls to the tar calls so we don't lose file properties while building the stages - should fix bug 531788. Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) gentoo.org> catalyst/base/stagebase.py | 18 +- catalyst/contents.py | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index c94f6b6..a33cae4 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -696,10 +696,10 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["chroot_path"]+\ " (This may take some time) ...\n" if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] else: - unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] error_msg="Tarball extraction of "+\ self.settings["source_path"]+" to "+\ @@ -711,10 +711,10 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["chroot_path"]+\ " (This may take some time) ...\n" if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] else: - unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] error_msg="Tarball extraction of "+self.settings["source_path"]+\ " to "+self.settings["chroot_path"]+" failed." @@ -806,9 +806,9 @@ class StageBase(TargetBase, ClearBase, GenBase): "catalyst-hash") destdir=self.settings["snapshot_cache_path"] if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir + unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir else: - unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir + unpack_cmd="tar --xattrs --acls xpf "+self.settings["snapshot_path"]+" -C "+destdir unpack_errmsg="Error unpacking snapshot" cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\ self.settings["snapshot_cache_path"]+\ @@ -825,10 +825,10 @@ class StageBase(TargetBase, ClearBase, GenBase): cleanup_msg=\ "Cleaning up existing portage tree (This can take a long time)..." if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+\ + unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+\ self.settings["chroot_path"]+"/usr" else: - unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\ + unpack_cmd="tar --xattrs --acls xpf "+self.settings["snapshot_path"]+" -C "+\ self.settings["chroot_path"]+"/usr" unpack_errmsg="Error unpacking snapshot" @@ -1248,7 +1248,7 @@ class StageBase(TargetBase,
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 24ec1400aa8c1b9aedae9a498e172d63cfe3705d Author: Brian Dolbec gentoo org> AuthorDate: Sat Mar 28 03:58:10 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Thu May 21 15:28:18 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=24ec1400 catalyst/support.py: Fix some leading whitespace rebase errors Change a CatalystError to not print a traceback. catalyst/support.py | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/catalyst/support.py b/catalyst/support.py index 7957f08..2ac4816 100644 --- a/catalyst/support.py +++ b/catalyst/support.py @@ -152,17 +152,17 @@ def file_locate(settings,filelist,expand=1): #filenames such as cdtar are optional, so we don't assume the variable is defined. pass else: - if len(settings[myfile])==0: - raise CatalystError("File variable \"" + myfile + + if len(settings[myfile])==0: + raise CatalystError("File variable \"" + myfile + "\" has a length of zero (not specified.)", print_traceback=True) - if settings[myfile][0]=="/": - if not os.path.exists(settings[myfile]): - raise CatalystError("Cannot locate specified " + myfile + - ": "+settings[myfile], print_traceback=True) - elif expand and os.path.exists(os.getcwd()+"/"+settings[myfile]): - settings[myfile]=os.getcwd()+"/"+settings[myfile] - else: - raise CatalystError("Cannot locate specified " + myfile + + if settings[myfile][0]=="/": + if not os.path.exists(settings[myfile]): + raise CatalystError("Cannot locate specified " + myfile + + ": " + settings[myfile], print_traceback=False) + elif expand and os.path.exists(os.getcwd()+"/"+settings[myfile]): + settings[myfile]=os.getcwd()+"/"+settings[myfile] + else: + raise CatalystError("Cannot locate specified " + myfile + ": "+settings[myfile]+" (2nd try)" + """ Spec file format:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: f2afd7ff03e6e8453e86be938bd21c2cd33d3996 Author: Brian Dolbec gentoo org> AuthorDate: Tue Mar 4 01:56:56 2014 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Feb 26 23:04:28 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f2afd7ff Fix purgeonly to remove the chroot directory. catalyst/base/stagebase.py | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index f2aadee..191baab 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -504,6 +504,9 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_action_sequence(self): """ Default action sequence for run method """ + if "purgeonly" in self.settings["options"]: + self.settings["action_sequence"] = ["remove_chroot"] + return self.settings["action_sequence"]=["unpack","unpack_snapshot",\ "setup_confdir","portage_overlay",\ "base_dirs","bind","chroot_setup","setup_environment",\ @@ -517,6 +520,7 @@ class StageBase(TargetBase, ClearBase, GenBase): else: self.settings["action_sequence"].append("remove_autoresume") self.settings["action_sequence"].append("remove_chroot") + return def set_use(self): if self.settings["spec_prefix"]+"/use" in self.settings: @@ -1321,11 +1325,12 @@ class StageBase(TargetBase, ClearBase, GenBase): self.purge() return - if "PURGEONLY" in self.settings: + if "purgeonly" in self.settings["options"]: + print "StageBase: run() purgeonly" self.purge() - return if "purge" in self.settings["options"]: + print "StageBase: run() purge" self.purge() for x in self.settings["action_sequence"]:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/arch/
commit: 2091f3e3c2fee8d6ccf0f322b9dfbc461ba26e5c Author: Joshua Kinard gentoo org> AuthorDate: Tue Feb 10 11:57:18 2015 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 28 02:37:50 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=2091f3e3 arch/mips.py: update MIPS targets Signed-off-by: Anthony G. Basile gentoo.org> catalyst/arch/mips.py | 96 --- 1 file changed, 69 insertions(+), 27 deletions(-) diff --git a/catalyst/arch/mips.py b/catalyst/arch/mips.py index 5297a4b..5416d22 100644 --- a/catalyst/arch/mips.py +++ b/catalyst/arch/mips.py @@ -35,6 +35,12 @@ class arch_mips1(generic_mips): generic_mips.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=mips1 -mabi=32 -mplt -pipe" +class arch_mips2(generic_mips): + "Builder class for MIPS II [Big-endian]" + def __init__(self,myspec): + generic_mips.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=mips2 -mabi=32 -mplt -pipe" + class arch_mips32(generic_mips): "Builder class for MIPS 32 [Big-endian]" def __init__(self,myspec): @@ -133,6 +139,30 @@ class arch_mips4_r10k_multilib(generic_mips64): generic_mips64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=r10k -mplt -pipe" +class arch_mips4_r12k(generic_mips): + "Builder class for MIPS IV R12k/R14k/R16k [Big-endian]" + def __init__(self,myspec): + generic_mips.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=r12k -mno-fix-r1 -mabi=32 -mplt -pipe" + +class arch_mips4_r12k_n32(generic_mips64): + "Builder class for MIPS IV R12k/R14k/R16k [Big-endian N32]" + def __init__(self,myspec): + generic_mips64.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=r12k -mno-fix-r1 -mabi=n32 -mplt -pipe" + +class arch_mips4_r12k_n64(generic_mips64): + "Builder class for MIPS IV R12k/R14k/R16k [Big-endian N64]" + def __init__(self,myspec): + generic_mips64.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=r12k -mno-fix-r1 -mabi=64 -pipe" + +class arch_mips4_r12k_multilib(generic_mips64): + "Builder class for MIPS IV R12k/R14k/R16k [Big-endian multilib]" + def __init__(self,myspec): + generic_mips64.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=r12k -mno-fix-r1 -mplt -pipe" + class arch_mips64(generic_mips): "Builder class for MIPS 64 [Big-endian]" def __init__(self,myspec): @@ -187,6 +217,12 @@ class arch_mipsel1(generic_mipsel): generic_mipsel.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=mips1 -mabi=32 -mplt -pipe" +class arch_mipsel2(generic_mipsel): + "Builder class for MIPS II [Little-endian]" + def __init__(self,myspec): + generic_mipsel.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=mips2 -mabi=32 -mplt -pipe" + class arch_mips32el(generic_mipsel): "Builder class for MIPS 32 [Little-endian]" def __init__(self,myspec): @@ -398,66 +434,72 @@ class arch_cobalt_n32(generic_mips64el): def register(): "Inform main catalyst program of the contents of this plugin." return ({ - "cobalt": arch_cobalt, + "cobalt": arch_cobalt, "cobalt_n32": arch_cobalt_n32, - "mips" : arch_mips1, - "mips1" : arch_mips1, - "mips32": arch_mips32, + "mips" : arch_mips1, + "mips1" : arch_mips1, + "mips2" : arch_mips2, + "mips32": arch_mips32, "mips32_softfloat" : arch_mips32_softfloat, - "mips32r2" : arch_mips32r2, - "mips32r2_softfloat": arch_mips32r2_softfloat, - "mips3" : arch_mips3, - "mips3_n32" : arch_mips3_n32, - "mips3_n64" : arch_mips3_n64, + "mips32r2" : arch_mips32r2, + "mips32r2_softfloat": arch_mips32r2_softfloat, + "mips3" : arch_mips3, + "mips3_n32" : arch_mips3_n32, + "mips3_n64"
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: e458b1d4d8c05da72702ba8e9a71028c9a5c9e0e Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) gentoo org> AuthorDate: Fri Dec 19 01:16:15 2014 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 28 02:32:47 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e458b1d4 Continue commit 2fea87234ffc48c3dd96f1204b27f667f5ade3a3 as we need to use --xattr-include when extracting the stages. Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) gentoo.org> catalyst/base/stagebase.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 4d9ff0d..dee947f 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -696,10 +696,10 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["chroot_path"]+\ " (This may take some time) ...\n" if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] else: - unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] error_msg="Tarball extraction of "+\ self.settings["source_path"]+" to "+\ @@ -711,10 +711,10 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["chroot_path"]+\ " (This may take some time) ...\n" if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] else: - unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ self.settings["chroot_path"] error_msg="Tarball extraction of "+self.settings["source_path"]+\ " to "+self.settings["chroot_path"]+" failed." @@ -806,9 +806,9 @@ class StageBase(TargetBase, ClearBase, GenBase): "catalyst-hash") destdir=self.settings["snapshot_cache_path"] if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir else: - unpack_cmd="tar --xattrs --acls -xpf "+self.settings["snapshot_path"]+" -C "+destdir + unpack_cmd="tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --acls --selinux -xpf "+self.settings["snapshot_path"]+" -C "+destdir unpack_errmsg="Error unpacking snapshot" cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\ self.settings["snapshot_cache_path"]+\ @@ -825,10 +825,10 @@ class StageBase(TargetBase, ClearBase, GenBase): cleanup_msg=\ "Cleaning up existing portage tree (This can take a long time)..." if "bz2" == self.settings["chroot_path"][-3:]: - unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+\ + unpack_cmd="tar --xattrs --xattrs-include=secur
[gentoo-commits] proj/catalyst:pending commit in: /, catalyst/
commit: 8ff2ab743613f6497fa2e4b9f703a3550c464d36 Author: Brian Dolbec gentoo org> AuthorDate: Thu Jun 6 15:57:41 2013 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Feb 26 23:31:08 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=8ff2ab74 Add set_version command to setup.py. * Add/modify functions to save and retrieve the set version information or the live git version. * Change indent to tabs. catalyst/__init__.py | 8 +++- catalyst/version.py | 44 +--- setup.py | 34 -- 3 files changed, 80 insertions(+), 6 deletions(-) diff --git a/catalyst/__init__.py b/catalyst/__init__.py index 43a75d6..7bc2897 100644 --- a/catalyst/__init__.py +++ b/catalyst/__init__.py @@ -1,4 +1,10 @@ "Catalyst is the release building tool used by Gentoo Linux" -__version__ = '2.0.16' __maintainer__ = 'Catalyst ' + +try: + from .verinfo import version as fullversion + __version__ = fullversion.split('\n')[0].split()[1] +except ImportError: + from .version import get_version, __version__ + fullversion = get_version(reset=True) diff --git a/catalyst/version.py b/catalyst/version.py index ea12761..8060bff 100644 --- a/catalyst/version.py +++ b/catalyst/version.py @@ -8,14 +8,52 @@ '''Version information and/or git version information ''' +import os + from snakeoil.version import format_version __version__="rewrite-git" _ver = None -def get_version(): + +def get_git_version(version=__version__): """Return: a string describing our version.""" global _ver - if _ver is None: - _ver = format_version('catalyst',__file__, __version__) + _ver = format_version('catalyst',__file__, version) return _ver + + +def get_version(reset=False): + '''Returns a saved release version string or the + generated git release version. + ''' + global __version__, _ver + if _ver and not reset: + return _ver + try: # getting the fixed version + from .verinfo import version + _ver = version + __version__ = version.split('\n')[0].split()[1] + except ImportError: # get the live version + version = get_git_version() + return version + + + +def set_release_version(version, root=None): + '''Saves the release version along with the + git log release information + + @param version: string + @param root: string, optional alternate root path to save to + ''' + #global __version__ + filename = "verinfo.py" + if not root: + path = os.path.join(os.path.dirname(__file__), filename) + else: + path = os.path.join(root, filename) + #__version__ = version + ver = get_git_version(version) + with open(path, 'w') as f: + f.write("version = {0!r}".format(ver)) diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index a412d48..5913bae --- a/setup.py +++ b/setup.py @@ -1,11 +1,14 @@ -"Catalyst is the release building tool used by Gentoo Linux" +"""Catalyst is a release building tool used by Gentoo Linux""" + import codecs as _codecs -from distutils.core import setup as _setup +from distutils.core import setup as _setup, Command as _Command from email.utils import parseaddr as _parseaddr import os as _os from catalyst import __version__, __maintainer__ +from catalyst.version import set_release_version as _set_release_version +from catalyst.version import get_version as _get_version _this_dir = _os.path.dirname(__file__) @@ -49,6 +52,30 @@ _data_files.extend(_files('livecd', 'lib/catalyst/')) _data_files.extend(_files('targets', 'lib/catalyst/')) +class set_version(_Command): + '''Saves the specified release version information + ''' + global __version__ + description = "hardcode script's version using VERSION from environment" + user_options = [] # [(long_name, short_name, desc),] + + def initialize_options (self): + pass + + def finalize_options (self): + pass + + def run(self): + try: + version = _os.environ['VERSION'] + except KeyError: + print("Try setting 'VERSION=x.y.z' on the command line... Aborting") + return + _set_release_version(version) + __version__ = _get_version() + print("Version set to:\n", __version__) + + _setup( name=_package_name, version=__version__, @@ -82,4 +109,7 @@ _setup( ], data_files=_data_files, provides=[_package_name], + cmdclass={ + 'set_version': set_version + }, )
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: 124c29ecc7aeb0311fc8e6149196476b580ae735 Author: Brian Dolbec gentoo org> AuthorDate: Sat Mar 1 16:58:24 2014 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Feb 26 22:57:52 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=124c29ec catalyst/base/clearbase.py: Fix remove parameter mistakes. fixes commit: 02b3cb7a8d5c9d8d21105feda6868080416721c1 Add remove_chroot and remove_autoresume functions. Brian Dolbec gentoo.org> (Tue 31 Dec 2013 01:04:29 AM PST) catalyst/base/clearbase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalyst/base/clearbase.py b/catalyst/base/clearbase.py index a9f1d22..b2c1a11 100644 --- a/catalyst/base/clearbase.py +++ b/catalyst/base/clearbase.py @@ -55,10 +55,10 @@ class ClearBase(object): if any(k in self.settings["options"] for k in ("purge", "purgeonly", "purgetmponly")): print "purge(); clearing autoresume ..." - self.clear_autoresume(remove) + self.clear_autoresume() print "purge(); clearing chroot ..." - self.clear_chroot(remove) + self.clear_chroot() if "purgetmponly" not in self.settings["options"]: print "purge(); clearing package cache ..."
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/
commit: b0e858758ed20aa79045e282b96229320170aeb9 Author: Guy Martin gentoo org> AuthorDate: Wed Feb 5 10:40:01 2014 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Feb 27 02:03:04 2015 + URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b0e85875 Allow kernelopts as a valid value for kernels. catalyst/base/stagebase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 191baab..c94f6b6 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -616,6 +616,7 @@ class StageBase(TargetBase, ClearBase, GenBase): self.valid_values.append("boot/kernel/"+x+"/softlevel") self.valid_values.append("boot/kernel/"+x+"/use") self.valid_values.append("boot/kernel/"+x+"/packages") + self.valid_values.append("boot/kernel/"+x+"/kernelopts") if "boot/kernel/"+x+"/packages" in addlargs: if type(addlargs["boot/kernel/"+x+\ "/packages"])==types.StringType:
[gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/
commit: 2f8312854d9fac7476f8f972660824941dc4c852 Author: Brian Dolbec gentoo org> AuthorDate: Mon Dec 30 21:19:28 2013 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Feb 26 20:08:06 2015 + URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=2f831285 Move some duplicate code to fileops, extend it's capability to not re-make the directory. --- catalyst/base/clearbase.py | 71 +++--- catalyst/base/resume.py| 26 - catalyst/fileops.py| 43 +++- 3 files changed, 70 insertions(+), 70 deletions(-) diff --git a/catalyst/base/clearbase.py b/catalyst/base/clearbase.py index 0ebe299..e38b1a8 100644 --- a/catalyst/base/clearbase.py +++ b/catalyst/base/clearbase.py @@ -5,7 +5,7 @@ from stat import ST_UID, ST_GID, ST_MODE from catalyst.support import cmd, countdown -from catalyst.fileops import ensure_dirs +from catalyst.fileops import ensure_dirs, clear_dir class ClearBase(object): """ @@ -16,68 +16,43 @@ class ClearBase(object): self.resume = None - def clear_autoresume(self): + def clear_autoresume(self, remove=False): """ Clean resume points since they are no longer needed """ if "autoresume" in self.settings["options"]: print "Removing AutoResume Points: ..." self.resume.clear_all() - def clear_chroot(self): + def clear_chroot(self, remove=False): print 'Clearing the chroot path ...' - self.clear_dir(self.settings["chroot_path"], 0755, True) + clear_dir(self.settings["chroot_path"], 0755, True, remove) - def clear_packages(self): + def clear_packages(self, remove=False): if "pkgcache" in self.settings["options"]: print "purging the pkgcache ..." - self.clear_dir(self.settings["pkgcache_path"]) + clear_dir(self.settings["pkgcache_path"], remove=remove) - def clear_kerncache(self): + def clear_kerncache(self, remove=False): if "kerncache" in self.settings["options"]: print "purging the kerncache ..." - self.clear_dir(self.settings["kerncache_path"]) + clear_dir(self.settings["kerncache_path"], remove=remove) - def purge(self): + def purge(self, remove=False): countdown(10,"Purging Caches ...") - if any(k in self.settings["options"] for k in ("purge","purgeonly","purgetmponly")): - print "clearing autoresume ..." - self.clear_autoresume() - - print "clearing chroot ..." - self.clear_chroot() - - if "PURGETMPONLY" not in self.settings: - print "clearing package cache ..." - self.clear_packages() - - print "clearing kerncache ..." - self.clear_kerncache() - - - def clear_dir(self, myemp, mode=0755, chg_flags=False): - '''Universal directory clearing function - ''' - if not myemp: - return False - if os.path.isdir(myemp): - print "Emptying directory" , myemp - """ - stat the dir, delete the dir, recreate the dir and set - the proper perms and ownership - """ - try: - mystat=os.stat(myemp) - """ There's no easy way to change flags recursively in python """ - if chg_flags and os.uname()[0] == "FreeBSD": - os.system("chflags -R noschg " + myemp) - shutil.rmtree(myemp) - ensure_dirs(myemp, mode=mode) - os.chown(myemp,mystat[ST_UID],mystat[ST_GID]) - os.chmod(myemp,mystat[ST_MODE]) - except Exception as e: - print CatalystError("clear_dir(); Exeption: %s" % str(e)) - return False - return True + if any(k in self.settings["options"] for k in ("purge", + "purgeonly", "purgetmponly")): + print "purge(); clearing autoresume ..." + self.clear_autoresume(remove) + + print "purge(); clearing chroot ..." + self.clear_chroot(remove) + + if "purgetmponly" not in self.settings["options"]: + print "purge(); clear
[gentoo-commits] proj/catalyst:pending commit in: catalyst/
commit: 83c4337f59102245d6018810db5bb79f471b002f Author: W. Trevor King tremily us> AuthorDate: Tue Jun 11 21:41:18 2013 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Feb 26 19:56:51 2015 + URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=83c4337f version: Remove shebang (Python modules are not scripts) Nobody should be executing this file directly. --- catalyst/version.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/catalyst/version.py b/catalyst/version.py index 03c77e4..ea12761 100644 --- a/catalyst/version.py +++ b/catalyst/version.py @@ -1,5 +1,3 @@ -#!/usr/bin/python -OO - # Maintained in full by: # Catalyst Team # Release Engineering Team