public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-09-15 15:05 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2016-09-15 15:05 UTC (permalink / raw
  To: gentoo-commits

commit:     d1becbe15b5b13322b3b88a359e851d0d318aaa2
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 17:41:49 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 19:48:45 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=d1becbe1

revdep-rebuild: Fix filename matching for directories (bug 593672)

Also fixed all_masks not including lib32 lib64 (were added after all_masks was assigned).
Fixed to ensure it does not match on partial directory names by splitting the paths on the
os.sep boundaries.
Test using realpaths as well.

 pym/gentoolkit/revdep_rebuild/analyse.py | 33 +++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py
index 9f018b5..b8fca4b 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -120,7 +120,8 @@ def extract_dependencies_from_la(la, libraries, to_check, logger):
 
 
 class LibCheck(object):
-	def __init__(self, scanned_files, logger, searchlibs=None, searchbits=None, all_masks=None):
+	def __init__(self, scanned_files, logger, searchlibs=None, searchbits=None,
+				all_masks=None, masked_dirs=None):
 		'''LibCheck init function.
 
 		@param scanned_files: optional dictionary if the type created by
@@ -135,6 +136,7 @@ class LibCheck(object):
 		self.searchlibs = searchlibs
 		self.searchbits = sorted(searchbits) or ['32', '64']
 		self.all_masks = all_masks
+		self.masked_dirs = masked_dirs
 		self.logger.debug("\tLibCheck.__init__(), new searchlibs: %s" %(self.searchbits))
 		if searchlibs:
 			self.smsg = '\tLibCheck.search(), Checking for %s bit dependants'
@@ -221,7 +223,10 @@ class LibCheck(object):
 							if l in self.all_masks:
 								self.logger.debug('\tLibrary %s ignored as it is masked' % l)
 								continue
-							if filename in self.all_masks:
+							if (filename in self.all_masks or
+								os.path.realpath(filename) in self.all_masks or
+								self.is_masked(os.path.realpath(filename))
+								):
 								self.logger.debug('\tFile %s ignored as it is masked' % filename)
 								continue
 							if not bits in found_libs:
@@ -240,6 +245,16 @@ class LibCheck(object):
 		return found_libs
 
 
+	def is_masked(self, filename):
+		for m in self.masked_dirs:
+			t = m.split(os.sep)
+			f = filename.split(os.sep)
+			# self.logger.debug("\tis_masked(); %s, %s" % (t, f))
+			if t == f[:min(len(t), len(f))]:
+				return True
+		return False
+
+
 	def process_results(self, found_libs, scanned_files=None):
 		'''Processes the search results, logs the files found
 
@@ -294,18 +309,17 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
 		]
 	)
 
+	if '64' not in searchbits:
+		masked_dirs.update(['/lib64', '/usr/lib64'])
+	elif '32' not in searchbits:
+		masked_dirs.update(['/lib32', '/usr/lib32'])
+
 	all_masks = masked_dirs.copy()
 	all_masks.update(masked_files)
 	logger.debug("\tall_masks:")
 	for x in sorted(all_masks):
 		logger.debug('\t\t%s' % (x))
 
-
-	if '64' not in searchbits:
-		masked_dirs.update(['/lib64', '/usr/lib64'])
-	elif '32' not in searchbits:
-		masked_dirs.update(['/lib32', '/usr/lib32'])
-
 	if libraries and la_libraries and libraries_links and binaries:
 		logger.info(blue(' * ') +
 			bold('Found a valid cache, skipping collecting phase'))
@@ -371,7 +385,8 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
 		% (len(libs_and_bins), len(libraries)+len(libraries_links))
 	)
 
-	libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits, all_masks)
+	libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits,
+						all_masks, masked_dirs)
 
 	broken_pathes = libcheck.process_results(libcheck.search())
 


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2022-07-09  1:49 Mike Gilbert
  0 siblings, 0 replies; 19+ messages in thread
From: Mike Gilbert @ 2022-07-09  1:49 UTC (permalink / raw
  To: gentoo-commits

commit:     635e0b9f8b96217070eb48a6888ac5e1c46f8822
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  9 01:26:19 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Jul  9 01:26:19 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=635e0b9f

revdep-rebuild: set up a child logger with propagate = False

This prevents log messages from being emitted more than once, especially
by the root level loggger.

Bug: https://bugs.gentoo.org/838406
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 pym/gentoolkit/revdep_rebuild/rebuild.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/revdep_rebuild/rebuild.py
index 75e209d..16d07b8 100644
--- a/pym/gentoolkit/revdep_rebuild/rebuild.py
+++ b/pym/gentoolkit/revdep_rebuild/rebuild.py
@@ -44,7 +44,8 @@ __productname__ = "revdep-ng"
 
 def init_logger(settings):
     """Creates and iitializes our logger according to the settings"""
-    logger = logging.getLogger()
+    logger = logging.getLogger(__name__)
+    logger.propagate = False
     log_handler = logging.StreamHandler(sys.stdout)
     log_fmt = logging.Formatter("%(msg)s")
     log_handler.setFormatter(log_fmt)


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2020-02-14 18:13 Zac Medico
  0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2020-02-14 18:13 UTC (permalink / raw
  To: gentoo-commits

commit:     c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 14 18:04:53 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 14 18:09:43 2020 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=c6d2400d

revdep-rebuild: encode Popen args as utf-8 bytes (bug 709610)

Prevent this Popen exception:

UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in position 20: ordinal not in range(128)

Bug: https://bugs.gentoo.org/709610#c0
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 pym/gentoolkit/revdep_rebuild/stuff.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pym/gentoolkit/revdep_rebuild/stuff.py b/pym/gentoolkit/revdep_rebuild/stuff.py
index 3b0a980..002eb4b 100644
--- a/pym/gentoolkit/revdep_rebuild/stuff.py
+++ b/pym/gentoolkit/revdep_rebuild/stuff.py
@@ -19,6 +19,7 @@ def call_program(args):
 	@param, args: arument list to pass to subprocess
 	@return str
 	'''
+	args = [arg if isinstance(arg, bytes) else arg.encode('utf-8') for arg in args]
 	subp = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 	stdout, stderr = subp.communicate()
 	stdout = stdout.decode('utf-8')


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2019-08-19  3:41 Zac Medico
  0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2019-08-19  3:41 UTC (permalink / raw
  To: gentoo-commits

commit:     accf36f00070427170a4b46b2e3522de7b33d5b0
Author:     cvkbtzx <cvkbtzx <AT> users <DOT> noreply <DOT> github <DOT> com>
AuthorDate: Wed Sep 26 23:05:33 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 19 03:40:28 2019 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=accf36f0

revdep-rebuild: Fix DEFAULTS beeing modified when changing settings

Closes: https://github.com/gentoo/gentoolkit/pull/4
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 pym/gentoolkit/revdep_rebuild/settings.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/settings.py b/pym/gentoolkit/revdep_rebuild/settings.py
index b0a9f61..7438594 100644
--- a/pym/gentoolkit/revdep_rebuild/settings.py
+++ b/pym/gentoolkit/revdep_rebuild/settings.py
@@ -119,9 +119,9 @@ def parse_options():
 	settings['PRETEND'] = args.pretend
 	settings['nocolor'] = args.nocolor
 	if args.library:
-		settings['library'].update(set(args.library))
+		settings['library'] = set(settings['library']) | set(args.library)
 	settings['USE_TMP_FILES'] = not args.ignore
-	settings['pass_through_options'].extend(args.portage_options)
+	settings['pass_through_options'] = list(settings['pass_through_options']) + args.portage_options
 
 	return settings
 


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2019-08-19  3:41 Zac Medico
  0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2019-08-19  3:41 UTC (permalink / raw
  To: gentoo-commits

commit:     1bc0206dc67c40cabdef63dd18ec3fe499c4e6eb
Author:     cvkbtzx <cvkbtzx <AT> users <DOT> noreply <DOT> github <DOT> com>
AuthorDate: Sun Sep 16 13:51:04 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 19 03:40:03 2019 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1bc0206d

revdep-rebuild: Fix pass_through_options to handle args containing spaces

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 pym/gentoolkit/revdep_rebuild/rebuild.py  | 21 ++++++++++-----------
 pym/gentoolkit/revdep_rebuild/settings.py |  4 ++--
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/revdep_rebuild/rebuild.py
index 5408298..3f152e7 100644
--- a/pym/gentoolkit/revdep_rebuild/rebuild.py
+++ b/pym/gentoolkit/revdep_rebuild/rebuild.py
@@ -65,34 +65,33 @@ def init_logger(settings):
 def rebuild(logger, assigned, settings):
 	"""rebuilds the assigned pkgs"""
 
-	args = settings['pass_through_options']
+	args = list(settings['pass_through_options'])
 	if settings['EXACT']:
 		_assigned = filter_masked(assigned, logger)
-		emerge_command = '=' + ' ='.join(_assigned)
+		emerge_command = ['='+a for a in _assigned]
 	else:
 		_assigned = get_slotted_cps(assigned, logger)
-		emerge_command = ' '.join(_assigned)
+		emerge_command = [a for a in _assigned]
 	if settings['PRETEND']:
-		args += ' --pretend'
+		args.append('--pretend')
 	if settings['VERBOSITY'] >= 2:
-		args += ' --verbose'
+		args.append('--verbose')
 	elif settings['VERBOSITY'] < 1:
-		args += ' --quiet'
+		args.append('--quiet')
 	if settings['nocolor']:
-		args += ' --color n'
+		args.extend(['--color', 'n'])
 
 	if len(emerge_command) == 0:
 		logger.warning(bold('\nThere is nothing to emerge. Exiting.'))
 		return 0
 
 	logger.warning(yellow(
-		'\nemerge') + args +
+		'\nemerge') +  ' ' + ' '.join(args) +
 		' --oneshot --complete-graph=y ' +
-		bold(emerge_command))
+		bold(' '.join(emerge_command)))
 
 	stime = current_milli_time()
-	_args = 'emerge ' + args + ' --oneshot --complete-graph=y ' + emerge_command
-	_args = _args.split()
+	_args = ['emerge'] + args + ['--oneshot', '--complete-graph=y'] + emerge_command
 	success = subprocess.call(_args)
 	ftime = current_milli_time()
 	logger.debug("\trebuild(); emerge call for %d ebuilds took: %s seconds"

diff --git a/pym/gentoolkit/revdep_rebuild/settings.py b/pym/gentoolkit/revdep_rebuild/settings.py
index 81e9c64..b0a9f61 100644
--- a/pym/gentoolkit/revdep_rebuild/settings.py
+++ b/pym/gentoolkit/revdep_rebuild/settings.py
@@ -46,7 +46,7 @@ DEFAULTS = {
 		'debug': False,
 		'no-ld-path': False,
 		'no-order': False,
-		'pass_through_options': '',
+		'pass_through_options': [],
 		'stdout': sys.stdout,
 		'stdin': sys.stdin,
 		'stderr': sys.stderr
@@ -121,7 +121,7 @@ def parse_options():
 	if args.library:
 		settings['library'].update(set(args.library))
 	settings['USE_TMP_FILES'] = not args.ignore
-	settings['pass_through_options'] = " " + " ".join(args.portage_options)
+	settings['pass_through_options'].extend(args.portage_options)
 
 	return settings
 


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2017-05-05 19:38 Paul Varner
  0 siblings, 0 replies; 19+ messages in thread
From: Paul Varner @ 2017-05-05 19:38 UTC (permalink / raw
  To: gentoo-commits

commit:     d3ef9ef1bebc7604db0e8c5c49e167e18300c9e9
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Fri May  5 19:31:25 2017 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Fri May  5 19:31:25 2017 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=d3ef9ef1

revdep_rebuild/settings.py: Fix traceback error with Python3.6 (bug 617498)

The portage.root variable is using late binding. This breaks in Python3.6
where the type is being checked before use in os.path.join(). This fix
creates a new variable of the correct type from the value of portage.root
instead of using portage.root directly.

X-Gentoo-bug: 617498
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=617498
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/gentoolkit/revdep_rebuild/settings.py | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/settings.py b/pym/gentoolkit/revdep_rebuild/settings.py
index 589ea29..9a00f45 100644
--- a/pym/gentoolkit/revdep_rebuild/settings.py
+++ b/pym/gentoolkit/revdep_rebuild/settings.py
@@ -15,12 +15,19 @@ import glob
 import portage
 from portage import _encodings, _unicode_decode, _unicode_encode
 
+if sys.version_info[0] >= 3:
+	_unicode = str
+else:
+	_unicode = unicode
+
+portage_root = _unicode(portage.root)
+
 DEFAULTS = {
-		'DEFAULT_LD_FILE': os.path.join(portage.root, 'etc/ld.so.conf'),
-		'DEFAULT_ENV_FILE': os.path.join(portage.root, 'etc/profile.env'),
-		'REVDEP_CONFDIR': os.path.join(portage.root, 'etc/revdep-rebuild/'),
-		'PKG_DIR': os.path.join(portage.root, 'var/db/pkg/'),
-		'DEFAULT_TMP_DIR': os.path.join(portage.root, '/tmp/revdep-rebuild' if os.getgid() else '/var/cache/revdep-rebuild'), #cache default location
+		'DEFAULT_LD_FILE': os.path.join(portage_root, 'etc/ld.so.conf'),
+		'DEFAULT_ENV_FILE': os.path.join(portage_root, 'etc/profile.env'),
+		'REVDEP_CONFDIR': os.path.join(portage_root, 'etc/revdep-rebuild/'),
+		'PKG_DIR': os.path.join(portage_root, 'var/db/pkg/'),
+		'DEFAULT_TMP_DIR': os.path.join(portage_root, '/tmp/revdep-rebuild' if os.getgid() else '/var/cache/revdep-rebuild'), #cache default location
 
 		# number of maximum allowed files to be parsed at once
 		'CMD_MAX_ARGS': 1000,


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2017-03-10 17:31 Zac Medico
  0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2017-03-10 17:31 UTC (permalink / raw
  To: gentoo-commits

commit:     9ffefd66e618155ffb479cd1dbce9c3afe9a9ea4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 10 09:38:04 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 10 17:30:53 2017 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=9ffefd66

revdep_rebuild/assign.py: handle directory symlinks (bug 611808)

Use a _file_matcher class to make file comparisons work regardless
of directory symlinks.

X-Gentoo-bug: 611808
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=611808
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/gentoolkit/revdep_rebuild/assign.py | 67 +++++++++++++++++++++++++++++----
 1 file changed, 60 insertions(+), 7 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/assign.py b/pym/gentoolkit/revdep_rebuild/assign.py
index 00dda6e..84bd59f 100644
--- a/pym/gentoolkit/revdep_rebuild/assign.py
+++ b/pym/gentoolkit/revdep_rebuild/assign.py
@@ -6,6 +6,7 @@ Functions used for determining the package the broken lib belongs to.
 
 from __future__ import print_function
 
+import errno
 import os
 import io
 import re
@@ -22,11 +23,61 @@ try:
 except NameError:
 	pass
 
+
+class _file_matcher(object):
+	"""
+	Compares files by basename and parent directory (device, inode),
+	so comparisons work regardless of directory symlinks. If a
+	parent directory does not exist, the realpath of the parent
+	directory is used instead of the (device, inode). When multiple
+	files share the same parent directory, stat is only called
+	once per directory, and the result is cached internally.
+	"""
+	def __init__(self):
+		self._file_ids = {}
+		self._added = {}
+
+	def _file_id(self, filename):
+		try:
+			return self._file_ids[filename]
+		except KeyError:
+			try:
+				st = os.stat(filename)
+			except OSError as e:
+				if e.errno != errno.ENOENT:
+					raise
+				file_id = (os.path.realpath(filename),)
+			else:
+				file_id = (st.st_dev, st.st_ino)
+
+			self._file_ids[filename] = file_id
+			return file_id
+
+	def _file_key(self, filename):
+		head, tail = os.path.split(filename)
+		key = self._file_id(head) + (tail,)
+		return key
+
+	def add(self, filename):
+		self._added[self._file_key(filename)] = filename
+
+	def intersection(self, other):
+		for file_key in self._added:
+			match = other._added.get(file_key)
+			if match is not None:
+				yield match
+
+
 def assign_packages(broken, logger, settings):
 	''' Finds and returns packages that owns files placed in broken.
 		Broken is list of files
 	'''
 	stime = current_milli_time()
+
+	broken_matcher = _file_matcher()
+	for filename in broken:
+		broken_matcher.add(filename)
+
 	assigned_pkgs = set()
 	assigned_filenames = set()
 	for group in os.listdir(settings['PKG_DIR']):
@@ -39,21 +90,23 @@ def assign_packages(broken, logger, settings):
 				continue
 			f = pkgpath + '/CONTENTS'
 			if os.path.exists(f):
+				contents_matcher = _file_matcher()
 				try:
 					with io.open(f, 'r', encoding='utf_8') as cnt:
 						for line in cnt.readlines():
 							m = re.match('^obj (/[^ ]+)', line)
 							if m is not None:
-								m = m.group(1)
-								if m in broken:
-									found = group+'/'+pkg
-									assigned_pkgs.add(found)
-									assigned_filenames.add(m)
-									logger.info('\t' + green('* ') + m +
-												' -> ' + bold(found))
+								contents_matcher.add(m.group(1))
 				except Exception as e:
 					logger.warning(red(' !! Failed to read ' + f))
 					logger.warning(red(' !! Error was:' + str(e)))
+				else:
+					for m in contents_matcher.intersection(broken_matcher):
+						found = group+'/'+pkg
+						assigned_pkgs.add(found)
+						assigned_filenames.add(m)
+						logger.info('\t' + green('* ') + m +
+									' -> ' + bold(found))
 
 	broken_filenames = set(broken)
 	orphaned = broken_filenames.difference(assigned_filenames)


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-12-29 21:36 Jason Donenfeld
  0 siblings, 0 replies; 19+ messages in thread
From: Jason Donenfeld @ 2016-12-29 21:36 UTC (permalink / raw
  To: gentoo-commits

commit:     d84910d914c5efb5aeb6e0f25286e3e3c34172f6
Author:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 21:36:18 2016 +0000
Commit:     Jason Donenfeld <zx2c4 <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 21:36:18 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=d84910d9

revdep-rebuild: fix grammar

 pym/gentoolkit/revdep_rebuild/analyse.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py
index 698a43f..44243f6 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -145,7 +145,7 @@ class LibCheck(object):
 			self.check = self._checkforlib
 		else:
 			self.smsg = '\tLibCheck.search(), Checking for broken %s bit libs'
-			self.pmsg = green(' * ') + bold('Broken files that requires:') + ' %s (%s bits)'
+			self.pmsg = green(' * ') + bold('Broken files that require:') + ' %s (%s bits)'
 			self.setlibs = self._setlibs
 			self.check = self._checkbroken
 		self.sfmsg = "\tLibCheck.search(); Total found: %(count)d libs, %(deps)d files in %(time)d milliseconds"


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-09-15 15:05 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2016-09-15 15:05 UTC (permalink / raw
  To: gentoo-commits

commit:     06af2be2d987c0a2f34c872ed3d86ab74fe9800d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 19:48:03 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 19:49:32 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=06af2be2

revdep-rebuild:  Use realpath on the mask directories too (Bug 593672)

 pym/gentoolkit/revdep_rebuild/analyse.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py
index b8fca4b..698a43f 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -247,7 +247,7 @@ class LibCheck(object):
 
 	def is_masked(self, filename):
 		for m in self.masked_dirs:
-			t = m.split(os.sep)
+			t = os.path.realpath(m).split(os.sep)
 			f = filename.split(os.sep)
 			# self.logger.debug("\tis_masked(); %s, %s" % (t, f))
 			if t == f[:min(len(t), len(f))]:


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-08-15 21:06 Paul Varner
  0 siblings, 0 replies; 19+ messages in thread
From: Paul Varner @ 2016-08-15 21:06 UTC (permalink / raw
  To: gentoo-commits

commit:     c8783ccb225cddb43052463c092e8edc091c371a
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 15 21:02:03 2016 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Aug 15 21:02:03 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=c8783ccb

revdep-ebuild: Fix unicode argument expected error

Use the os module from portage to fix inconsistent returning of unicode
and str objects from listdir and explictly write the timestamp as
unicode.

X-Gentoo-bug: 589130
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=589130

 pym/gentoolkit/revdep_rebuild/cache.py   | 8 +++++---
 pym/gentoolkit/revdep_rebuild/collect.py | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/cache.py b/pym/gentoolkit/revdep_rebuild/cache.py
index 7359d05..e92e7cd 100644
--- a/pym/gentoolkit/revdep_rebuild/cache.py
+++ b/pym/gentoolkit/revdep_rebuild/cache.py
@@ -5,17 +5,19 @@ Functions for reading, saving and verifying the data caches
 
 from __future__ import print_function
 
-import os
+from portage import os
 import time
 import sys
 if sys.hexversion < 0x3000000:
 	from io import open
+	_unicode = unicode
+else:
+	_unicode = str
 
 from portage import _encodings, _unicode_decode, _unicode_encode
 from portage.output import red
 from .settings import DEFAULTS
 
-
 def read_cache(temp_path=DEFAULTS['DEFAULT_TMP_DIR']):
 	''' Reads cache information needed by analyse function.
 		This function does not checks if files exists nor timestamps,
@@ -59,7 +61,7 @@ def save_cache(logger, to_save={}, temp_path=DEFAULTS['DEFAULT_TMP_DIR']):
 	try:
 		_file = open(_unicode_encode(os.path.join(temp_path, 'timestamp'),
 			encoding=_encodings['fs']), mode='w', encoding=_encodings['content'])
-		_file.write(str(int(time.time())))
+		_file.write(_unicode(int(time.time())))
 		_file.close()
 
 		for key,val in to_save.items():

diff --git a/pym/gentoolkit/revdep_rebuild/collect.py b/pym/gentoolkit/revdep_rebuild/collect.py
index ab3ef97..82cec7b 100644
--- a/pym/gentoolkit/revdep_rebuild/collect.py
+++ b/pym/gentoolkit/revdep_rebuild/collect.py
@@ -5,7 +5,7 @@
 from __future__ import print_function
 
 import re
-import os
+from portage import os
 import glob
 import stat
 import sys


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-06-09 19:38 Slawek Lis
  0 siblings, 0 replies; 19+ messages in thread
From: Slawek Lis @ 2016-06-09 19:38 UTC (permalink / raw
  To: gentoo-commits

commit:     e1744420c7377dd28f9fbc1c6736e47c6c21bb85
Author:     Slawek Lis <slis <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 19:38:02 2016 +0000
Commit:     Slawek Lis <slis <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 19:38:02 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=e1744420

Excluding masked files from rebuilding. This should fix a bug #568902

 pym/gentoolkit/revdep_rebuild/analyse.py | 55 +++++++++++++++++++-------------
 1 file changed, 33 insertions(+), 22 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py
index c9c5f71..59240b4 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -116,7 +116,7 @@ def extract_dependencies_from_la(la, libraries, to_check, logger):
 
 
 class LibCheck(object):
-	def __init__(self, scanned_files, logger, searchlibs=None, searchbits=None):
+	def __init__(self, scanned_files, logger, searchlibs=None, searchbits=None, all_masks=None):
 		'''LibCheck init function.
 
 		@param scanned_files: optional dictionary if the type created by
@@ -130,6 +130,7 @@ class LibCheck(object):
 		self.logger = logger
 		self.searchlibs = searchlibs
 		self.searchbits = sorted(searchbits) or ['32', '64']
+		self.all_masks = all_masks
 		self.logger.debug("\tLibCheck.__init__(), new searchlibs: %s" %(self.searchbits))
 		if searchlibs:
 			self.smsg = '\tLibCheck.search(), Checking for %s bit dependants'
@@ -213,6 +214,12 @@ class LibCheck(object):
 				for filename, needed in filepaths.items():
 					for l in needed:
 						if self.check(l):
+							if l in self.all_masks:
+								self.logger.debug('\tLibrary %s ignored as it is masked' % l)
+								continue
+							if filename in self.all_masks:
+								self.logger.debug('\tFile %s ignored as it is masked' % filename)
+								continue
 							if not bits in found_libs:
 								found_libs[bits] = {}
 							try:
@@ -275,6 +282,26 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
 		_libs_to_check = set()'''
 	searchbits.update(['64', '32'])
 
+	masked_dirs, masked_files, ld = parse_revdep_config(settings['REVDEP_CONFDIR'])
+	masked_dirs.update([
+		'/lib/modules',
+		'/lib32/modules',
+		'/lib64/modules',
+		]
+	)
+
+	all_masks = masked_dirs.copy()
+	all_masks.update(masked_files)
+	logger.debug("\tall_masks:")
+	for x in sorted(all_masks):
+		logger.debug('\t\t%s' % (x))
+
+
+	if '64' not in searchbits:
+		masked_dirs.update(['/lib64', '/usr/lib64'])
+	elif '32' not in searchbits:
+		masked_dirs.update(['/lib32', '/usr/lib32'])
+
 	if libraries and la_libraries and libraries_links and binaries:
 		logger.info(blue(' * ') +
 			bold('Found a valid cache, skipping collecting phase'))
@@ -287,20 +314,8 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
 			bold('Collecting system binaries and libraries'))
 		bin_dirs, lib_dirs = prepare_search_dirs(logger, settings)
 
-		masked_dirs, masked_files, ld = \
-			parse_revdep_config(settings['REVDEP_CONFDIR'])
 		lib_dirs.update(ld)
 		bin_dirs.update(ld)
-		masked_dirs.update([
-			'/lib/modules',
-			'/lib32/modules',
-			'/lib64/modules',
-			]
-		)
-		if '64' not in searchbits:
-			masked_dirs.update(['/lib64', '/usr/lib64'])
-		elif '32' not in searchbits:
-			masked_dirs.update(['/lib32', '/usr/lib32'])
 
 		logger.debug('\tanalyse(), bin directories:')
 		for x in sorted(bin_dirs):
@@ -320,11 +335,6 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
 		stime = current_milli_time()
 		logger.info(green(' * ') +
 			bold('Collecting dynamic linking informations'))
-		all_masks = masked_dirs.copy()
-		all_masks.update(masked_files)
-		logger.debug("\tall_masks:")
-		for x in sorted(all_masks):
-			logger.debug('\t\t%s' % (x))
 
 		libraries, la_libraries, libraries_links = \
 			collect_libraries_from_dir(lib_dirs, all_masks, logger)
@@ -357,7 +367,7 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
 		% (len(libs_and_bins), len(libraries)+len(libraries_links))
 	)
 
-	libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits)
+	libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits, all_masks)
 
 	broken_pathes = libcheck.process_results(libcheck.search())
 
@@ -365,9 +375,10 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
 		libraries.union(libraries_links), _libs_to_check, logger)
 	broken_pathes += broken_la
 
-	logger.warning(green(' * ') + bold('Assign files to packages'))
-
-	return assign_packages(broken_pathes, logger, settings)
+	if broken_pathes:
+		logger.warning(green(' * ') + bold('Assign files to packages'))
+		return assign_packages(broken_pathes, logger, settings)
+	return None, None # no need to assign anything
 
 
 if __name__ == '__main__':


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-05-18 15:41 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2016-05-18 15:41 UTC (permalink / raw
  To: gentoo-commits

commit:     ecd20fa451e72e03aacd41c297b47de896043a5f
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 15:35:55 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed May 18 15:35:55 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=ecd20fa4

revdep-rebuild, assign.py: Trap an invalid cpv split bug 571782

Added a check for parts not being valid None or empty list from the catpkgsplit(cpv) call.
It will now log the warning with the invalid cpv.

 pym/gentoolkit/revdep_rebuild/assign.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pym/gentoolkit/revdep_rebuild/assign.py b/pym/gentoolkit/revdep_rebuild/assign.py
index 412ed49..8d819d6 100644
--- a/pym/gentoolkit/revdep_rebuild/assign.py
+++ b/pym/gentoolkit/revdep_rebuild/assign.py
@@ -103,6 +103,11 @@ def get_slotted_cps(cpvs, logger):
 	cps = []
 	for cpv in cpvs:
 		parts = catpkgsplit(cpv)
+		if not parts:
+			logger.warn(('\t' + red("Failed to split the following pkg: "
+				"%s, not a valid cat/pkg-ver" %cpv)))
+			continue
+
 		cp = parts[0] + '/' + parts[1]
 		try:
 			slot = portdb.aux_get(cpv, ["SLOT"])


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-05-18 15:41 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2016-05-18 15:41 UTC (permalink / raw
  To: gentoo-commits

commit:     44d972ef07970c5cb812aa0b061fb2235fc6b0d6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 15:40:42 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed May 18 15:40:42 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=44d972ef

revdep-rebuild: Replace the deprecated logger.war calls with logger.warning

 pym/gentoolkit/revdep_rebuild/analyse.py |  6 +++---
 pym/gentoolkit/revdep_rebuild/assign.py  | 14 +++++++-------
 pym/gentoolkit/revdep_rebuild/cache.py   |  2 +-
 pym/gentoolkit/revdep_rebuild/rebuild.py | 24 ++++++++++++------------
 pym/gentoolkit/revdep_rebuild/stuff.py   |  2 +-
 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


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-05-18 15:14 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2016-05-18 15:14 UTC (permalink / raw
  To: gentoo-commits

commit:     10c245fe9b72e5102d6ff553d2f87312c6be91ca
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 15:03:20 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed May 18 15:03:20 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=10c245fe

revdep-rebuild, settings.py: whitespace cleanup

 pym/gentoolkit/revdep_rebuild/settings.py | 56 +++++++++++++++----------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/settings.py b/pym/gentoolkit/revdep_rebuild/settings.py
index e9a021a..14f5bc8 100644
--- a/pym/gentoolkit/revdep_rebuild/settings.py
+++ b/pym/gentoolkit/revdep_rebuild/settings.py
@@ -51,59 +51,59 @@ def parse_options():
 	#are not appliable
 	from .rebuild import VERSION, APP_NAME
 	settings = DEFAULTS.copy()
-	
+
 	parser = argparse.ArgumentParser(
 		description='Broken reverse dependency rebuilder, python implementation.',
 		epilog='Calls emerge, options after -- are ignored by %s '
 				'and passed directly to emerge.' % APP_NAME,
 		add_help=False
 		)
-	
-	parser.add_argument('-h', '--help', 
-					 action='help', 
+
+	parser.add_argument('-h', '--help',
+					 action='help',
 					 help='Print this usage and exit')
-	parser.add_argument('-V', '--version', 
-					 action='version', 
+	parser.add_argument('-V', '--version',
+					 action='version',
 					 help='Show version informations',
 					 version='%(prog)s ' + VERSION)
-	
-	parser.add_argument('-i', '--ignore', 
-					 action='store_true', 
-					 help='Ignore temporary files from previous runs ' 
+
+	parser.add_argument('-i', '--ignore',
+					 action='store_true',
+					 help='Ignore temporary files from previous runs '
 						'(also won\'t create any)')
 
-	parser.add_argument('-L', '--library', 
-					 action='append', 
+	parser.add_argument('-L', '--library',
+					 action='append',
 					 help='Unconditionally emerge existing packages that use '
 						'the library with NAME. NAME can be a full path, full '
 						'or partial name')
-	parser.add_argument('-l', '--no-ld-path', 
-					 action='store_true', 
+	parser.add_argument('-l', '--no-ld-path',
+					 action='store_true',
 					 help='Do not set LD_LIBRARY_PATH')
-	parser.add_argument('-o', '--no-order', 
-					 action='store_true', 
+	parser.add_argument('-o', '--no-order',
+					 action='store_true',
 					 help='Do not check the build order '
 						'(Saves time, but may cause breakage.)')
-	parser.add_argument('-p', '--pretend', 
+	parser.add_argument('-p', '--pretend',
 					 action='store_true',
 					 help='Do a trial run without actually emerging anything '
-                        '(also passed to emerge command)')
+						'(also passed to emerge command)')
 
-	parser.add_argument('-C', '--nocolor', 
-					 action='store_true', 
+	parser.add_argument('-C', '--nocolor',
+					 action='store_true',
 					 help='Turn off colored output')
-	parser.add_argument('-q', '--quiet', 
-					 action='store_true', 
+	parser.add_argument('-q', '--quiet',
+					 action='store_true',
 					 help='Be less verbose (also passed to emerge command)')
-	parser.add_argument('-v', '--verbose', 
-					 action='store_true', 
+	parser.add_argument('-v', '--verbose',
+					 action='store_true',
 					 help='Be more verbose (also passed to emerge command)')
-	parser.add_argument('-d', '--debug', 
-					 action='store_true', 
+	parser.add_argument('-d', '--debug',
+					 action='store_true',
 					 help='Print debug informations')
-	
+
 	parser.add_argument('portage_options', nargs='*')
-	
+
 	args = parser.parse_args()
 	settings['VERBOSITY'] = 3 if args.debug else 2 if args.verbose else 0 if args.quiet else 1
 	settings['quiet'] = args.quiet


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-05-18  6:10 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2016-05-18  6:10 UTC (permalink / raw
  To: gentoo-commits

commit:     6f47784b6a706a51bddfdb0056b3d078a16ab80d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 06:06:46 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed May 18 06:08:41 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=6f47784b

revdep-rebuild/collect.py: Fix the masking issue where some masks were not honored

The masks at this point are combined into one list, both directories and files.
The code was only checking the full path, not the files for being in the masks.

 pym/gentoolkit/revdep_rebuild/collect.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/collect.py b/pym/gentoolkit/revdep_rebuild/collect.py
index 1b406e8..1f34f1c 100644
--- a/pym/gentoolkit/revdep_rebuild/collect.py
+++ b/pym/gentoolkit/revdep_rebuild/collect.py
@@ -110,9 +110,9 @@ def collect_libraries_from_dir(dirs, mask, logger):
 			continue
 
 		try:
-			for listing in os.listdir(_dir):
-				listing = os.path.join(_dir, listing)
-				if listing in mask:
+			for _listing in os.listdir(_dir):
+				listing = os.path.join(_dir, _listing)
+				if listing in mask or _listing in mask:
 					continue
 
 				if os.path.isdir(listing):
@@ -179,9 +179,9 @@ def collect_binaries_from_dir(dirs, mask, logger):
 			continue
 
 		try:
-			for listing in os.listdir(_dir):
-				listing = os.path.join(_dir, listing)
-				if listing in mask:
+			for _listing in os.listdir(_dir):
+				listing = os.path.join(_dir, _listing)
+				if listing in mask or _listing in mask:
 					continue
 
 				if os.path.isdir(listing):


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-02-25 21:26 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2016-02-25 21:26 UTC (permalink / raw
  To: gentoo-commits

commit:     1727a4ad664daa5b98d7e2e15af8cfc59d13f4dc
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 18 19:47:26 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Feb 25 21:24:55 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1727a4ad

revdep-rebuild/analyse.py: Add file masks to the collecting masks

file_masks appear to have been missed being added to the masks passed to the
collections functions.  Hopefully this will resolve most of the errors people are getting.
My testing, only bacula has any errors, but it does not work to add the offending symlink 
target lib to LD_LIBRARY_MASK. 

 pym/gentoolkit/revdep_rebuild/analyse.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py
index 92233ab..b9c18c0 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -320,9 +320,15 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
 		stime = current_milli_time()
 		logger.info(green(' * ') +
 			bold('Collecting dynamic linking informations'))
+		all_masks = masked_dirs.copy()
+		all_masks.update(masked_files)
+		logger.debug("\tall_masks:")
+		for x in sorted(all_masks):
+			logger.debug('\t\t%s' % (x))
+
 		libraries, la_libraries, libraries_links = \
-			collect_libraries_from_dir(lib_dirs, masked_dirs, logger)
-		binaries = collect_binaries_from_dir(bin_dirs, masked_dirs, logger)
+			collect_libraries_from_dir(lib_dirs, all_masks, logger)
+		binaries = collect_binaries_from_dir(bin_dirs, all_masks, logger)
 		ftime = current_milli_time()
 		logger.debug('\ttime to complete task: %d milliseconds' % (ftime-stime))
 


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2016-01-18  0:00 Jason Donenfeld
  0 siblings, 0 replies; 19+ messages in thread
From: Jason Donenfeld @ 2016-01-18  0:00 UTC (permalink / raw
  To: gentoo-commits

commit:     e9445aa398126c24c729cfb1e0d488d9b0db45ab
Author:     Jason A. Donenfeld <Jason <AT> zx2c4 <DOT> com>
AuthorDate: Mon Jan 18 00:01:01 2016 +0000
Commit:     Jason Donenfeld <zx2c4 <AT> gentoo <DOT> org>
CommitDate: Mon Jan 18 00:01:01 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=e9445aa3

revdep-rebuild: fix typo in bugs message

 pym/gentoolkit/revdep_rebuild/rebuild.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/revdep_rebuild/rebuild.py
index 417622e..fc57888 100644
--- a/pym/gentoolkit/revdep_rebuild/rebuild.py
+++ b/pym/gentoolkit/revdep_rebuild/rebuild.py
@@ -127,7 +127,7 @@ def main(settings=None, logger=None):
 		yellow('The original revdep-rebuild script is '
 			'installed as revdep-rebuild.sh'))
 	logger.warn(blue(' * ') +
-		yellow('Please files bugs at: '
+		yellow('Please file bugs at: '
 			'https://bugs.gentoo.org/'))
 
 	if os.getuid() != 0 and not settings['PRETEND']:


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2015-12-20  2:05 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-12-20  2:05 UTC (permalink / raw
  To: gentoo-commits

commit:     1fbd7ec8a46c359c5ef98168156a91ba05cf6a6f
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 20 02:03:43 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Dec 20 02:03:43 2015 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1fbd7ec8

revdep-rebuild/analyse.py: Account for more than 5 parts to report the error bug 586752

As suggested by Zac Medico, the %F output does have the possibility of containing spaces, breaking a space separated output.
Change the format string to delimit on a semicolon to split it on. 

Traceback:
File "/usr/lib64/python3.4/site-packages/gentoolkit/revdep_rebuild/analyse.py", line 47, in scan_files
    filename, sfilename, soname, needed, bits = parts
ValueError: too many values to unpack (expected 5)

 pym/gentoolkit/revdep_rebuild/analyse.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py
index 056e421..92233ab 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -31,7 +31,7 @@ def scan_files(libs_and_bins, cmd_max_args, logger, searchbits):
 	'''
 	stime = current_milli_time()
 	scanned_files = {} # {bits: {soname: (filename, needed), ...}, ...}
-	lines = scan(['-BF', '%F %f %S %n %M'],
+	lines = scan(['-BF', '%F;%f;%S;%n;%M'],
 				 libs_and_bins, cmd_max_args, logger)
 	ftime = current_milli_time()
 	logger.debug("\tscan_files(); total time to get scanelf data is "
@@ -39,8 +39,8 @@ def scan_files(libs_and_bins, cmd_max_args, logger, searchbits):
 	stime = current_milli_time()
 	count = 0
 	for line in lines:
-		parts = line.split(' ')
-		if len(parts) < 5:
+		parts = line.split(';')
+		if len(parts) != 5:
 			logger.error("\tscan_files(); error processing lib: %s" % line)
 			logger.error("\tscan_files(); parts = %s" % str(parts))
 			continue
@@ -205,7 +205,7 @@ class LibCheck(object):
 			try:
 				scanned = scanned_files[bits]
 			except KeyError:
-				self.logger.debug('There are no %s-bit libraries'%bits) 
+				self.logger.debug('There are no %s-bit libraries'%bits)
 				continue
 			self.logger.debug(self.smsg % bits)
 			self.setlibs(sorted(scanned), bits)


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
@ 2015-12-16 17:53 Brian Dolbec
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-12-16 17:53 UTC (permalink / raw
  To: gentoo-commits

commit:     2c238669fa5c7c59f503f869a7508584a2e00231
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 16 17:46:23 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Dec 16 17:46:23 2015 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=2c238669

revdep-rebuild: Adjust the intro message for a normal release

 pym/gentoolkit/revdep_rebuild/rebuild.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/revdep_rebuild/rebuild.py
index 23fa694..417622e 100644
--- a/pym/gentoolkit/revdep_rebuild/rebuild.py
+++ b/pym/gentoolkit/revdep_rebuild/rebuild.py
@@ -119,10 +119,10 @@ def main(settings=None, logger=None):
 	if not settings['stdout'].isatty() or settings['nocolor']:
 		nocolor()
 
-	#TODO: Development warning
 	logger.warn(blue(' * ') +
-		yellow('This is a prerelease version, '
-			'so it may not work correctly'))
+		yellow('This is the new python coded version'))
+	logger.warn(blue(' * ') +
+		yellow('Please report any bugs found using it.'))
 	logger.warn(blue(' * ') +
 		yellow('The original revdep-rebuild script is '
 			'installed as revdep-rebuild.sh'))


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-07-09  1:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-15 15:05 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2022-07-09  1:49 Mike Gilbert
2020-02-14 18:13 Zac Medico
2019-08-19  3:41 Zac Medico
2019-08-19  3:41 Zac Medico
2017-05-05 19:38 Paul Varner
2017-03-10 17:31 Zac Medico
2016-12-29 21:36 Jason Donenfeld
2016-09-15 15:05 Brian Dolbec
2016-08-15 21:06 Paul Varner
2016-06-09 19:38 Slawek Lis
2016-05-18 15:41 Brian Dolbec
2016-05-18 15:41 Brian Dolbec
2016-05-18 15:14 Brian Dolbec
2016-05-18  6:10 Brian Dolbec
2016-02-25 21:26 Brian Dolbec
2016-01-18  0:00 Jason Donenfeld
2015-12-20  2:05 Brian Dolbec
2015-12-16 17:53 Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox