summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2012-03-03 23:40:54 -0800
committerBrian Dolbec <dolsen@gentoo.org>2012-03-03 23:40:54 -0800
commit602246c01709980ada3036cc995e74f6e06c90ef (patch)
tree4ae5b274978cb58090559944c520af41ec69e25b
parent2d303c857523978de043c0844f213567113feda5 (diff)
downloadgentoolkit-602246c01709980ada3036cc995e74f6e06c90ef.tar.gz
Add ignored files/directories check.
Add a warning for incomplete pkg merges with -MERGING- in the name.
-rw-r--r--pym/gentoolkit/revdep_rebuild/assign.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pym/gentoolkit/revdep_rebuild/assign.py b/pym/gentoolkit/revdep_rebuild/assign.py
index 73f20a9..76b41fc 100644
--- a/pym/gentoolkit/revdep_rebuild/assign.py
+++ b/pym/gentoolkit/revdep_rebuild/assign.py
@@ -14,6 +14,8 @@ from portage.versions import catpkgsplit
from portage import portdb
from portage.output import bold, red, yellow
+# ignore these files or directories if found
+IGNORED = ['.cache', 'world', 'world~', 'world.bak']
def assign_packages(broken, logger, settings):
''' Finds and returns packages that owns files placed in broken.
@@ -21,12 +23,18 @@ def assign_packages(broken, logger, settings):
'''
assigned = set()
for group in os.listdir(settings['PKG_DIR']):
- if os.path.isfile(settings['PKG_DIR'] + group):
+ if group in IGNORED:
+ continue
+ elif os.path.isfile(settings['PKG_DIR'] + group):
if not group.startswith('.keep_'):
logger.warn(yellow(" * Invalid category found in the installed pkg db: ") +
bold(settings['PKG_DIR'] + group))
continue
for pkg in os.listdir(settings['PKG_DIR'] + group):
+ if '-MERGING-' in pkg:
+ logger.warn(yellow(" * Invalid/incomplete package merge found in the installed pkg db: ") +
+ bold(settings['PKG_DIR'] + pkg))
+ continue
_file = settings['PKG_DIR'] + group + '/' + pkg + '/CONTENTS'
if os.path.exists(_file):
try: