1 |
commit: a160cc7323338779f8f96e4b63da3e22742d9063 |
2 |
Author: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Feb 24 07:05:45 2011 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Mar 27 02:39:13 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=a160cc73 |
7 |
|
8 |
remove unused import. |
9 |
change an exception into an output.error message. |
10 |
set more functions to return True/False |
11 |
|
12 |
--- |
13 |
layman/overlays/source.py | 8 +++++--- |
14 |
1 files changed, 5 insertions(+), 3 deletions(-) |
15 |
|
16 |
diff --git a/layman/overlays/source.py b/layman/overlays/source.py |
17 |
index 586ec6c..be7b639 100644 |
18 |
--- a/layman/overlays/source.py |
19 |
+++ b/layman/overlays/source.py |
20 |
@@ -18,7 +18,6 @@ import copy |
21 |
import sys |
22 |
import shutil |
23 |
import subprocess |
24 |
-#from layman.debug import OUT |
25 |
from layman.utils import path |
26 |
|
27 |
|
28 |
@@ -75,10 +74,12 @@ class OverlaySource(object): |
29 |
mdir = path([base, self.parent.name]) |
30 |
|
31 |
if os.path.exists(mdir): |
32 |
- raise Exception('Directory ' + mdir + |
33 |
+ self.output.error('Directory ' + mdir + |
34 |
' already exists. Will not overwrite its contents!') |
35 |
+ return False |
36 |
|
37 |
os.makedirs(mdir) |
38 |
+ return True |
39 |
|
40 |
def sync(self, base, quiet = False): |
41 |
'''Sync the overlay.''' |
42 |
@@ -91,10 +92,11 @@ class OverlaySource(object): |
43 |
if not os.path.exists(mdir): |
44 |
self.output.warn('Directory ' + mdir + \ |
45 |
' did not exist, no files deleted.') |
46 |
- return |
47 |
+ return false |
48 |
|
49 |
self.output.info('Deleting directory "%s"' % mdir, 2) |
50 |
shutil.rmtree(mdir) |
51 |
+ return True |
52 |
|
53 |
def supported(self): |
54 |
'''Is the overlay type supported?''' |