1 |
commit: b2e05841e9b4eed6c287631bde8be58ff9430bb6 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 6 22:28:36 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 8 22:07:57 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b2e05841 |
7 |
|
8 |
support: use snakeoil.fileutils.touch |
9 |
|
10 |
No point in duplicating our own when snakeoil provides a better one. |
11 |
|
12 |
catalyst/base/resume.py | 5 +++-- |
13 |
catalyst/base/stagebase.py | 6 ++++-- |
14 |
catalyst/support.py | 8 -------- |
15 |
3 files changed, 7 insertions(+), 12 deletions(-) |
16 |
|
17 |
diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py |
18 |
index e3f03e7..443b46d 100644 |
19 |
--- a/catalyst/base/resume.py |
20 |
+++ b/catalyst/base/resume.py |
21 |
@@ -15,8 +15,9 @@ import os |
22 |
import sys |
23 |
import traceback |
24 |
|
25 |
+from snakeoil import fileutils |
26 |
+ |
27 |
from catalyst.fileops import ensure_dirs, pjoin, listdir_files, clear_dir |
28 |
-from catalyst.support import touch |
29 |
|
30 |
|
31 |
class AutoResumeError(Exception): |
32 |
@@ -69,7 +70,7 @@ class AutoResume(object): |
33 |
myf.write(data) |
34 |
else: |
35 |
try: |
36 |
- touch(fname) |
37 |
+ fileutils.touch(fname) |
38 |
self._points[point] = fname |
39 |
except Exception as e: |
40 |
print AutoResumeError(str(e)) |
41 |
|
42 |
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py |
43 |
index 813e5f1..f81c51b 100644 |
44 |
--- a/catalyst/base/stagebase.py |
45 |
+++ b/catalyst/base/stagebase.py |
46 |
@@ -9,12 +9,14 @@ from stat import ST_UID, ST_GID, ST_MODE |
47 |
# for convienience |
48 |
pjoin = os.path.join |
49 |
|
50 |
+from snakeoil import fileutils |
51 |
+ |
52 |
from DeComp.compress import CompressMap |
53 |
|
54 |
from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, |
55 |
PORT_LOGDIR_CLEAN) |
56 |
from catalyst.support import (CatalystError, msg, file_locate, normpath, |
57 |
- touch, cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount, |
58 |
+ cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount, |
59 |
file_check) |
60 |
from catalyst.base.targetbase import TargetBase |
61 |
from catalyst.base.clearbase import ClearBase |
62 |
@@ -1513,7 +1515,7 @@ class StageBase(TargetBase, ClearBase, GenBase): |
63 |
cmd(self.settings["controller_file"]+\ |
64 |
" build_packages "+mypack,\ |
65 |
"Error in attempt to build packages",env=self.env) |
66 |
- touch(build_packages_resume) |
67 |
+ fileutils.touch(build_packages_resume) |
68 |
self.resume.enable("build_packages") |
69 |
except CatalystError: |
70 |
self.unbind() |
71 |
|
72 |
diff --git a/catalyst/support.py b/catalyst/support.py |
73 |
index 1207d36..960a91d 100644 |
74 |
--- a/catalyst/support.py |
75 |
+++ b/catalyst/support.py |
76 |
@@ -250,14 +250,6 @@ def addl_arg_parse(myspec,addlargs,requiredspec,validspec): |
77 |
raise CatalystError('\n\tAlso: '.join(messages)) |
78 |
|
79 |
|
80 |
-def touch(myfile): |
81 |
- try: |
82 |
- myf=open(myfile,"w") |
83 |
- myf.close() |
84 |
- except IOError: |
85 |
- raise CatalystError("Could not touch "+myfile+".", print_traceback=True) |
86 |
- |
87 |
- |
88 |
def countdown(secs=5, doing="Starting"): |
89 |
if secs: |
90 |
print ">>> Waiting",secs,"seconds before starting..." |