1 |
commit: 752c3db97d11ab07b5a0ed9c5cd892cc5e610854 |
2 |
Author: dol-sen <brian.dolbec <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed Jul 13 05:34:01 2011 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Wed Jul 13 05:34:01 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=752c3db9 |
7 |
|
8 |
fix a possibility of a None type error in exclDictMatchCP |
9 |
|
10 |
--- |
11 |
pym/gentoolkit/eclean/exclude.py | 11 +++++++++-- |
12 |
1 files changed, 9 insertions(+), 2 deletions(-) |
13 |
|
14 |
diff --git a/pym/gentoolkit/eclean/exclude.py b/pym/gentoolkit/eclean/exclude.py |
15 |
index 5f48cab..961bb14 100644 |
16 |
--- a/pym/gentoolkit/eclean/exclude.py |
17 |
+++ b/pym/gentoolkit/eclean/exclude.py |
18 |
@@ -199,13 +199,20 @@ def exclDictExpand(exclude): |
19 |
|
20 |
def exclDictMatchCP(exclude,pkg): |
21 |
"""Checks whether a CP matches the exclusion rules.""" |
22 |
+ if pkg is None: |
23 |
+ return False |
24 |
if 'anti-packages' in exclude and pkg in exclude['anti-packages']: |
25 |
return False |
26 |
if 'packages' in exclude and pkg in exclude['packages']: |
27 |
return True |
28 |
- cat = pkg.split('/')[0] |
29 |
+ try: |
30 |
+ cat = pkg.split('/')[0] |
31 |
+ except: |
32 |
+ dprint( "exclude", "exclDictMatchCP: Invalid package name: " +\ |
33 |
+ "%s, Could not determine category" %pkg) |
34 |
+ cat = '' |
35 |
if 'categories' in exclude and cat in exclude['categories']: |
36 |
- return True |
37 |
+ return True |
38 |
return False |
39 |
|
40 |
def exclDictExpandPkgname(exclude): |