1 |
commit: 602246c01709980ada3036cc995e74f6e06c90ef |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Mar 4 07:40:54 2012 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Mar 4 07:40:54 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=602246c0 |
7 |
|
8 |
Add ignored files/directories check. |
9 |
Add a warning for incomplete pkg merges with -MERGING- in the name. |
10 |
|
11 |
--- |
12 |
pym/gentoolkit/revdep_rebuild/assign.py | 10 +++++++++- |
13 |
1 files changed, 9 insertions(+), 1 deletions(-) |
14 |
|
15 |
diff --git a/pym/gentoolkit/revdep_rebuild/assign.py b/pym/gentoolkit/revdep_rebuild/assign.py |
16 |
index 73f20a9..76b41fc 100644 |
17 |
--- a/pym/gentoolkit/revdep_rebuild/assign.py |
18 |
+++ b/pym/gentoolkit/revdep_rebuild/assign.py |
19 |
@@ -14,6 +14,8 @@ from portage.versions import catpkgsplit |
20 |
from portage import portdb |
21 |
from portage.output import bold, red, yellow |
22 |
|
23 |
+# ignore these files or directories if found |
24 |
+IGNORED = ['.cache', 'world', 'world~', 'world.bak'] |
25 |
|
26 |
def assign_packages(broken, logger, settings): |
27 |
''' Finds and returns packages that owns files placed in broken. |
28 |
@@ -21,12 +23,18 @@ def assign_packages(broken, logger, settings): |
29 |
''' |
30 |
assigned = set() |
31 |
for group in os.listdir(settings['PKG_DIR']): |
32 |
- if os.path.isfile(settings['PKG_DIR'] + group): |
33 |
+ if group in IGNORED: |
34 |
+ continue |
35 |
+ elif os.path.isfile(settings['PKG_DIR'] + group): |
36 |
if not group.startswith('.keep_'): |
37 |
logger.warn(yellow(" * Invalid category found in the installed pkg db: ") + |
38 |
bold(settings['PKG_DIR'] + group)) |
39 |
continue |
40 |
for pkg in os.listdir(settings['PKG_DIR'] + group): |
41 |
+ if '-MERGING-' in pkg: |
42 |
+ logger.warn(yellow(" * Invalid/incomplete package merge found in the installed pkg db: ") + |
43 |
+ bold(settings['PKG_DIR'] + pkg)) |
44 |
+ continue |
45 |
_file = settings['PKG_DIR'] + group + '/' + pkg + '/CONTENTS' |
46 |
if os.path.exists(_file): |
47 |
try: |