aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2016-05-18 08:40:42 -0700
committerBrian Dolbec <dolsen@gentoo.org>2016-05-18 08:40:42 -0700
commit44d972ef07970c5cb812aa0b061fb2235fc6b0d6 (patch)
tree875f7053a4e7a7f980523ccddaab8c8ffff199ae
parentrevdep-rebuild, assign.py: Trap an invalid cpv split bug 571782 (diff)
downloadgentoolkit-44d972ef07970c5cb812aa0b061fb2235fc6b0d6.tar.gz
gentoolkit-44d972ef07970c5cb812aa0b061fb2235fc6b0d6.tar.bz2
gentoolkit-44d972ef07970c5cb812aa0b061fb2235fc6b0d6.zip
revdep-rebuild: Replace the deprecated logger.war calls with logger.warning
-rw-r--r--pym/gentoolkit/revdep_rebuild/analyse.py6
-rw-r--r--pym/gentoolkit/revdep_rebuild/assign.py14
-rw-r--r--pym/gentoolkit/revdep_rebuild/cache.py2
-rw-r--r--pym/gentoolkit/revdep_rebuild/rebuild.py24
-rw-r--r--pym/gentoolkit/revdep_rebuild/stuff.py2
5 files changed, 24 insertions, 24 deletions
diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py
index b9c18c0..c9c5f71 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -283,7 +283,7 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
# when found for some reason
stime = current_milli_time()
- logger.warn(green(' * ') +
+ logger.warning(green(' * ') +
bold('Collecting system binaries and libraries'))
bin_dirs, lib_dirs = prepare_search_dirs(logger, settings)
@@ -351,7 +351,7 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
scanned_files = scan_files(libs_and_bins, settings['CMD_MAX_ARGS'],
logger, searchbits)
- logger.warn(green(' * ') + bold('Checking dynamic linking consistency'))
+ logger.warning(green(' * ') + bold('Checking dynamic linking consistency'))
logger.debug(
'\tanalyse(), Searching for %i libs, bins within %i libraries and links'
% (len(libs_and_bins), len(libraries)+len(libraries_links))
@@ -365,7 +365,7 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
libraries.union(libraries_links), _libs_to_check, logger)
broken_pathes += broken_la
- logger.warn(green(' * ') + bold('Assign files to packages'))
+ logger.warning(green(' * ') + bold('Assign files to packages'))
return assign_packages(broken_pathes, logger, settings)
diff --git a/pym/gentoolkit/revdep_rebuild/assign.py b/pym/gentoolkit/revdep_rebuild/assign.py
index 8d819d6..00dda6e 100644
--- a/pym/gentoolkit/revdep_rebuild/assign.py
+++ b/pym/gentoolkit/revdep_rebuild/assign.py
@@ -52,8 +52,8 @@ def assign_packages(broken, logger, settings):
logger.info('\t' + green('* ') + m +
' -> ' + bold(found))
except Exception as e:
- logger.warn(red(' !! Failed to read ' + f))
- logger.warn(red(' !! Error was:' + str(e)))
+ logger.warning(red(' !! Failed to read ' + f))
+ logger.warning(red(' !! Error was:' + str(e)))
broken_filenames = set(broken)
orphaned = broken_filenames.difference(assigned_filenames)
@@ -76,7 +76,7 @@ def get_best_match(cpv, cp, logger):
"""
slot = portage.db[portage.root]["vartree"].dbapi.aux_get(cpv, ["SLOT"])[0]
- logger.warn('\t%s "%s" %s.' % (yellow('* Warning:'), cpv,bold('ebuild not found.')))
+ logger.warning('\t%s "%s" %s.' % (yellow('* Warning:'), cpv,bold('ebuild not found.')))
logger.debug('\tget_best_match(); Looking for %s:%s' %(cp, slot))
try:
match = portdb.match('%s:%s' %(cp, slot))
@@ -84,12 +84,12 @@ def get_best_match(cpv, cp, logger):
match = None
if not match:
- logger.warn('\t' + red('!!') + ' ' + yellow(
+ logger.warning('\t' + red('!!') + ' ' + yellow(
'Could not find ebuild for %s:%s' %(cp, slot)))
slot = ['']
match = portdb.match(cp)
if not match:
- logger.warn('\t' + red('!!') + ' ' +
+ logger.warning('\t' + red('!!') + ' ' +
yellow('Could not find ebuild for ' + cp))
return match, slot
@@ -104,7 +104,7 @@ def get_slotted_cps(cpvs, logger):
for cpv in cpvs:
parts = catpkgsplit(cpv)
if not parts:
- logger.warn(('\t' + red("Failed to split the following pkg: "
+ logger.warning(('\t' + red("Failed to split the following pkg: "
"%s, not a valid cat/pkg-ver" %cpv)))
continue
@@ -114,7 +114,7 @@ def get_slotted_cps(cpvs, logger):
except KeyError:
match, slot = get_best_match(cpv, cp, logger)
if not match:
- logger.warn('\t' + red("Installed package: "
+ logger.warning('\t' + red("Installed package: "
"%s is no longer available" %cp))
continue
diff --git a/pym/gentoolkit/revdep_rebuild/cache.py b/pym/gentoolkit/revdep_rebuild/cache.py
index 36f0f72..6d1a1a3 100644
--- a/pym/gentoolkit/revdep_rebuild/cache.py
+++ b/pym/gentoolkit/revdep_rebuild/cache.py
@@ -66,7 +66,7 @@ def save_cache(logger, to_save={}, temp_path=DEFAULTS['DEFAULT_TMP_DIR']):
_file.write(line + '\n')
_file.close()
except Exception as ex:
- logger.warn('\t' + red('Could not save cache: %s' %str(ex)))
+ logger.warning('\t' + red('Could not save cache: %s' %str(ex)))
diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/revdep_rebuild/rebuild.py
index fc57888..5408298 100644
--- a/pym/gentoolkit/revdep_rebuild/rebuild.py
+++ b/pym/gentoolkit/revdep_rebuild/rebuild.py
@@ -82,10 +82,10 @@ def rebuild(logger, assigned, settings):
args += ' --color n'
if len(emerge_command) == 0:
- logger.warn(bold('\nThere is nothing to emerge. Exiting.'))
+ logger.warning(bold('\nThere is nothing to emerge. Exiting.'))
return 0
- logger.warn(yellow(
+ logger.warning(yellow(
'\nemerge') + args +
' --oneshot --complete-graph=y ' +
bold(emerge_command))
@@ -119,19 +119,19 @@ def main(settings=None, logger=None):
if not settings['stdout'].isatty() or settings['nocolor']:
nocolor()
- logger.warn(blue(' * ') +
+ logger.warning(blue(' * ') +
yellow('This is the new python coded version'))
- logger.warn(blue(' * ') +
+ logger.warning(blue(' * ') +
yellow('Please report any bugs found using it.'))
- logger.warn(blue(' * ') +
+ logger.warning(blue(' * ') +
yellow('The original revdep-rebuild script is '
'installed as revdep-rebuild.sh'))
- logger.warn(blue(' * ') +
+ logger.warning(blue(' * ') +
yellow('Please file bugs at: '
'https://bugs.gentoo.org/'))
if os.getuid() != 0 and not settings['PRETEND']:
- logger.warn(blue(' * ') +
+ logger.warning(blue(' * ') +
yellow('You are not root, adding --pretend to portage options'))
settings['PRETEND'] = True
@@ -153,20 +153,20 @@ def main(settings=None, logger=None):
assigned, orphaned = analyse(settings, logger, _libs_to_check=_libs_to_check)
if not assigned and not orphaned:
- logger.warn('\n' + bold('Your system is consistent'))
+ logger.warning('\n' + bold('Your system is consistent'))
# return the correct exit code
return 0
elif orphaned:
# blank line for beter visibility of the following lines
- logger.warn('')
+ logger.warning('')
if settings['library']:
- logger.warn(red(' !!! Dependant orphaned files: ') +
+ logger.warning(red(' !!! Dependant orphaned files: ') +
bold('No installed package was found for the following:'))
else:
- logger.warn(red(' !!! Broken orphaned files: ') +
+ logger.warning(red(' !!! Broken orphaned files: ') +
bold('No installed package was found for the following:'))
for filename in orphaned:
- logger.warn(red('\t* ') + filename)
+ logger.warning(red('\t* ') + filename)
success = rebuild(logger, assigned, settings)
logger.debug("rebuild return code = %i" %success)
diff --git a/pym/gentoolkit/revdep_rebuild/stuff.py b/pym/gentoolkit/revdep_rebuild/stuff.py
index 7a8373d..3b0a980 100644
--- a/pym/gentoolkit/revdep_rebuild/stuff.py
+++ b/pym/gentoolkit/revdep_rebuild/stuff.py
@@ -81,7 +81,7 @@ def filter_masked(assigned, logger):
def is_masked(ebuild):
if get_masking_status(ebuild):
- logger.warn(' !!! ' + red('All ebuilds that could satisfy: ') +
+ logger.warning(' !!! ' + red('All ebuilds that could satisfy: ') +
green(ebuild) + red(' have been masked'))
return True
return False