From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/
Date: Mon, 15 Jun 2015 20:25:00 +0000 (UTC) [thread overview]
Message-ID: <1434386009.89c0fa2a9b1d79c726d25d8fc73fbd8b90587db0.dolsen@gentoo> (raw)
commit: 89c0fa2a9b1d79c726d25d8fc73fbd8b90587db0
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 15 16:33:29 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> 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!"
next reply other threads:[~2015-06-15 20:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-15 20:25 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-09-03 15:14 [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/ Brian Dolbec
2015-09-06 21:18 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1434386009.89c0fa2a9b1d79c726d25d8fc73fbd8b90587db0.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox