public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Matt Turner" <mattst88@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:master commit in: modules/
Date: Sat, 23 Feb 2013 02:02:31 +0000 (UTC)	[thread overview]
Message-ID: <1361584935.78ef6501495eff12cb9c121a7b90ab90be0cd83a.mattst88@gentoo> (raw)

commit:     78ef6501495eff12cb9c121a7b90ab90be0cd83a
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Sat Feb  9 20:45:34 2013 +0000
Commit:     Matt Turner <mattst88 <AT> gmail <DOT> com>
CommitDate: Sat Feb 23 02:02:15 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=78ef6501

generic_stage_target: Split ._copy_kernel_config() from ._build_kernel()

_copy_kernel_config() is one idea with a bunch of error handling.
Isolating it in its own function makes _build_kernel() easier to read.

Reviewed-by: Matt Turner <mattst88 <AT> gmail.com>

---
 modules/generic_stage_target.py |   49 ++++++++++++++++++++------------------
 1 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index af7cbe7..2c32c00 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -1426,29 +1426,7 @@ class generic_stage_target(generic_target):
 				+"build_kernel_"+kname):
 			print "Resume point detected, skipping build_kernel for "+kname+" operation..."
 		else: # TODO: make this not require a kernel config
-			try:
-				if not os.path.exists(self.settings["boot/kernel/"+kname+"/config"]):
-					self.unbind()
-					raise CatalystError,\
-						"Can't find kernel config: "+\
-						self.settings["boot/kernel/"+kname+\
-						"/config"]
-
-			except TypeError:
-				raise CatalystError,\
-					"Required value boot/kernel/config not specified"
-
-			try:
-				cmd("cp "+self.settings["boot/kernel/"+kname+\
-					"/config"]+" "+\
-					self.settings["chroot_path"]+"/var/tmp/"+\
-					kname+".config",\
-					"Couldn't copy kernel config: "+\
-					self.settings["boot/kernel/"+kname+\
-					"/config"],env=self.env)
-
-			except CatalystError:
-				self.unbind()
+			self._copy_kernel_config(kname=kname)
 
 			"""
 			If we need to pass special options to the bootloader
@@ -1516,6 +1494,31 @@ class generic_stage_target(generic_target):
 				" post-kmerge ",
 				"Runscript post-kmerge failed",env=self.env)
 
+	def _copy_kernel_config(self, kname):
+		try:
+			if not os.path.exists(self.settings["boot/kernel/"+kname+"/config"]):
+				self.unbind()
+				raise CatalystError,\
+					"Can't find kernel config: "+\
+					self.settings["boot/kernel/"+kname+\
+					"/config"]
+
+		except TypeError:
+			raise CatalystError,\
+				"Required value boot/kernel/config not specified"
+
+		try:
+			cmd("cp "+self.settings["boot/kernel/"+kname+\
+				"/config"]+" "+\
+				self.settings["chroot_path"]+"/var/tmp/"+\
+				kname+".config",\
+				"Couldn't copy kernel config: "+\
+				self.settings["boot/kernel/"+kname+\
+				"/config"],env=self.env)
+
+		except CatalystError:
+			self.unbind()
+
 	def bootloader(self):
 		if "AUTORESUME" in self.settings \
 			and os.path.exists(self.settings["autoresume_path"]+"bootloader"):


             reply	other threads:[~2013-02-23  2:02 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-23  2:02 Matt Turner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-01-06  2:00 [gentoo-commits] proj/catalyst:master commit in: modules/ Brian Dolbec
2014-01-06  2:00 Brian Dolbec
2014-01-06  2:00 Brian Dolbec
2014-01-06  2:00 Brian Dolbec
2014-01-03  6:12 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-01-06  2:00 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-01-03  5:03 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-01-06  2:00 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec
2013-12-15 21:33 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-12-15  4:19 Matt Turner
2013-08-08  5:38 Matt Turner
2013-08-02  5:59 Brian Dolbec
2013-05-27 20:26 Richard Farina
2013-05-27 20:26 Richard Farina
2013-05-27 20:15 Richard Farina
2013-02-23  2:02 Matt Turner
2013-02-23  2:02 Matt Turner
2013-02-23  2:02 Matt Turner
2013-02-23  2:02 Matt Turner
2013-02-05  8:34 Matt Turner
2012-11-22  2:51 Jorge Manuel B. S. Vicetto
2012-11-22  2:51 Jorge Manuel B. S. Vicetto
2012-11-01 20:04 Richard Farina
2012-10-29 20:36 Anthony G. Basile
2012-10-29 20:35 Anthony G. Basile
2012-10-14  5:50 Matt Turner
2012-08-31  0:34 Jorge Manuel B. S. Vicetto
2012-08-29  4:17 Jorge Manuel B. S. Vicetto
2012-08-26 19:30 Jorge Manuel B. S. Vicetto
2012-08-23  5:55 Jorge Manuel B. S. Vicetto
2012-08-23  5:55 Jorge Manuel B. S. Vicetto
2012-08-23  5:55 Jorge Manuel B. S. Vicetto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361584935.78ef6501495eff12cb9c121a7b90ab90be0cd83a.mattst88@gentoo \
    --to=mattst88@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox