public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:pending commit in: etc/, catalyst/base/, catalyst/
  2017-11-29 17:20 [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/base/, etc/ Brian Dolbec
@ 2017-11-22 15:52 ` Brian Dolbec
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2017-11-22 15:52 UTC (permalink / raw
  To: gentoo-commits

commit:     d5f54e2693f4277fee370927ef18265ebcc52ac1
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  9 09:14:04 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Nov 22 01:16:21 2017 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d5f54e26

base/stagebase.py: Seperate out the writing of the make.conf file

By sepaerating out the writing of the make.conf file, it keeps all code to do so in one place.
I also fixed the code to correctly set the target chroot directories for PORTDIR, DISTDIR, 
PKGDIR and PORTDIR_OVERLAY.
The same code also re-writes make.conf toggling any PORTDIR_OVERLAY setting
during the clean() run.

Add target_distdir and target_pkgdir settings to defaults and catalyst.conf.
This allows for more flexibility between host and target settings.  They can be individually
configured this way.

Update target an source mounts from the configured settings.

 catalyst/base/stagebase.py | 194 ++++++++++++++++++++++++---------------------
 catalyst/defaults.py       |   2 +
 etc/catalyst.conf          |   2 +
 3 files changed, 106 insertions(+), 92 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 532f0997..67382b9a 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -213,8 +213,13 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		self.mounts = ["proc", "dev", "portdir", "distdir", "port_tmpdir"]
 		# initialize our source mounts
 		self.mountmap = SOURCE_MOUNT_DEFAULTS.copy()
-		# update them from settings
+		# update these from settings
+		self.mountmap["portdir"] = self.settings["portdir"]
 		self.mountmap["distdir"] = self.settings["distdir"]
+		self.target_mounts["portdir"] = normpath(self.settings["repo_basedir"] +
+			"/" + self.settings["repo_name"])
+		self.target_mounts["distdir"] = self.settings["target_distdir"]
+		self.target_mounts["packagedir"] = self.settings["target_pkgdir"]
 		if "snapcache" not in self.settings["options"]:
 			self.mounts.remove("portdir")
 			self.mountmap["portdir"] = None
@@ -1051,96 +1056,106 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			if os.path.exists(hosts_file):
 				os.rename(hosts_file, hosts_file + '.catalyst')
 				shutil.copy('/etc/hosts', hosts_file)
+			# write out the make.conf
+			try:
+				self.write_make_conf(setup=True)
+			except OSError as e:
+				raise CatalystError('Could not write %s: %s' % (
+					normpath(self.settings["chroot_path"] +
+						self.settings["make_conf"]), e))
+			self.resume.enable("chroot_setup")
 
-			# Modify and write out make.conf (for the chroot)
-			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make_conf"])
-			clear_path(makepath)
-			myf = open(makepath, "w")
-			myf.write("# These settings were set by the catalyst build script "
-					"that automatically\n# built this stage.\n")
-			myf.write("# Please consult "
-					"/usr/share/portage/config/make.conf.example "
-					"for a more\n# detailed example.\n")
-
-			for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS",
-						"ASFLAGS"]:
-				if not flags in self.settings:
-					continue
-				if flags in ["LDFLAGS", "ASFLAGS"]:
-					myf.write("# %s is unsupported.  USE AT YOUR OWN RISK!\n"
-							% flags)
-				if (flags is not "CFLAGS" and
-					self.settings[flags] == self.settings["CFLAGS"]):
-					myf.write('%s="${CFLAGS}"\n' % flags)
-				elif isinstance(self.settings[flags], list):
-					myf.write('%s="%s"\n'
-							% (flags, ' '.join(self.settings[flags])))
-				else:
-					myf.write('%s="%s"\n'
-							% (flags, self.settings[flags]))
-
-			if "CBUILD" in self.settings:
-				myf.write("# This should not be changed unless you know exactly"
-					" what you are doing.  You\n# should probably be "
-					"using a different stage, instead.\n")
-				myf.write('CBUILD="' + self.settings["CBUILD"] + '"\n')
-
-			if "CHOST" in self.settings:
-				myf.write("# WARNING: Changing your CHOST is not something "
-					"that should be done lightly.\n# Please consult "
-					"https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable "
-					"before changing.\n")
-				myf.write('CHOST="' + self.settings["CHOST"] + '"\n')
-
-			# Figure out what our USE vars are for building
-			myusevars = []
-			if "HOSTUSE" in self.settings:
-				myusevars.extend(self.settings["HOSTUSE"])
-
-			if "use" in self.settings:
-				myusevars.extend(self.settings["use"])
-
-			if myusevars:
-				myf.write("# These are the USE and USE_EXPAND flags that were "
-						"used for\n# building in addition to what is provided "
-						"by the profile.\n")
-				myusevars = sorted(set(myusevars))
-				myf.write('USE="' + ' '.join(myusevars) + '"\n')
-				if '-*' in myusevars:
-					log.warning(
-						'The use of -* in %s/use will cause portage to ignore\n'
-						'package.use in the profile and portage_confdir.\n'
-						"You've been warned!", self.settings['spec_prefix'])
-
-			myuseexpandvars = {}
-			if "HOSTUSEEXPAND" in self.settings:
-				for hostuseexpand in self.settings["HOSTUSEEXPAND"]:
-					myuseexpandvars.update(
-						{hostuseexpand:self.settings["HOSTUSEEXPAND"][hostuseexpand]})
-
-			if myuseexpandvars:
-				for hostuseexpand in myuseexpandvars:
-					myf.write(hostuseexpand + '="' +
-						' '.join(myuseexpandvars[hostuseexpand]) + '"\n')
-
-			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
-			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
-			myf.write('PKGDIR="%s"\n' % self.settings['packagedir'])
-
+	def write_make_conf(self, setup=True):
+		# Modify and write out make.conf (for the chroot)
+		makepath = normpath(self.settings["chroot_path"] +
+			self.settings["make_conf"])
+		clear_path(makepath)
+		myf = open(makepath, "w")
+		myf.write("# These settings were set by the catalyst build script "
+				"that automatically\n# built this stage.\n")
+		myf.write("# Please consult "
+				"/usr/share/portage/config/make.conf.example "
+				"for a more\n# detailed example.\n")
+
+		for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS",
+					"ASFLAGS"]:
+			if not flags in self.settings:
+				continue
+			if flags in ["LDFLAGS", "ASFLAGS"]:
+				myf.write("# %s is unsupported.  USE AT YOUR OWN RISK!\n"
+						% flags)
+			if (flags is not "CFLAGS" and
+				self.settings[flags] == self.settings["CFLAGS"]):
+				myf.write('%s="${CFLAGS}"\n' % flags)
+			elif isinstance(self.settings[flags], list):
+				myf.write('%s="%s"\n'
+						% (flags, ' '.join(self.settings[flags])))
+			else:
+				myf.write('%s="%s"\n'
+						% (flags, self.settings[flags]))
+
+		if "CBUILD" in self.settings:
+			myf.write("# This should not be changed unless you know exactly"
+				" what you are doing.  You\n# should probably be "
+				"using a different stage, instead.\n")
+			myf.write('CBUILD="' + self.settings["CBUILD"] + '"\n')
+
+		if "CHOST" in self.settings:
+			myf.write("# WARNING: Changing your CHOST is not something "
+				"that should be done lightly.\n# Please consult "
+				"https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable "
+				"before changing.\n")
+			myf.write('CHOST="' + self.settings["CHOST"] + '"\n')
+
+		# Figure out what our USE vars are for building
+		myusevars = []
+		if "HOSTUSE" in self.settings:
+			myusevars.extend(self.settings["HOSTUSE"])
+
+		if "use" in self.settings:
+			myusevars.extend(self.settings["use"])
+
+		if myusevars:
+			myf.write("# These are the USE and USE_EXPAND flags that were "
+					"used for\n# building in addition to what is provided "
+					"by the profile.\n")
+			myusevars = sorted(set(myusevars))
+			myf.write('USE="' + ' '.join(myusevars) + '"\n')
+			if '-*' in myusevars:
+				log.warning(
+					'The use of -* in %s/use will cause portage to ignore\n'
+					'package.use in the profile and portage_confdir.\n'
+					"You've been warned!", self.settings['spec_prefix'])
+
+		myuseexpandvars = {}
+		if "HOSTUSEEXPAND" in self.settings:
+			for hostuseexpand in self.settings["HOSTUSEEXPAND"]:
+				myuseexpandvars.update(
+					{hostuseexpand:self.settings["HOSTUSEEXPAND"][hostuseexpand]})
+
+		if myuseexpandvars:
+			for hostuseexpand in myuseexpandvars:
+				myf.write(hostuseexpand + '="' +
+					' '.join(myuseexpandvars[hostuseexpand]) + '"\n')
+		# write out a shipable version
+		target_portdir = normpath(self.settings["repo_basedir"] + "/" +
+			self.settings["repo_name"])
+
+		myf.write('PORTDIR="%s"\n' % target_portdir)
+		myf.write('DISTDIR="%s"\n' % self.settings['target_distdir'])
+		myf.write('PKGDIR="%s"\n' % self.settings['target_pkgdir'])
+		if setup:
 			# Setup the portage overlay
 			if "portage_overlay" in self.settings:
 				myf.write('PORTDIR_OVERLAY="%s"\n' %  self.settings["local_overlay"])
 
-			# Set default locale for system responses. #478382
-			myf.write(
-				'\n'
-				'# This sets the language of build output to English.\n'
-				'# Please keep this setting intact when reporting bugs.\n'
-				'LC_MESSAGES=C\n')
-
-			myf.close()
-			self.resume.enable("chroot_setup")
+		# Set default locale for system responses. #478382
+		myf.write(
+			'\n'
+			'# This sets the language of build output to English.\n'
+			'# Please keep this setting intact when reporting bugs.\n'
+			'LC_MESSAGES=C\n')
+		myf.close()
 
 	def fsscript(self):
 		if "autoresume" in self.settings["options"] \
@@ -1183,12 +1198,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			make_conf = self.settings['chroot_path'] + self.settings['make_conf']
 			try:
-				with open(make_conf) as f:
-					data = f.readlines()
-				data = ''.join(x for x in data
-						if not x.startswith('PORTDIR_OVERLAY'))
-				with open(make_conf, 'w') as f:
-					f.write(data)
+				self.write_make_conf(setup=False)
 			except OSError as e:
 				raise CatalystError('Could not update %s: %s' % (make_conf, e))
 

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 0bba6f4d..84ed2822 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -59,6 +59,8 @@ confdefaults={
 	"snapshot_name": "portage-",
 	"source_matching": "strict",
 	"storedir": "/var/tmp/catalyst",
+	"target_distdir": "/var/portage/distfiles",
+	"target_pkgdir":"/var/portage/packages",
 	}
 
 DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf'

diff --git a/etc/catalyst.conf b/etc/catalyst.conf
index 2e61ea4f..b4db063c 100644
--- a/etc/catalyst.conf
+++ b/etc/catalyst.conf
@@ -85,6 +85,8 @@ portdir="/usr/portage"
 #
 repo_basedir="/usr"
 repo_name="portage"
+target_distdir="/usr/portage/distfiles"
+target_pkgdir="/usr/portage/packages"
 
 # sharedir specifies where all of the catalyst runtime executables
 # and other shared lib objects are.


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/base/, etc/
@ 2017-11-29 17:20 Brian Dolbec
  2017-11-22 15:52 ` [gentoo-commits] proj/catalyst:pending commit in: etc/, catalyst/base/, catalyst/ Brian Dolbec
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Dolbec @ 2017-11-29 17:20 UTC (permalink / raw
  To: gentoo-commits

commit:     d5f54e2693f4277fee370927ef18265ebcc52ac1
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  9 09:14:04 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Nov 22 01:16:21 2017 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d5f54e26

base/stagebase.py: Seperate out the writing of the make.conf file

By sepaerating out the writing of the make.conf file, it keeps all code to do so in one place.
I also fixed the code to correctly set the target chroot directories for PORTDIR, DISTDIR, 
PKGDIR and PORTDIR_OVERLAY.
The same code also re-writes make.conf toggling any PORTDIR_OVERLAY setting
during the clean() run.

Add target_distdir and target_pkgdir settings to defaults and catalyst.conf.
This allows for more flexibility between host and target settings.  They can be individually
configured this way.

Update target an source mounts from the configured settings.

 catalyst/base/stagebase.py | 194 ++++++++++++++++++++++++---------------------
 catalyst/defaults.py       |   2 +
 etc/catalyst.conf          |   2 +
 3 files changed, 106 insertions(+), 92 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 532f0997..67382b9a 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -213,8 +213,13 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		self.mounts = ["proc", "dev", "portdir", "distdir", "port_tmpdir"]
 		# initialize our source mounts
 		self.mountmap = SOURCE_MOUNT_DEFAULTS.copy()
-		# update them from settings
+		# update these from settings
+		self.mountmap["portdir"] = self.settings["portdir"]
 		self.mountmap["distdir"] = self.settings["distdir"]
+		self.target_mounts["portdir"] = normpath(self.settings["repo_basedir"] +
+			"/" + self.settings["repo_name"])
+		self.target_mounts["distdir"] = self.settings["target_distdir"]
+		self.target_mounts["packagedir"] = self.settings["target_pkgdir"]
 		if "snapcache" not in self.settings["options"]:
 			self.mounts.remove("portdir")
 			self.mountmap["portdir"] = None
@@ -1051,96 +1056,106 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			if os.path.exists(hosts_file):
 				os.rename(hosts_file, hosts_file + '.catalyst')
 				shutil.copy('/etc/hosts', hosts_file)
+			# write out the make.conf
+			try:
+				self.write_make_conf(setup=True)
+			except OSError as e:
+				raise CatalystError('Could not write %s: %s' % (
+					normpath(self.settings["chroot_path"] +
+						self.settings["make_conf"]), e))
+			self.resume.enable("chroot_setup")
 
-			# Modify and write out make.conf (for the chroot)
-			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make_conf"])
-			clear_path(makepath)
-			myf = open(makepath, "w")
-			myf.write("# These settings were set by the catalyst build script "
-					"that automatically\n# built this stage.\n")
-			myf.write("# Please consult "
-					"/usr/share/portage/config/make.conf.example "
-					"for a more\n# detailed example.\n")
-
-			for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS",
-						"ASFLAGS"]:
-				if not flags in self.settings:
-					continue
-				if flags in ["LDFLAGS", "ASFLAGS"]:
-					myf.write("# %s is unsupported.  USE AT YOUR OWN RISK!\n"
-							% flags)
-				if (flags is not "CFLAGS" and
-					self.settings[flags] == self.settings["CFLAGS"]):
-					myf.write('%s="${CFLAGS}"\n' % flags)
-				elif isinstance(self.settings[flags], list):
-					myf.write('%s="%s"\n'
-							% (flags, ' '.join(self.settings[flags])))
-				else:
-					myf.write('%s="%s"\n'
-							% (flags, self.settings[flags]))
-
-			if "CBUILD" in self.settings:
-				myf.write("# This should not be changed unless you know exactly"
-					" what you are doing.  You\n# should probably be "
-					"using a different stage, instead.\n")
-				myf.write('CBUILD="' + self.settings["CBUILD"] + '"\n')
-
-			if "CHOST" in self.settings:
-				myf.write("# WARNING: Changing your CHOST is not something "
-					"that should be done lightly.\n# Please consult "
-					"https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable "
-					"before changing.\n")
-				myf.write('CHOST="' + self.settings["CHOST"] + '"\n')
-
-			# Figure out what our USE vars are for building
-			myusevars = []
-			if "HOSTUSE" in self.settings:
-				myusevars.extend(self.settings["HOSTUSE"])
-
-			if "use" in self.settings:
-				myusevars.extend(self.settings["use"])
-
-			if myusevars:
-				myf.write("# These are the USE and USE_EXPAND flags that were "
-						"used for\n# building in addition to what is provided "
-						"by the profile.\n")
-				myusevars = sorted(set(myusevars))
-				myf.write('USE="' + ' '.join(myusevars) + '"\n')
-				if '-*' in myusevars:
-					log.warning(
-						'The use of -* in %s/use will cause portage to ignore\n'
-						'package.use in the profile and portage_confdir.\n'
-						"You've been warned!", self.settings['spec_prefix'])
-
-			myuseexpandvars = {}
-			if "HOSTUSEEXPAND" in self.settings:
-				for hostuseexpand in self.settings["HOSTUSEEXPAND"]:
-					myuseexpandvars.update(
-						{hostuseexpand:self.settings["HOSTUSEEXPAND"][hostuseexpand]})
-
-			if myuseexpandvars:
-				for hostuseexpand in myuseexpandvars:
-					myf.write(hostuseexpand + '="' +
-						' '.join(myuseexpandvars[hostuseexpand]) + '"\n')
-
-			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
-			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
-			myf.write('PKGDIR="%s"\n' % self.settings['packagedir'])
-
+	def write_make_conf(self, setup=True):
+		# Modify and write out make.conf (for the chroot)
+		makepath = normpath(self.settings["chroot_path"] +
+			self.settings["make_conf"])
+		clear_path(makepath)
+		myf = open(makepath, "w")
+		myf.write("# These settings were set by the catalyst build script "
+				"that automatically\n# built this stage.\n")
+		myf.write("# Please consult "
+				"/usr/share/portage/config/make.conf.example "
+				"for a more\n# detailed example.\n")
+
+		for flags in ["CFLAGS", "CXXFLAGS", "FCFLAGS", "FFLAGS", "LDFLAGS",
+					"ASFLAGS"]:
+			if not flags in self.settings:
+				continue
+			if flags in ["LDFLAGS", "ASFLAGS"]:
+				myf.write("# %s is unsupported.  USE AT YOUR OWN RISK!\n"
+						% flags)
+			if (flags is not "CFLAGS" and
+				self.settings[flags] == self.settings["CFLAGS"]):
+				myf.write('%s="${CFLAGS}"\n' % flags)
+			elif isinstance(self.settings[flags], list):
+				myf.write('%s="%s"\n'
+						% (flags, ' '.join(self.settings[flags])))
+			else:
+				myf.write('%s="%s"\n'
+						% (flags, self.settings[flags]))
+
+		if "CBUILD" in self.settings:
+			myf.write("# This should not be changed unless you know exactly"
+				" what you are doing.  You\n# should probably be "
+				"using a different stage, instead.\n")
+			myf.write('CBUILD="' + self.settings["CBUILD"] + '"\n')
+
+		if "CHOST" in self.settings:
+			myf.write("# WARNING: Changing your CHOST is not something "
+				"that should be done lightly.\n# Please consult "
+				"https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable "
+				"before changing.\n")
+			myf.write('CHOST="' + self.settings["CHOST"] + '"\n')
+
+		# Figure out what our USE vars are for building
+		myusevars = []
+		if "HOSTUSE" in self.settings:
+			myusevars.extend(self.settings["HOSTUSE"])
+
+		if "use" in self.settings:
+			myusevars.extend(self.settings["use"])
+
+		if myusevars:
+			myf.write("# These are the USE and USE_EXPAND flags that were "
+					"used for\n# building in addition to what is provided "
+					"by the profile.\n")
+			myusevars = sorted(set(myusevars))
+			myf.write('USE="' + ' '.join(myusevars) + '"\n')
+			if '-*' in myusevars:
+				log.warning(
+					'The use of -* in %s/use will cause portage to ignore\n'
+					'package.use in the profile and portage_confdir.\n'
+					"You've been warned!", self.settings['spec_prefix'])
+
+		myuseexpandvars = {}
+		if "HOSTUSEEXPAND" in self.settings:
+			for hostuseexpand in self.settings["HOSTUSEEXPAND"]:
+				myuseexpandvars.update(
+					{hostuseexpand:self.settings["HOSTUSEEXPAND"][hostuseexpand]})
+
+		if myuseexpandvars:
+			for hostuseexpand in myuseexpandvars:
+				myf.write(hostuseexpand + '="' +
+					' '.join(myuseexpandvars[hostuseexpand]) + '"\n')
+		# write out a shipable version
+		target_portdir = normpath(self.settings["repo_basedir"] + "/" +
+			self.settings["repo_name"])
+
+		myf.write('PORTDIR="%s"\n' % target_portdir)
+		myf.write('DISTDIR="%s"\n' % self.settings['target_distdir'])
+		myf.write('PKGDIR="%s"\n' % self.settings['target_pkgdir'])
+		if setup:
 			# Setup the portage overlay
 			if "portage_overlay" in self.settings:
 				myf.write('PORTDIR_OVERLAY="%s"\n' %  self.settings["local_overlay"])
 
-			# Set default locale for system responses. #478382
-			myf.write(
-				'\n'
-				'# This sets the language of build output to English.\n'
-				'# Please keep this setting intact when reporting bugs.\n'
-				'LC_MESSAGES=C\n')
-
-			myf.close()
-			self.resume.enable("chroot_setup")
+		# Set default locale for system responses. #478382
+		myf.write(
+			'\n'
+			'# This sets the language of build output to English.\n'
+			'# Please keep this setting intact when reporting bugs.\n'
+			'LC_MESSAGES=C\n')
+		myf.close()
 
 	def fsscript(self):
 		if "autoresume" in self.settings["options"] \
@@ -1183,12 +1198,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			make_conf = self.settings['chroot_path'] + self.settings['make_conf']
 			try:
-				with open(make_conf) as f:
-					data = f.readlines()
-				data = ''.join(x for x in data
-						if not x.startswith('PORTDIR_OVERLAY'))
-				with open(make_conf, 'w') as f:
-					f.write(data)
+				self.write_make_conf(setup=False)
 			except OSError as e:
 				raise CatalystError('Could not update %s: %s' % (make_conf, e))
 

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 0bba6f4d..84ed2822 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -59,6 +59,8 @@ confdefaults={
 	"snapshot_name": "portage-",
 	"source_matching": "strict",
 	"storedir": "/var/tmp/catalyst",
+	"target_distdir": "/var/portage/distfiles",
+	"target_pkgdir":"/var/portage/packages",
 	}
 
 DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf'

diff --git a/etc/catalyst.conf b/etc/catalyst.conf
index 2e61ea4f..b4db063c 100644
--- a/etc/catalyst.conf
+++ b/etc/catalyst.conf
@@ -85,6 +85,8 @@ portdir="/usr/portage"
 #
 repo_basedir="/usr"
 repo_name="portage"
+target_distdir="/usr/portage/distfiles"
+target_pkgdir="/usr/portage/packages"
 
 # sharedir specifies where all of the catalyst runtime executables
 # and other shared lib objects are.


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

* [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/base/, etc/
  2020-05-20  3:39 [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/base/, catalyst/, etc/ Matt Turner
@ 2020-05-21 20:25 ` Matt Turner
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Turner @ 2020-05-21 20:25 UTC (permalink / raw
  To: gentoo-commits

commit:     adfb01ca3a36e74f500e384177404563023aa12b
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sat May 16 21:53:11 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Wed May 20 01:49:37 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=adfb01ca

catalyst: Remove support for source_matching="loose"

This does not seem like a useful feature to me.

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

 catalyst/base/stagebase.py |  3 ---
 catalyst/defaults.py       |  1 -
 catalyst/support.py        |  6 +++---
 etc/catalyst.conf          | 12 ------------
 4 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index f39895fe..febaf969 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -130,8 +130,6 @@ class StageBase(TargetBase, ClearBase, GenBase):
                                         decomp_opt=self.settings["decomp_opt"])
         self.accepted_extensions = self.decompressor.search_order_extensions(
             self.settings["decompressor_search_order"])
-        log.notice("Source file specification matching setting is: %s",
-                   self.settings["source_matching"])
         log.notice("Accepted source file extensions search order: %s",
                    self.accepted_extensions)
         # save resources, it is not always needed
@@ -409,7 +407,6 @@ class StageBase(TargetBase, ClearBase, GenBase):
                 normpath(self.settings["storedir"] + "/builds/" +
                          self.settings["source_subpath"]),
                 self.accepted_extensions,
-                self.settings["source_matching"] in ["strict"]
             )
             log.debug('Source path returned from file_check is: %s',
                       self.settings["source_path"])

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 412cb956..14f671fe 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -45,7 +45,6 @@ confdefaults = {
     "repos": "%(storedir)s/repos",
     "sharedir": "/usr/share/catalyst",
     "shdir": "%(sharedir)s/targets",
-    "source_matching": "strict",
     "storedir": "/var/tmp/catalyst",
     "target_distdir": "/var/cache/distfiles",
     "target_pkgdir": "/var/cache/binpkgs",

diff --git a/catalyst/support.py b/catalyst/support.py
index c4a5c797..a6a6854a 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -59,7 +59,7 @@ def cmd(mycmd, env=None, debug=False, fail_func=None):
                             print_traceback=False)
 
 
-def file_check(filepath, extensions=None, strict=True):
+def file_check(filepath, extensions=None):
     '''Check for the files existence and that only one exists
     if others are found with various extensions
     '''
@@ -73,8 +73,8 @@ def file_check(filepath, extensions=None, strict=True):
         ".CONTENTS") and not x.endswith(".CONTENTS.gz") and not x.endswith(".DIGESTS")]
     if len(files) == 1:
         return files[0]
-    if len(files) > 1 and strict:
-        msg = "Ambiguos Filename: %s\nPlease specify the correct extension as well" % filepath
+    if len(files) > 1:
+        msg = "Ambiguous Filename: %s\nPlease specify the correct extension as well" % filepath
         raise CatalystError(msg, print_traceback=False)
     target_file = None
     for ext in extensions:

diff --git a/etc/catalyst.conf b/etc/catalyst.conf
index f64fe971..d33be15f 100644
--- a/etc/catalyst.conf
+++ b/etc/catalyst.conf
@@ -50,18 +50,6 @@ envscript="/etc/catalyst/catalystrc"
 # (These options can be used together)
 options="autoresume bindist kerncache pkgcache seedcache"
 
-# source_matching specifies how catalyst will match non-specific file names
-# if the filename is not found as an exact match.
-# ie: a filename without the extension specified.  "/path/to/foo"
-#
-# possible values are:
-#   "strict" meaning if more than one file of that name is present with any
-#            file extension, then it will raise an exception.
-#   "loose"  meaning it will search for an existing filename with an added
-#            extension from an ordered list of extensions determined from the
-#            decompressor_search_order specification in the spec file or (default)
-source_matching="strict"
-
 # port_logdir is where all build logs will be kept. This dir will be automatically cleaned
 # of all logs over 30 days old. If left undefined the logs will remain in the build directory
 # as usual and get cleaned every time a stage build is restarted.


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

end of thread, other threads:[~2020-05-21 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-29 17:20 [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/base/, etc/ Brian Dolbec
2017-11-22 15:52 ` [gentoo-commits] proj/catalyst:pending commit in: etc/, catalyst/base/, catalyst/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2020-05-20  3:39 [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/base/, catalyst/, etc/ Matt Turner
2020-05-21 20:25 ` [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/base/, etc/ Matt Turner

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