1 |
commit: 4f358eec1331b8facdbdc7eb36bfd702fd31ad29 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 10 05:15:43 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 10 23:54:37 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=4f358eec |
7 |
|
8 |
clearbase: convert to log module |
9 |
|
10 |
catalyst/base/clearbase.py | 21 +++++++++++---------- |
11 |
1 file changed, 11 insertions(+), 10 deletions(-) |
12 |
|
13 |
diff --git a/catalyst/base/clearbase.py b/catalyst/base/clearbase.py |
14 |
index b2c1a11..3817196 100644 |
15 |
--- a/catalyst/base/clearbase.py |
16 |
+++ b/catalyst/base/clearbase.py |
17 |
@@ -1,5 +1,6 @@ |
18 |
|
19 |
|
20 |
+from catalyst import log |
21 |
from catalyst.support import countdown |
22 |
from catalyst.fileops import clear_dir |
23 |
|
24 |
@@ -15,38 +16,38 @@ class ClearBase(object): |
25 |
def clear_autoresume(self): |
26 |
""" Clean resume points since they are no longer needed """ |
27 |
if "autoresume" in self.settings["options"]: |
28 |
- print "Removing AutoResume Points: ..." |
29 |
+ log.notice('Removing AutoResume Points ...') |
30 |
self.resume.clear_all() |
31 |
|
32 |
|
33 |
def remove_autoresume(self): |
34 |
""" Rmove all resume points since they are no longer needed """ |
35 |
if "autoresume" in self.settings["options"]: |
36 |
- print "Removing AutoResume: ..." |
37 |
+ log.notice('Removing AutoResume ...') |
38 |
self.resume.clear_all(remove=True) |
39 |
|
40 |
|
41 |
def clear_chroot(self): |
42 |
self.chroot_lock.unlock() |
43 |
- print 'Clearing the chroot path ...' |
44 |
+ log.notice('Clearing the chroot path ...') |
45 |
clear_dir(self.settings["chroot_path"], 0755, True) |
46 |
|
47 |
|
48 |
def remove_chroot(self): |
49 |
self.chroot_lock.unlock() |
50 |
- print 'Removing the chroot path ...' |
51 |
+ log.notice('Removing the chroot path ...') |
52 |
clear_dir(self.settings["chroot_path"], 0755, True, remove=True) |
53 |
|
54 |
|
55 |
def clear_packages(self, remove=False): |
56 |
if "pkgcache" in self.settings["options"]: |
57 |
- print "purging the pkgcache ..." |
58 |
+ log.notice('purging the pkgcache ...') |
59 |
clear_dir(self.settings["pkgcache_path"], remove=remove) |
60 |
|
61 |
|
62 |
def clear_kerncache(self, remove=False): |
63 |
if "kerncache" in self.settings["options"]: |
64 |
- print "purging the kerncache ..." |
65 |
+ log.notice('purging the kerncache ...') |
66 |
clear_dir(self.settings["kerncache_path"], remove=remove) |
67 |
|
68 |
|
69 |
@@ -54,15 +55,15 @@ class ClearBase(object): |
70 |
countdown(10,"Purging Caches ...") |
71 |
if any(k in self.settings["options"] for k in ("purge", |
72 |
"purgeonly", "purgetmponly")): |
73 |
- print "purge(); clearing autoresume ..." |
74 |
+ log.notice('purge(); clearing autoresume ...') |
75 |
self.clear_autoresume() |
76 |
|
77 |
- print "purge(); clearing chroot ..." |
78 |
+ log.notice('purge(); clearing chroot ...') |
79 |
self.clear_chroot() |
80 |
|
81 |
if "purgetmponly" not in self.settings["options"]: |
82 |
- print "purge(); clearing package cache ..." |
83 |
+ log.notice('purge(); clearing package cache ...') |
84 |
self.clear_packages(remove) |
85 |
|
86 |
- print "purge(); clearing kerncache ..." |
87 |
+ log.notice('purge(); clearing kerncache ...') |
88 |
self.clear_kerncache(remove) |