commit: 264f30494cde1eb44aae89a9872bf12936856252 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Sat Jan 4 01:04:10 2014 +0000 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> CommitDate: Wed Apr 2 20:04:24 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=264f3049
Move generic_stage_targets.py constants to defaults.py Rename the source and target mounts defaults to remove the double plural. --- catalyst/defaults.py | 27 +++++++++++++++++++++++++ catalyst/targets/generic_stage_target.py | 34 ++++---------------------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index b1dbda4..748d1dd 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -21,3 +21,30 @@ valid_config_file_values.extend(["PKGCACHE", "KERNCACHE", "CCACHE", "DISTCC", verbosity = 1 +PORT_LOGDIR_CLEAN = \ + 'find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete' + +TARGET_MOUNT_DEFAULTS = { + "ccache": "/var/tmp/ccache", + "dev": "/dev", + "devpts": "/dev/pts", + "distdir": "/usr/portage/distfiles", + "icecream": "/usr/lib/icecc/bin", + "kerncache": "/tmp/kerncache", + "packagedir": "/usr/portage/packages", + "portdir": "/usr/portage", + "port_tmpdir": "/var/tmp/portage", + "port_logdir": "/var/log/portage", + "proc": "/proc", + "shm": "/dev/shm", + } + +SOURCE_MOUNT_DEFAULTS = { + "dev": "/dev", + "devpts": "/dev/pts", + "distdir": "/usr/portage/distfiles", + "portdir": "/usr/portage", + "port_tmpdir": "tmpfs", + "proc": "/proc", + "shm": "shmfs", + } diff --git a/catalyst/targets/generic_stage_target.py b/catalyst/targets/generic_stage_target.py index de4842c..05c61e8 100644 --- a/catalyst/targets/generic_stage_target.py +++ b/catalyst/targets/generic_stage_target.py @@ -4,34 +4,8 @@ from generic_target import * from stat import * from catalyst.lock import LockDir - -PORT_LOGDIR_CLEAN = \ - 'find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete' - -TARGET_MOUNTS_DEFAULTS = { - "ccache": "/var/tmp/ccache", - "dev": "/dev", - "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", - "icecream": "/usr/lib/icecc/bin", - "kerncache": "/tmp/kerncache", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", - "port_tmpdir": "/var/tmp/portage", - "port_logdir": "/var/log/portage", - "proc": "/proc", - "shm": "/dev/shm", - } - -SOURCE_MOUNTS_DEFAULTS = { - "dev": "/dev", - "devpts": "/dev/pts", - "distdir": "/usr/portage/distfiles", - "portdir": "/usr/portage", - "port_tmpdir": "tmpfs", - "proc": "/proc", - "shm": "shmfs", - } +from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, + PORT_LOGDIR_CLEAN) # for convienience pjoin = os.path.join @@ -208,11 +182,11 @@ class generic_stage_target(generic_target): """ Setup our mount points """ # initialize our target mounts. - self.target_mounts = TARGET_MOUNTS_DEFAULTS.copy() + self.target_mounts = TARGET_MOUNT_DEFAULTS.copy() self.mounts = ["proc", "dev", "portdir", "distdir", "port_tmpdir"] # initialize our source mounts - self.mountmap = SOURCE_MOUNTS_DEFAULTS.copy() + self.mountmap = SOURCE_MOUNT_DEFAULTS.copy() # update them from settings self.mountmap["distdir"] = self.settings["distdir"] if "SNAPCACHE" not in self.settings: