From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1B2D1138CE8 for ; Mon, 15 Jun 2015 20:25:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B0103E0837; Mon, 15 Jun 2015 20:25:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4BEC3E0837 for ; Mon, 15 Jun 2015 20:25:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 69D26340DD3 for ; Mon, 15 Jun 2015 20:25:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C0C2FA40 for ; Mon, 15 Jun 2015 20:25:00 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1434386009.89c0fa2a9b1d79c726d25d8fc73fbd8b90587db0.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/genbase.py catalyst/base/stagebase.py catalyst/main.py catalyst/targets/snapshot.py X-VCS-Directories: catalyst/base/ catalyst/ catalyst/targets/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 89c0fa2a9b1d79c726d25d8fc73fbd8b90587db0 X-VCS-Branch: pending Date: Mon, 15 Jun 2015 20:25:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 01aba7c4-f2e4-4195-8a21-359a3e4ff931 X-Archives-Hash: 239d67127d3626af22538d02f3ccd11b commit: 89c0fa2a9b1d79c726d25d8fc73fbd8b90587db0 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 15 16:33:29 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Mon Jun 15 16:33:29 2015 +0000 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"] = normpath(st + "/snapshots/" + self.settings["snapshot_name"] - + self.settings["version_stamp"] + ".tar.bz2") + + self.settings["version_stamp"]) self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"]) def setup(self): @@ -51,18 +54,31 @@ class snapshot(TargetBase, GenBase): mytmp=self.settings["tmp_path"] ensure_dirs(mytmp) + target_snapshot = self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"] cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " + "--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " + - self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"], + target_snapshot, "Snapshot failure", env=self.env) print "Compressing Portage snapshot tarball..." - cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " + - mytmp + " " + self.settings["repo_name"], - "Snapshot creation failure",env=self.env) - - self.gen_contents_file(self.settings["snapshot_path"]) - self.gen_digest_file(self.settings["snapshot_path"]) + compressor = CompressMap(self.settings["compress_definitions"], + env=self.env, default_mode=self.settings['compression_mode']) + infodict = compressor.create_infodict( + source=self.settings["repo_name"], + destination=self.settings["snapshot_path"], + basedir=mytmp, + filename=self.settings["snapshot_path"], + mode=self.settings["compression_mode"], + auto_extension=True + ) + if not compressor.compress(infodict): + print("Snapshot compression failure") + else: + filename = '.'.join([self.settings["snapshot_path"], + compressor.extension(self.settings["compression_mode"])]) + print("COMPRESSOR success!!!! filename", filename) + self.gen_contents_file(filename) + self.gen_digest_file(filename) self.cleanup() print "snapshot: complete!"