Gentoo Archives: gentoo-catalyst

From: Mike Frysinger <vapier@g.o>
To: gentoo-catalyst@l.g.o
Subject: [gentoo-catalyst] [PATCH 02/10] stage2: convert to log module
Date: Sun, 11 Oct 2015 06:29:22
Message-Id: 1444544952-32408-2-git-send-email-vapier@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 01/10] stage1: convert to log module by Mike Frysinger
1 ---
2 catalyst/targets/stage2.py | 17 ++++++++++-------
3 1 file changed, 10 insertions(+), 7 deletions(-)
4
5 diff --git a/catalyst/targets/stage2.py b/catalyst/targets/stage2.py
6 index 786aaa4..ff060d2 100644
7 --- a/catalyst/targets/stage2.py
8 +++ b/catalyst/targets/stage2.py
9 @@ -5,6 +5,7 @@ stage2 target, builds upon previous stage1 tarball
10
11 import os
12
13 +from catalyst import log
14 from catalyst.support import normpath
15 from catalyst.base.stagebase import StageBase
16
17 @@ -30,10 +31,12 @@ class stage2(StageBase):
18 self.settings["hash_map"].generate_hash(
19 self.settings["source_path"],\
20 hash_=self.settings["hash_function"])
21 - print "Source path set to "+self.settings["source_path"]
22 + log.notice('Source path set to %s', self.settings['source_path'])
23 if os.path.isdir(self.settings["source_path"]):
24 - print "\tIf this is not desired, remove this directory or turn off seedcache in the options of catalyst.conf"
25 - print "\tthe source path will then be "+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"] + "\n")
26 + log.warning(
27 + 'If this is not desired, remove this directory or turn off seedcache in the\n'
28 + 'options of catalyst.conf. The source path will then be:\n%s',
29 + normpath(self.settings['storedir'] + '/builds/' + self.settings['source_subpath']))
30
31 # XXX: How do these override_foo() functions differ from the ones in
32 # StageBase and why aren't they in stage3_target?
33 @@ -57,7 +60,7 @@ class stage2(StageBase):
34 def set_portage_overlay(self):
35 StageBase.set_portage_overlay(self)
36 if "portage_overlay" in self.settings:
37 - print "\nWARNING !!!!!"
38 - print "\tUsing an portage overlay for earlier stages could cause build issues."
39 - print "\tIf you break it, you buy it. Don't complain to us about it."
40 - print "\tDont say we did not warn you\n"
41 + log.warning(
42 + 'Using an overlay for earlier stages could cause build issues.\n'
43 + "If you break it, you buy it. Don't complain to us about it.\n"
44 + "Don't say we did not warn you.")
45 --
46 2.5.2