public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
  2015-01-01  5:59 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
@ 2015-02-26  4:12 ` Brian Dolbec
  0 siblings, 0 replies; 14+ messages in thread
From: Brian Dolbec @ 2015-02-26  4:12 UTC (permalink / raw
  To: gentoo-commits

commit:     6f01be26fb22e2b9c89453f9a4d2eeba2babf6e6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 08:39:18 2013 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Jan  1 05:58:06 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=6f01be26

Rename a make.conf key to make_conf due to bash variable name restrictions

---
 catalyst/base/stagebase.py | 10 +++++-----
 catalyst/defaults.py       |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index b44a957..96b1c19 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1020,7 +1020,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 	def chroot_setup(self):
 		self.makeconf=read_makeconf(normpath(self.settings["chroot_path"]+
-			self.settings["make.conf"]))
+			self.settings["make_conf"]))
 		self.override_cbuild()
 		self.override_chost()
 		self.override_cflags()
@@ -1068,7 +1068,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			""" Modify and write out make.conf (for the chroot) """
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("rm -f " + makepath,\
 				"Could not remove " + makepath, env=self.env)
 			myf=open(makepath, "w")
@@ -1122,9 +1122,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			myf.close()
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("cp " + makepath + " " + makepath + ".catalyst",\
-				"Could not backup " + self.settings["make.conf"],env=self.env)
+				"Could not backup " + self.settings["make_conf"],env=self.env)
 			touch(self.settings["autoresume_path"]+"chroot_setup")
 
 	def fsscript(self):
@@ -1172,7 +1172,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			cmd("rm -rf " + self.settings["chroot_path"] + self.settings["local_overlay"],
 				"Could not remove " + self.settings["local_overlay"], env=self.env)
 			cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
-				"/etc/portage/make.conf",\
+				self.settings["make_conf"],\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
 
 		""" Clean up old and obsoleted files in /etc """

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index ce7e919..2839a3d 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,8 +25,8 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
-	"make.conf": "/etc/portage/make.conf",
-	"options": "",
+	"make_conf": "/etc/portage/make.conf",
+	"options": set(),
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"port_tmpdir": "/var/tmp/portage",


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
  2015-01-01  5:59 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
@ 2015-02-26 20:12 ` Brian Dolbec
  0 siblings, 0 replies; 14+ messages in thread
From: Brian Dolbec @ 2015-02-26 20:12 UTC (permalink / raw
  To: gentoo-commits

commit:     a519c380faabe8278863d4615e24194d17c78c75
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 25 03:52:44 2013 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Jan  1 05:58:06 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=a519c380

Fix typo in error message, clean up useless tracebacks

Remove useless python tracebacks for bash side target failures.

Conflicts:
	catalyst/main.py

---
 catalyst/base/stagebase.py | 2 +-
 catalyst/main.py           | 2 --
 catalyst/support.py        | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index c16ef86..3056ce2 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1296,7 +1296,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			except CatalystError:
 				self.unbind()
 				raise CatalystError("Stage build aborting due to error.",
-					print_traceback=True)
+					print_traceback=False)
 
 	def setup_environment(self):
 		"""

diff --git a/catalyst/main.py b/catalyst/main.py
index 56e57c6..7fea4e7 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -163,8 +163,6 @@ def build_target(addlargs):
 	try:
 		target.run()
 	except:
-		print "Target run() exception:  Python traceback output follows:"
-		catalyst.util.print_traceback()
 		print "!!! catalyst: Error encountered during run of target " + \
 			addlargs["target"]
 		sys.exit(1)

diff --git a/catalyst/support.py b/catalyst/support.py
index 8c4876f..8f2e5df 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -90,7 +90,7 @@ class CatalystError(Exception):
 				(type,value)=sys.exc_info()[:2]
 				if value!=None:
 					print
-					print "Traceback valuse found.  listing..."
+					print "Traceback values found.  listing..."
 					print traceback.print_exc(file=sys.stdout)
 			print
 			print "!!! catalyst: "+message


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
  2015-09-08 14:14 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
@ 2015-09-08 14:17 ` Brian Dolbec
  0 siblings, 0 replies; 14+ messages in thread
From: Brian Dolbec @ 2015-09-08 14:17 UTC (permalink / raw
  To: gentoo-commits

commit:     7536857c1a14d2eec224e80ba96ab9f3091e0d1c
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  8 00:35:41 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Sep  8 14:11:48 2015 +0000
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,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			else:
 				""" SEEDCACHE is a not a directory, try untar'ing """
 				print "Referenced SEEDCACHE does not appear to be a directory, trying to untar..."
-				unpack_info['mode'] = self.decompressor.determine_mode(
-						self.settings["source_path"])
+				unpack_info['source'] = file_check(unpack_info['source'])
 		else:
 			""" No SEEDCACHE, use tar """
-			unpack_info['mode'] = self.decompressor.determine_mode(
-					unpack_info["source"])
+			unpack_info['source'] = file_check(unpack_info['source'])
 		# endif "seedcache"
 
 		if "autoresume" in self.settings["options"]:
@@ -742,19 +731,23 @@ class StageBase(TargetBase, ClearBase, GenBase):
 				and self.settings["source_path_hash"]==clst_unpack_hash:
 				""" Autoresume is valid, tarball is valid """
 				_unpack=False
-				invalid_snapshot=True
+				invalid_snapshot=False
 
 			elif os.path.isdir(self.settings["source_path"]) \
 				and self.resume.is_disabled("unpack"):
 				""" Autoresume is invalid, SEEDCACHE """
 				_unpack=True
-				invalid_snapshot=False
+				invalid_snapshot=True
+				# check and reset the unpack_info['source']
+				unpack_info['source'] = file_check(unpack_info['source'])
 
 			elif os.path.isfile(self.settings["source_path"]) \
 				and self.settings["source_path_hash"]!=clst_unpack_hash:
 				""" Autoresume is invalid, tarball """
 				_unpack=True
 				invalid_snapshot=True
+				unpack_info['source'] = file_check(unpack_info['source'])
+
 		else:
 			""" No autoresume, SEEDCACHE """
 			if "seedcache" in self.settings["options"]:

diff --git a/catalyst/support.py b/catalyst/support.py
index 2ac4816..b6705c9 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -1,4 +1,5 @@
 
+import glob
 import sys
 import string
 import os
@@ -144,6 +145,25 @@ def cmd(mycmd, myexc="", env={}, debug=False, fail_func=None):
 			print_traceback=False)
 
 
+def file_check(filepath):
+	'''Check for the files existence and that only one exists
+	if others are found with various extensions
+	'''
+	if os.path.exists(filepath):
+		return filepath
+	# it didn't exist
+	# so check if there are files of that name with an extension
+	files = glob.glob("%s.*" % filepath)
+	# remove any false positive files
+	files = [x for x in files if not x.endswith(".CONTENTS") and not x.endswith(".DIGESTS")]
+	if len(files) is 1:
+		return files[0]
+	elif len(files) > 1:
+		msg = "Ambiguos Filename: %s\nPlease specify the correct extension as well" % filepath
+		raise CatalystError(msg, print_traceback=False)
+	raise CatalystError("File Not Found: %s" % filepath)
+
+
 def file_locate(settings,filelist,expand=1):
 	#if expand=1, non-absolute paths will be accepted and
 	# expanded to os.getcwd()+"/"+localpath if file exists
@@ -186,6 +206,7 @@ defined are not preserved. In other words, "foo", "bar", "oni" ordering is prese
 """,
 					print_traceback=True)
 
+
 def parse_makeconf(mylines):
 	mymakeconf={}
 	pos=0


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2015-10-08 20:02 Brian Dolbec
  0 siblings, 0 replies; 14+ messages in thread
From: Brian Dolbec @ 2015-10-08 20:02 UTC (permalink / raw
  To: gentoo-commits

commit:     080eab6b951ada8e6b982a71a4ff701241d7caee
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  8 19:33:17 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Oct  8 19:34:07 2015 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=080eab6b

Fix argparse conversion breakage for verbose and debug settings

Argparse always defines the target variable.
Convert the use of them to normal assignment rather than a member inclusion test.

 catalyst/base/genbase.py |  6 +++---
 catalyst/lock.py         | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py
index a163638..32459b4 100644
--- a/catalyst/base/genbase.py
+++ b/catalyst/base/genbase.py
@@ -26,7 +26,7 @@ class GenBase(object):
 					array.sort()
 				for j in array:
 					contents = contents_map.contents(path, j,
-						verbose="VERBOSE" in self.settings)
+						verbose=self.settings["VERBOSE"])
 					if contents:
 						myf.write(contents)
 				myf.close()
@@ -49,12 +49,12 @@ class GenBase(object):
 						if "all" in array:
 							for k in list(hash_map.hash_map):
 								digest = hash_map.generate_hash(f,hash_=k,
-									verbose = "VERBOSE" in self.settings)
+									verbose=self.settings["VERBOSE"])
 								myf.write(digest)
 						else:
 							for j in array:
 								digest = hash_map.generate_hash(f,hash_=j,
-									verbose = "VERBOSE" in self.settings)
+									verbose=self.settings["VERBOSE"])
 								myf.write(digest)
 				myf.close()
 

diff --git a/catalyst/lock.py b/catalyst/lock.py
index 3d50c06..8095a82 100644
--- a/catalyst/lock.py
+++ b/catalyst/lock.py
@@ -71,7 +71,7 @@ class LockDir(object):
 
 	def set_gid(self,gid):
 		if not self.islocked():
-#			if "DEBUG" in self.settings:
+#			if self.settings["DEBUG"]:
 #				print "setting gid to", gid
 			self.gid=gid
 
@@ -83,7 +83,7 @@ class LockDir(object):
 				if lockdir[-1] == "/":
 					lockdir=lockdir[:-1]
 				self.lockdir=normpath(lockdir)
-#				if "DEBUG" in self.settings:
+#				if self.settings["DEBUG"]:
 #					print "setting lockdir to", self.lockdir
 		else:
 			raise "the lock object needs a path to a dir"
@@ -91,13 +91,13 @@ class LockDir(object):
 	def set_lockfilename(self,lockfilename):
 		if not self.islocked():
 			self.lockfilename=lockfilename
-#			if "DEBUG" in self.settings:
+#			if self.settings["DEBUG"]:
 #				print "setting lockfilename to", self.lockfilename
 
 	def set_lockfile(self):
 		if not self.islocked():
 			self.lockfile=normpath(self.lockdir+'/'+self.lockfilename)
-#			if "DEBUG" in self.settings:
+#			if self.settings["DEBUG"]:
 #				print "setting lockfile to", self.lockfile
 
 	def read_lock(self):
@@ -222,7 +222,7 @@ class LockDir(object):
 						os.unlink(self.lockfile)
 						os.close(self.myfd)
 						self.myfd=None
-#						if "DEBUG" in self.settings:
+#						if self.settings["DEBUG"]:
 #							print "Unlinked lockfile..."
 				except Exception, e:
 					# We really don't care... Someone else has the lock.
@@ -269,7 +269,7 @@ class LockDir(object):
 			try:
 				os.link(self.myhardlock, self.lockfile)
 			except Exception:
-#				if "DEBUG" in self.settings:
+#				if self.settings["DEBUG"]:
 #					print "lockfile(): Hardlink: Link failed."
 #					print "Exception: ",e
 				pass


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2016-03-21  5:15 Mike Frysinger
  0 siblings, 0 replies; 14+ messages in thread
From: Mike Frysinger @ 2016-03-21  5:15 UTC (permalink / raw
  To: gentoo-commits

commit:     1016f0f3e15eb6a4e7cd203a35554d8c335e3e0a
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 21 05:14:48 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 21 05:14:48 2016 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1016f0f3

lint: clean up a few minor warnings

Should be no real functional changes here.

 catalyst/base/stagebase.py | 3 ---
 catalyst/main.py           | 4 +---
 catalyst/support.py        | 3 +--
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 98c4959..9d3841c 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -5,9 +5,6 @@ import shutil
 import sys
 from stat import ST_UID, ST_GID, ST_MODE
 
-# for convienience
-pjoin = os.path.join
-
 from snakeoil import fileutils
 
 from DeComp.compress import CompressMap

diff --git a/catalyst/main.py b/catalyst/main.py
index 5b6b9ac..7c6a5d8 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -13,8 +13,6 @@ import sys
 
 from snakeoil import process
 
-__selfpath__ = os.path.abspath(os.path.dirname(__file__))
-
 from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS,
 	CONTENTS_DEFINITIONS)
 from DeComp.contents import ContentsMap
@@ -63,7 +61,7 @@ def parse_config(config_files):
 			conf_values[x]=confdefaults[x]
 
 	# add our python base directory to use for loading target arch's
-	conf_values["PythonDir"] = __selfpath__
+	conf_values["PythonDir"] = os.path.dirname(os.path.realpath(__file__))
 
 	# print out any options messages
 	for opt in conf_values['options']:

diff --git a/catalyst/support.py b/catalyst/support.py
index 4efe96c..d13422d 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -21,8 +21,7 @@ def list_bashify(mylist):
 		# surround args with quotes for passing to bash,
 		# allows things like "<" to remain intact
 		mypack[x]="'"+mypack[x]+"'"
-	mypack = ' '.join(mypack)
-	return mypack
+	return ' '.join(mypack)
 
 
 class CatalystError(Exception):


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2016-03-23 16:38 Brian Dolbec
  0 siblings, 0 replies; 14+ messages in thread
From: Brian Dolbec @ 2016-03-23 16:38 UTC (permalink / raw
  To: gentoo-commits

commit:     0579e46fa1937c89cbc69a21a9596dadda5672eb
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 23 16:30:51 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Mar 23 16:36:45 2016 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=0579e46f

Fix commit 444e50e710f1  where I inaddvertently deleted the wrong paramter during the commit

Also change the default (de)compression mode and search order to the non _x variant.

 catalyst/base/stagebase.py | 2 +-
 catalyst/defaults.py       | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 9d3841c..fe5e6d2 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1271,7 +1271,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		if not self.compressor:
 			self.compressor = CompressMap(self.settings["compress_definitions"],
 				env=self.env, default_mode=self.settings['compression_mode'],
-				logger=log)
+				comp_prog=self.settings['comp_prog'])
 
 		if "autoresume" in self.settings["options"] \
 			and self.resume.is_enabled("capture"):

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 8b413f7..5ed19d1 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -33,10 +33,10 @@ valid_config_file_values.extend([ "distcc", "envscript",
 confdefaults={
 	"archdir": "%(PythonDir)s/arch",
 	"comp_prog": COMPRESSOR_PROGRAM_OPTIONS[TAR],
-	"compression_mode": 'lbzip2_x',
+	"compression_mode": 'lbzip2',
 	"compressor_arch": None,
 	"compressor_options": XATTRS_OPTIONS[TAR],
-	"decompressor_search_order": DECOMPRESSOR_XATTR_SEARCH_ORDER,
+	"decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER,
 	"distdir": "/usr/portage/distfiles",
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2016-05-22  3:34 Mike Frysinger
  0 siblings, 0 replies; 14+ messages in thread
From: Mike Frysinger @ 2016-05-22  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     125ca190d30215de85fc3343c95784e658f75c37
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri May 20 05:43:14 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri May 20 05:43:14 2016 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=125ca190

replace os.system with cmd

Use the existing cmd() helper for running external programs.

 catalyst/base/stagebase.py | 11 ++++++-----
 catalyst/fileops.py        |  4 ++--
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index f0f3ba9..6695ac4 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -967,16 +967,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			if not ismount(target):
 				continue
 
-			retval=os.system("umount " + target)
-
-			if retval!=0:
+			try:
+				cmd(['umount', target])
+			except CatalystError:
 				log.warning('First attempt to unmount failed: %s', target)
 				log.warning('Killing any pids still running in the chroot')
 
 				self.kill_chroot_pids()
 
-				retval2 = os.system("umount " + target)
-				if retval2!=0:
+				try:
+					cmd(['umount', target])
+				except CatalystError:
 					ouch=1
 					log.warning("Couldn't umount bind mount: %s", target)
 

diff --git a/catalyst/fileops.py b/catalyst/fileops.py
index 4b9e200..6971911 100644
--- a/catalyst/fileops.py
+++ b/catalyst/fileops.py
@@ -22,7 +22,7 @@ from snakeoil.osutils import (ensure_dirs as snakeoil_ensure_dirs,
 # pylint: enable=unused-import
 
 from catalyst import log
-from catalyst.support import CatalystError
+from catalyst.support import (cmd, CatalystError)
 
 
 def ensure_dirs(path, gid=-1, uid=-1, mode=0o755, minimal=True,
@@ -79,7 +79,7 @@ def clear_dir(target, mode=0o755, chg_flags=False, remove=False,
 			mystat = os.stat(target)
 			# There's no easy way to change flags recursively in python
 			if chg_flags and os.uname()[0] == "FreeBSD":
-				os.system("chflags -R noschg " + target)
+				cmd(['chflags', '-R', 'noschg', target])
 			log.debug('shutil.rmtree()')
 			shutil.rmtree(target)
 		except Exception:


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2020-01-27 18:52 Rick Farina
  0 siblings, 0 replies; 14+ messages in thread
From: Rick Farina @ 2020-01-27 18:52 UTC (permalink / raw
  To: gentoo-commits

commit:     8441372c285726de85c71a83035a9e11cc47f037
Author:     Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 27 18:50:42 2020 +0000
Commit:     Rick Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Mon Jan 27 18:52:55 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=8441372c

fix /var/tmp/portage not being forced into a tmpfs

2e91db10 accidently revealed that src tmpfs was being being used when we
meant "this might be a tmpfs, or it might not".  Fix preexisting code to
be more readable and adjust src tmpfs to be what a sane person would
expect

Signed-off-by: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo.org>

 catalyst/base/stagebase.py | 6 +++---
 catalyst/defaults.py       | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 85e30450..d29b48fc 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -973,13 +973,13 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			if "snapcache" in self.settings["options"] and x == "portdir":
 				self.snapcache_lock.read_lock()
 			_cmd = None
-			if src == "tmpfs":
+			if src == "maybe_tmpfs":
 				if "var_tmpfs_portage" in self.settings:
 					_cmd = ['mount', '-t', 'tmpfs',
 						'-o', 'size=' + self.settings['var_tmpfs_portage'] + 'G',
 						src, target]
-				else:
-					_cmd = ['mount', '-t', 'tmpfs', src, target]
+			elif src == "tmpfs":
+				_cmd = ['mount', '-t', 'tmpfs', src, target]
 			else:
 				if os.uname()[0] == "FreeBSD":
 					if src == "/dev":

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index cb5f84e3..705ae931 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -99,7 +99,7 @@ SOURCE_MOUNT_DEFAULTS = {
 	"devpts": "/dev/pts",
 	"distdir": DISTDIR[:],
 	"portdir": PORTDIR[:],
-	"port_tmpdir": "tmpfs",
+	"port_tmpdir": "maybe_tmpfs",
 	"proc": "/proc",
 	"shm": "shmfs",
 	"run": "tmpfs",


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2020-04-13 20:36 Matt Turner
  0 siblings, 0 replies; 14+ messages in thread
From: Matt Turner @ 2020-04-13 20:36 UTC (permalink / raw
  To: gentoo-commits

commit:     2fb8d95e7c83a6e2123e9575f9fd253aae962b43
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 11 22:30:03 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Apr 13 20:35:35 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=2fb8d95e

catalyst: Just import things where they're needed

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 catalyst/base/resume.py    | 3 ++-
 catalyst/base/stagebase.py | 3 ++-
 catalyst/fileops.py        | 7 +------
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py
index a0770b9d..82f97cd3 100644
--- a/catalyst/base/resume.py
+++ b/catalyst/base/resume.py
@@ -9,9 +9,10 @@ set, unset, is_set, is_unset, enabled, clear_all
 import os
 
 from snakeoil import fileutils
+from snakeoil.osutils import pjoin, listdir_files
 
 from catalyst import log
-from catalyst.fileops import ensure_dirs, pjoin, listdir_files, clear_dir
+from catalyst.fileops import ensure_dirs, clear_dir
 
 
 class AutoResume():

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index a90fc843..683e5989 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -5,6 +5,7 @@ import shutil
 import sys
 
 from snakeoil import fileutils
+from snakeoil.osutils import pjoin
 
 from DeComp.compress import CompressMap
 
@@ -17,7 +18,7 @@ from catalyst.base.targetbase import TargetBase
 from catalyst.base.clearbase import ClearBase
 from catalyst.base.genbase import GenBase
 from catalyst.lock import LockDir, LockInUse
-from catalyst.fileops import ensure_dirs, pjoin, clear_dir, clear_path
+from catalyst.fileops import ensure_dirs, clear_dir, clear_path
 from catalyst.base.resume import AutoResume
 
 

diff --git a/catalyst/fileops.py b/catalyst/fileops.py
index fffcfc6a..671d8d9f 100644
--- a/catalyst/fileops.py
+++ b/catalyst/fileops.py
@@ -10,12 +10,7 @@ import os
 import shutil
 from stat import ST_UID, ST_GID, ST_MODE
 
-# NOTE: pjoin and listdir_files are imported here for export
-# to other catalyst modules
-# pylint: disable=unused-import
-from snakeoil.osutils import (ensure_dirs as snakeoil_ensure_dirs,
-	pjoin, listdir_files)
-# pylint: enable=unused-import
+from snakeoil.osutils import ensure_dirs as snakeoil_ensure_dirs
 
 from catalyst import log
 from catalyst.support import CatalystError


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2020-04-17 19:52 Matt Turner
  0 siblings, 0 replies; 14+ messages in thread
From: Matt Turner @ 2020-04-17 19:52 UTC (permalink / raw
  To: gentoo-commits

commit:     bcffd2ef3fc347d6ce346a1737ddbd0ed0b7dff6
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 17 17:27:08 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Apr 17 18:55:23 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=bcffd2ef

catalyst: Make conf_values['digests'] a set

This makes it automatically deduplicate values (which I honestly don't
really care about) but also makes it so users don't need to .split()
themselves.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 catalyst/base/genbase.py | 2 +-
 catalyst/main.py         | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py
index bc7f9375..eb09a4e0 100644
--- a/catalyst/base/genbase.py
+++ b/catalyst/base/genbase.py
@@ -37,5 +37,5 @@ class GenBase():
 
         with io.open(path + '.DIGESTS', 'w', encoding='utf-8') as file:
             for f in [path, path + '.CONTENTS']:
-                for i in self.settings['digests'].split():
+                for i in self.settings['digests']:
                     file.write(self.generate_hash(f, name=i))

diff --git a/catalyst/main.py b/catalyst/main.py
index d8e791c4..c91fc8b6 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -341,8 +341,9 @@ def _main(parser, opts):
     # TODO add capability to config/spec new definitions
 
     if "digests" in conf_values:
-        digests = set(conf_values['digests'].split())
         valid_digests = hashlib.algorithms_available
+        digests = set(conf_values['digests'].split())
+        conf_values['digests'] = digests
 
         # First validate all the requested digests are valid keys.
         if digests - valid_digests:


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2020-10-30 22:41 Matt Turner
  0 siblings, 0 replies; 14+ messages in thread
From: Matt Turner @ 2020-10-30 22:41 UTC (permalink / raw
  To: gentoo-commits

commit:     488b06bf5dbe1eba68ac11de95f56feeb6cead83
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 29 15:00:42 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Oct 30 22:40:52 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=488b06bf

catalyst: Run the build sequence in new mount namespace

Catalyst has a lot of code to unmount the bind mounts it's made, and
then more to try harder when something fails. This is important because
if bind mounts still exist within the chroot when clean up happens,
files outside of the chroot on the host system can inadvertently be
deleted. E.g., distfiles, binpkgs, kerncache.

Running the build sequence (the steps that need bind mounts) within a
mount namespace and exiting the mount namespace when finished ensures
that clean up can never accidentally delete files outside the chroot.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 catalyst/base/stagebase.py | 7 ++++---
 catalyst/main.py           | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 06ec8727..caec5935 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -15,6 +15,7 @@ from snakeoil.osutils import pjoin
 from DeComp.compress import CompressMap
 
 from catalyst import log
+from catalyst.context import namespace
 from catalyst.defaults import (confdefaults, MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN)
 from catalyst.support import (CatalystError, file_locate, normpath,
                               cmd, read_makeconf, ismount, file_check,
@@ -1405,9 +1406,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
         if not self.run_sequence(self.prepare_sequence):
             return False
 
-        if not self.run_sequence(self.build_sequence):
-            self.unbind()
-            return False
+        with namespace(mount=True):
+            if not self.run_sequence(self.build_sequence):
+                return False
 
         if not self.run_sequence(self.finish_sequence):
             return False

diff --git a/catalyst/main.py b/catalyst/main.py
index 93a4a0d3..5536471a 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -355,7 +355,7 @@ def _main(parser, opts):
     # 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).
-    with namespace(mount=True, uts=True, ipc=True, hostname='catalyst'):
+    with namespace(uts=True, ipc=True, hostname='catalyst'):
         # everything is setup, so the build is a go
         try:
             success = build_target(addlargs)


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2021-02-20 21:27 Matt Turner
  0 siblings, 0 replies; 14+ messages in thread
From: Matt Turner @ 2021-02-20 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     65d49f1028b49fed6e011526429e553ebb6c903e
Author:     Felix Bier <Felix.Bier <AT> rohde-schwarz <DOT> com>
AuthorDate: Thu Feb  4 00:38:36 2021 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat Feb 20 21:27:29 2021 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=65d49f10

Unify handling of main repo and other repos

This commit unifies the handling of the main repo and the other repos.
All are stored in one common list. A mount entry is created for
each entry in the list (previously a mount entry was only created
for the main repo and the other repos were copied into the chroot).
This means each non-main repo can now be either a directory or a
squash files (previously the non-main repos had to be directories).
The existing mount logic will bind-mount the repos that are stored as
directories, removing the need for copying.

A repos.conf entry will be created for each entry in the list.
This means a repos.conf entry for the main repo can now be created
(previously repos.conf entries were only created for the non-main
repos). The repos.conf entry will only be created if the target
location for the main repo is non-default, i.e. unequal to
/var/db/repos/gentoo. This mirrors the behavior of write_make_conf,
which only writes the PORTDIR variable to make.conf if the location
of the main repo is non-default.

As a side effect, the PORTDIR variable is now no longer needed,
and will be removed from write_make_conf in a separate commit.

Signed-off-by: Felix Bier <felix.bier <AT> rohde-schwarz.com>
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 catalyst/base/stagebase.py | 88 +++++++++++++++++++++++++++++++---------------
 catalyst/defaults.py       |  5 ---
 2 files changed, 60 insertions(+), 33 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index fedc8f87..97e2318c 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -219,8 +219,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
         # Setup our mount points.
         self.mount = copy.deepcopy(MOUNT_DEFAULTS)
 
-        self.mount['portdir']['source'] = self.snapshot
-        self.mount['portdir']['target'] = self.settings['repo_basedir'] + '/' + self.settings['repo_name']
+        # Create mount entry for each repository
+        for path, name, _ in self.repos:
+            name = get_repo_name(path)
+            mount_id = f'repo_{name}'
+
+            self.mount[mount_id] = {
+                'enable': True,
+                'source': path,
+                'target': self.get_repo_location(name)
+            }
+
         self.mount['distdir']['source'] = self.settings['distdir']
         self.mount["distdir"]['target'] = self.settings['target_distdir']
 
@@ -587,13 +596,41 @@ class StageBase(TargetBase, ClearBase, GenBase):
                                   "/busybox_config"]
 
     def set_repos(self):
+
+        # Each entry in this list will be a tuple of the form
+        # (source, name, default)
+        #
+        # source: the location of the repo on the host system,
+        # either a directory or a squashfs file.
+        #
+        # name: the repository name parsed from the repo.
+        # This is just a caching mechanism to avoid parsing the name
+        # every time the source is processed.
+        #
+        # default: Default location where the repo is expected in the
+        # target system. If this matches the path where we mount the repo to
+        # (as per get_repo_location), then we can skip generating a repos.conf
+        # entry for that repo. Currently this mechanism is only used for
+        # the main repo, which has a default location hard-coded in
+        # /usr/share/portage/config/repos.conf. For the other repos,
+        # the default is set to None.
+        self.repos = []
+
+        # Create entry for snapshot
+        default_location = Path(confdefaults['repo_basedir'], confdefaults['repo_name'])
+        self.repos.append((self.snapshot, get_repo_name(self.snapshot), default_location))
+
+        # Create entry for every other repo
         if 'repos' in self.settings:
             if isinstance(self.settings['repos'], str):
                 self.settings['repos'] = \
                     self.settings['repos'].split()
-            log.info('repos directories are set to: %s',
+            log.info('repos are set to: %s',
                      ' '.join(self.settings['repos']))
 
+            get_info = lambda repo: (repo, get_repo_name(repo), None)
+            self.repos.extend(map(get_info, self.settings['repos']))
+
     def set_overlay(self):
         if self.settings["spec_prefix"] + "/overlay" in self.settings:
             if isinstance(self.settings[self.settings['spec_prefix'] + '/overlay'], str):
@@ -832,24 +869,19 @@ class StageBase(TargetBase, ClearBase, GenBase):
             raise CatalystError(f'Could not write {repo_conf_chroot}: {e}') from e
 
     def process_repos(self):
-        """ We copy the contents of our repos to get_repo_location(repo_name) """
-        if 'repos' in self.settings:
-            for x in self.settings['repos']:
-                if os.path.exists(x):
-                    name = get_repo_name(x)
+        """ Create repos.conf entry for every repo """
 
-                    location = self.get_repo_location(name)
-                    config = configparser.ConfigParser()
-                    config[name] = {'location': location}
-                    self.write_repo_conf(name, config)
+        for _, name, default in self.repos:
+            location = self.get_repo_location(name)
 
-                    location_chroot = self.to_chroot(location)
-                    location_chroot.mkdir(mode=0o755, parents=True, exist_ok=True)
+            if default == location:
+                log.debug('Skipping repos.conf entry for repo %s '
+                    'with default location %s.', name, location)
+                continue
 
-                    log.info('Copying overlay dir %s to %s', x, location_chroot)
-                    cmd(f'cp -a {x}/* {location_chroot}', env=self.env)
-                else:
-                    log.warning('Skipping missing overlay %s.', x)
+            config = configparser.ConfigParser()
+            config[name] = {'location': location}
+            self.write_repo_conf(name, config)
 
     def root_overlay(self):
         """ Copy over the root_overlay """
@@ -1144,18 +1176,18 @@ class StageBase(TargetBase, ClearBase, GenBase):
             log.warning("You've been hacking. Clearing target patches: %s", target)
             clear_path(target)
 
-        # Remove our overlays
-        if 'repos' in self.settings:
-            for repo_path in self.settings['repos']:
-                repo_name = get_repo_name(repo_path)
+        # Remove repo data
+        for _, name, _ in self.repos:
 
-                repo_conf = self.get_repo_conf_path(repo_name)
-                chroot_repo_conf = self.to_chroot(repo_conf)
-                chroot_repo_conf.unlink()
+            # Remove repos.conf entry
+            repo_conf = self.get_repo_conf_path(name)
+            chroot_repo_conf = self.to_chroot(repo_conf)
+            chroot_repo_conf.unlink(missing_ok=True)
 
-                location = self.get_repo_location(repo_name)
-                chroot_location = self.to_chroot(location)
-                clear_path(str(chroot_location))
+            # The repo has already been unmounted, remove the mount point
+            location = self.get_repo_location(name)
+            chroot_location = self.to_chroot(location)
+            clear_path(str(chroot_location))
 
         if "sticky-config" not in self.settings["options"]:
             # re-write the make.conf to be sure it is clean

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 3d5c0a7f..ccb0a584 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -85,11 +85,6 @@ MOUNT_DEFAULTS = OrderedDict([
         'source': 'tmpfs',
         'target': '/run',
     }),
-    ('portdir', {
-        'enable': True,
-        'source': 'config',
-        'target': 'config',
-    }),
     ('distdir', {
         'enable': True,
         'source': 'config',


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2021-02-28 14:39 Andreas K. Hüttel
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas K. Hüttel @ 2021-02-28 14:39 UTC (permalink / raw
  To: gentoo-commits

commit:     483385348b32fab2230f596816b6e1d0b6489962
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 24 21:26:58 2021 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed Feb 24 21:26:58 2021 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=48338534

Add option to generate BSD-style tagged hashes (can be verified by modern coreutils)

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 catalyst/base/genbase.py | 6 +++++-
 catalyst/defaults.py     | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py
index c7dd87bc..52418877 100644
--- a/catalyst/base/genbase.py
+++ b/catalyst/base/genbase.py
@@ -24,7 +24,11 @@ class GenBase():
                 h.update(data)
 
         filename = os.path.split(filepath)[1]
-        return f'# {name.upper()} HASH\n{h.hexdigest()}  {filename}\n'
+
+	if self.settings['digest_format'] == 'bsd':
+		return f'# {name.upper()} HASH\n{name.upper()} ({filename}) = {h.hexdigest()}\n'
+	else:
+		return f'# {name.upper()} HASH\n{h.hexdigest()}  {filename}\n'
 
     def gen_contents_file(self, path):
         c = self.settings['contents_map']

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index ccb0a584..2cede562 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -11,6 +11,7 @@ from DeComp.definitions import DECOMPRESSOR_PROGRAM_OPTIONS, LIST_XATTRS_OPTIONS
 valid_config_file_values = frozenset([
     "compression_mode",
     "digests",
+    "digest_format",
     "distcc_hosts",
     "distdir",
     "envscript",
@@ -35,6 +36,7 @@ confdefaults = {
     "compressor_options": XATTRS_OPTIONS['linux'],
     "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS['linux'],
     "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER,
+    "digest_format": 'linux',
     "distdir": portage.settings['DISTDIR'],
     "icecream": "/var/cache/icecream",
     'list_xattrs_opt': LIST_XATTRS_OPTIONS['linux'],


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
@ 2023-07-01 19:27 Andreas K. Hüttel
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas K. Hüttel @ 2023-07-01 19:27 UTC (permalink / raw
  To: gentoo-commits

commit:     9d6e495ca2ee55c21befc183a9a56fc5062a63c7
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  1 17:44:41 2023 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Jul  1 19:26:14 2023 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=9d6e495c

stagebase: Fix and improve port_logdir config option

NOTE: The cleaning of log files does not work yet (and probably
never did).

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 catalyst/base/stagebase.py | 7 +++----
 catalyst/defaults.py       | 2 ++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 65f4306e..74d197b5 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -271,9 +271,8 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
         if "port_logdir" in self.settings:
             self.mount['port_logdir']['enable'] = True
-            self.mount['port_logdir']['source'] = self.settings['port_logdir']
-            self.env["PORT_LOGDIR"] = self.settings["port_logdir"]
-            self.env["PORT_LOGDIR_CLEAN"] = PORT_LOGDIR_CLEAN
+            self.mount['port_logdir']['source'] = normpath(self.settings['port_logdir'] + "/" + self.settings["target_subpath"] + "/")
+            self.env["PORTAGE_LOGDIR"] = self.settings["target_logdir"]
 
     def override_cbuild(self):
         if "CBUILD" in self.makeconf:
@@ -1002,7 +1001,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
                     # We may need to create the source of the bind mount. E.g., in the
                     # case of an empty package cache we must create the directory that
                     # the binary packages will be stored into.
-                    source_path.mkdir(mode=0o755, exist_ok=True)
+                    source_path.mkdir(mode=0o755, parents=True, exist_ok=True)
 
             Path(target).mkdir(mode=0o755, parents=True, exist_ok=True)
 

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 2cede562..39b71c34 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,6 +25,7 @@ valid_config_file_values = frozenset([
     "sharedir",
     "storedir",
     "target_distdir",
+    "target_logdir",
     "target_pkgdir",
     "var_tmpfs_portage",
 ])
@@ -53,6 +54,7 @@ confdefaults = {
     "shdir": "%(sharedir)s/targets",
     "storedir": "/var/tmp/catalyst",
     "target_distdir": "/var/cache/distfiles",
+    "target_logdir": "/var/log/portage",
     "target_pkgdir": "/var/cache/binpkgs",
 }
 


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

end of thread, other threads:[~2023-07-01 19:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-13 20:36 [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/ Matt Turner
  -- strict thread matches above, loose matches on Subject: below --
2023-07-01 19:27 Andreas K. Hüttel
2021-02-28 14:39 Andreas K. Hüttel
2021-02-20 21:27 Matt Turner
2020-10-30 22:41 Matt Turner
2020-04-17 19:52 Matt Turner
2020-01-27 18:52 Rick Farina
2016-05-22  3:34 Mike Frysinger
2016-03-23 16:38 Brian Dolbec
2016-03-21  5:15 Mike Frysinger
2015-10-08 20:02 Brian Dolbec
2015-09-08 14:14 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-09-08 14:17 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-01-01  5:59 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-02-26  4:12 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-01-01  5:59 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-02-26 20:12 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec

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