public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Paul Varner" <fuzzyray@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/revdep_rebuild/
Date: Tue, 12 Jul 2011 21:45:27 +0000 (UTC)	[thread overview]
Message-ID: <8d6b825b2d8e5eb69568619223721ae5c7e0aa07.fuzzyray@gentoo> (raw)

commit:     8d6b825b2d8e5eb69568619223721ae5c7e0aa07
Author:     Slawek <lis.slawek <AT> gmail <DOT> com>
AuthorDate: Tue Apr 26 07:08:24 2011 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 21:29:01 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=8d6b825b

Fixed .la files parser. Some minor logging fixes.

---
 pym/gentoolkit/revdep_rebuild/analyse.py |   23 ++++++++++++++++++-----
 pym/gentoolkit/revdep_rebuild/collect.py |    6 +++---
 pym/gentoolkit/revdep_rebuild/rebuild.py |    4 ++--
 3 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py
index 521d8b9..be696d1 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -40,6 +40,15 @@ def prepare_checks(files_to_check, libraries, bits, cmd_max_args):
 
 def extract_dependencies_from_la(la, libraries, to_check, logger):
 	broken = []
+
+	libnames = []
+	for l in libraries:
+		m = re.match('.+\/(.+)\.(so|la|a)(\..+)?', l)
+		if m is not None:
+			ln = m.group(1)
+			if ln not in libnames:
+				libnames += [ln, ]
+
 	for f in la:
 		if not os.path.exists(f):
 			continue
@@ -51,10 +60,12 @@ def extract_dependencies_from_la(la, libraries, to_check, logger):
 				if m is not None:
 					for el in m.group(1).split(' '):
 						el = el.strip()
-						if len(el) < 1 or el.startswith('-'):
+						if len(el) < 1 or el.startswith('-L'):
 							continue
 
-						if el in la or el in libraries:
+						if el.startswith('-l') and 'lib'+el[2:] in libnames:
+							pass
+						elif el in la or el in libraries:
 							pass
 						else:
 							if to_check:
@@ -66,7 +77,7 @@ def extract_dependencies_from_la(la, libraries, to_check, logger):
 								if not _break:
 									continue
 
-							logger.info(yellow(' * ') + f + ' is broken (requires: ' + bold(el))
+							logger.info(yellow(' * ') + f + ' is broken (requires: ' + bold(el)+')')
 							broken.append(f)
 	return broken
 
@@ -178,13 +189,15 @@ def analyse(settings, logger, libraries=None, la_libraries=None,
 		#call_program(['scanelf', '-M', str(bits), '-BF', '%F',] + libraries+libraries_links).strip().split('\n')
 
 		found_libs, dependencies = prepare_checks(libs_and_bins, _libraries, bits, settings['CMD_MAX_ARGS'])
-
+		#print dependencies
 		broken = find_broken(found_libs, _libraries, _libs_to_check)
-		broken_la = extract_dependencies_from_la(la_libraries, _libraries, _libs_to_check, logger)
 
 		bits /= 2
 		bits = int(bits)
 
+	broken_la = extract_dependencies_from_la(la_libraries, libraries+libraries_links, _libs_to_check, logger)
+
+
 	broken_pathes = main_checks(found_libs, broken, dependencies, logger)
 	broken_pathes += broken_la
 

diff --git a/pym/gentoolkit/revdep_rebuild/collect.py b/pym/gentoolkit/revdep_rebuild/collect.py
index b408edc..b7ed469 100644
--- a/pym/gentoolkit/revdep_rebuild/collect.py
+++ b/pym/gentoolkit/revdep_rebuild/collect.py
@@ -172,7 +172,7 @@ def collect_libraries_from_dir(dirs, mask, logger):
 									prv & stat.S_IXOTH == stat.S_IXOTH:
 								found_files.append(l)
 		except Exception as ex:
-			logger.debug(yellow('Exception during collecting libraries: %s' %str(ex)))
+			logger.debug(yellow('Exception during collecting libraries: ' + blue('%s')  %str(ex)))
 
 
 	if found_directories:
@@ -219,7 +219,7 @@ def collect_binaries_from_dir(dirs, mask, logger):
 								prv & stat.S_IXOTH == stat.S_IXOTH:
 							found_files.append(l)
 		except Exception as e:
-			logger.debug(yellow('Exception during binaries collecting: %s' %str(e)))
+			logger.debug(yellow('Exception during binaries collecting: '+blue('%s') %str(e)))
 
 	if found_directories:
 		found_files += collect_binaries_from_dir(found_directories, mask, logger)
@@ -240,7 +240,7 @@ if __name__ == '__main__':
 	libraries, la_libraries, libraries_links, symlink_pairs = collect_libraries_from_dir(lib_dirs, masked_dirs, logging)
 	binaries = collect_binaries_from_dir(bin_dirs, masked_dirs, logging)
 
-	print 'Found: %i binaries and %i libraries.' %(len(binaries), len(libraries))
+	logging.debug('Found: %i binaries and %i libraries.' %(len(binaries), len(libraries)))
 
 
 

diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/revdep_rebuild/rebuild.py
index ef3a476..f77d98c 100644
--- a/pym/gentoolkit/revdep_rebuild/rebuild.py
+++ b/pym/gentoolkit/revdep_rebuild/rebuild.py
@@ -32,7 +32,7 @@ from settings import DEFAULTS
 
 
 APP_NAME = sys.argv[0]
-VERSION = '0.1-r6'
+VERSION = '0.1-r7'
 
 __productname__ = "revdep-ng"
 
@@ -232,5 +232,5 @@ def main(settings=None, logger=None):
 			'again or manually emerge given packages.')
 
 	success = rebuild(logger, assigned, settings)
-	logger.debug("rebuild return code =", success)
+	logger.debug("rebuild return code = %i" %success)
 	return success



             reply	other threads:[~2011-07-12 21:46 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 21:45 Paul Varner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-05-27 17:27 [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/revdep_rebuild/ Mike Gilbert
2014-11-12 21:29 Paul Varner
2014-11-12  7:16 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-11-07 20:41 Slawek Lis
2014-10-30 18:56 Paul Varner
2014-08-28  7:37 Slawek Lis
2014-03-27  6:59 Slawek Lis
2014-03-26  8:21 Slawek Lis
2014-03-24  7:17 Slawek Lis
2014-03-24  7:17 Slawek Lis
2014-03-17  6:50 Slawek Lis
2014-03-17  6:50 Slawek Lis
2014-03-11 21:43 Paul Varner
2014-03-11 21:22 Paul Varner
2014-02-19  5:01 Brian Dolbec
2014-02-19  4:33 Brian Dolbec
2014-02-19  4:33 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-19  3:14 Brian Dolbec
2014-02-18 18:51 Brian Dolbec
2014-02-18 18:51 Brian Dolbec
2014-02-18 17:59 Brian Dolbec
2014-02-18 17:23 Brian Dolbec
2014-02-18  7:30 Brian Dolbec
2014-02-18  6:15 Brian Dolbec
2014-02-17 10:31 Slawek Lis
2014-02-17  8:50 Slawek Lis
2014-02-16 20:55 Brian Dolbec
2014-02-13 22:08 Paul Varner
2014-02-12 21:12 Paul Varner
2014-02-12 16:20 Brian Dolbec
2014-02-12 16:20 Brian Dolbec
2014-02-12 10:42 Brian Dolbec
2014-02-12 10:22 Brian Dolbec
2014-02-12 10:22 Brian Dolbec
2014-02-12 10:22 Brian Dolbec
2014-02-12 10:22 Brian Dolbec
2014-02-11 19:39 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11 18:49 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2014-02-11  8:40 Brian Dolbec
2012-11-09 14:16 Paul Varner
2012-03-19  6:50 Brian Dolbec
2012-03-04  7:41 Brian Dolbec
2012-03-02 17:47 Brian Dolbec
2011-10-10 17:36 Brian Dolbec
2011-10-10 16:09 Brian Dolbec
2011-07-14 18:29 Paul Varner
2011-07-14 18:29 Paul Varner
2011-07-14  2:32 Paul Varner
2011-07-14  1:44 Brian Dolbec
2011-07-14  1:44 Brian Dolbec
2011-07-13 20:06 Paul Varner
2011-07-13 16:01 Paul Varner
2011-07-13 15:35 Brian Dolbec
2011-07-13  5:53 Brian Dolbec
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner
2011-07-12 21:45 Paul Varner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d6b825b2d8e5eb69568619223721ae5c7e0aa07.fuzzyray@gentoo \
    --to=fuzzyray@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox