public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/
@ 2015-06-15 20:25 Brian Dolbec
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2015-06-15 20:25 UTC (permalink / raw
  To: gentoo-commits

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!"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/
@ 2015-09-03 15:14 Brian Dolbec
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2015-09-03 15:14 UTC (permalink / raw
  To: gentoo-commits

commit:     171e7e154c2629d85cd9979bd31f03d639fe8182
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: Thu Sep  3 15:12:38 2015 +0000
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,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!"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/
@ 2015-09-06 21:18 Brian Dolbec
  2015-09-06 21:21 ` [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/, catalyst/targets/ Brian Dolbec
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Dolbec @ 2015-09-06 21:18 UTC (permalink / raw
  To: gentoo-commits

commit:     99e9ceabe0532f5fb1b12ab55d35097b5be3cfa8
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: Sun Sep  6 21:18:00 2015 +0000
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,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!"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/, catalyst/targets/
  2015-09-06 21:18 [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/ Brian Dolbec
@ 2015-09-06 21:21 ` Brian Dolbec
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2015-09-06 21:21 UTC (permalink / raw
  To: gentoo-commits

commit:     99e9ceabe0532f5fb1b12ab55d35097b5be3cfa8
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: Sun Sep  6 21:18:00 2015 +0000
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,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!"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-06 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-06 21:18 [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/, catalyst/base/ Brian Dolbec
2015-09-06 21:21 ` [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/, catalyst/targets/ Brian Dolbec
  -- 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-06-15 20:25 Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox