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:24 +0000 (UTC) [thread overview]
Message-ID: <016a60ce9a134f1dba61bcbae6e0b5a286cf6c90.fuzzyray@gentoo> (raw)
commit: 016a60ce9a134f1dba61bcbae6e0b5a286cf6c90
Author: lis.slawek <lis.slawek <AT> 5234894e-44cd-11de-9a4c-a76526a193c6>
AuthorDate: Thu Nov 18 07:26:14 2010 +0000
Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 21:29:00 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=016a60ce
Fixed problem with 32/64 bit libraries and binaries
git-svn-id: http://genscripts.googlecode.com/svn/trunk/gentoolkit@484 5234894e-44cd-11de-9a4c-a76526a193c6
---
pym/gentoolkit/revdep_rebuild/revdep-rebuild.py | 44 ++++++++++++++++++-----
1 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/pym/gentoolkit/revdep_rebuild/revdep-rebuild.py b/pym/gentoolkit/revdep_rebuild/revdep-rebuild.py
index fb864da..0bc006e 100755
--- a/pym/gentoolkit/revdep_rebuild/revdep-rebuild.py
+++ b/pym/gentoolkit/revdep_rebuild/revdep-rebuild.py
@@ -20,11 +20,12 @@ import stat
import time
import glob
import portage
+import platform
from portage import portdb
from portage.output import bold, red, blue, yellow, green, nocolor
APP_NAME = sys.argv[0]
-VERSION = '0.1-r2'
+VERSION = '0.1-r3'
__productname__ = "revdep-ng"
@@ -342,14 +343,15 @@ def _match_str_in_list(lst, stri):
return False
-def prepare_checks(files_to_check, libraries):
- ''' Calls scanelf for all files_to_check, then returns found libraries and dependencies '''
+def prepare_checks(files_to_check, libraries, bits):
+ ''' Calls scanelf for all files_to_check, then returns found libraries and dependencies
+ '''
libs = [] # libs found by scanelf
dependencies = [] # list of lists of files (from file_to_check) that uses
# library (for dependencies[id] and libs[id] => id==id)
- for line in call_program(['scanelf', '-nBF', '%F %n',]+files_to_check).strip().split('\n'):
+ for line in call_program(['scanelf', '-M', str(bits), '-nBF', '%F %n',]+files_to_check).strip().split('\n'):
r = line.strip().split(' ')
if len(r) < 2: # no dependencies?
continue
@@ -368,6 +370,9 @@ def prepare_checks(files_to_check, libraries):
def extract_dependencies_from_la(la, libraries, to_check):
broken = []
for f in la:
+ if not os.path.exists(f):
+ continue
+
for line in open(f, 'r').readlines():
line = line.strip()
if line.startswith('dependency_libs='):
@@ -417,7 +422,6 @@ def find_broken(found_libs, system_libraries, to_check):
for f in found_libs:
if tc in f and f+'|' not in sl:
broken.append(found_libs.index(f))
- #print broken
return broken
@@ -596,10 +600,32 @@ def analyse(output=print_v, libraries=None, la_libraries=None, libraries_links=N
output(2,'Search for ' + str(len(binaries)+len(libraries)) + ' within ' + str(len(libraries)+len(libraries_links)))
libs_and_bins = libraries+binaries
- found_libs, dependencies = prepare_checks(libs_and_bins, libraries+libraries_links)
+ #l = []
+ #for line in call_program(['scanelf', '-M', '64', '-BF', '%F',] + libraries).strip().split('\n'):
+ #l.append(line)
+ #libraries = l
+
+ found_libs = []
+ dependencies = []
+
+
+ _bits, linkg = platform.architecture()
+ if _bits.startswith('32'):
+ bits = 32
+ elif _bits.startswith('64'):
+ bits = 64
+
+ for av_bits in glob.glob('/lib[0-9]*'):
+ bits = int(av_bits[4:])
+ _libraries = call_program(['scanelf', '-M', str(bits), '-BF', '%F',] + libraries+libraries_links).strip().split('\n')
+
+ found_libs, dependencies = prepare_checks(libs_and_bins, _libraries, bits)
+
+ broken = find_broken(found_libs, _libraries, _libs_to_check)
+ broken_la = extract_dependencies_from_la(la_libraries, _libraries, _libs_to_check)
- broken = find_broken(found_libs, libraries+libraries_links, _libs_to_check)
- broken_la = extract_dependencies_from_la(la_libraries, libraries+libraries_links, _libs_to_check)
+ bits /= 2
+ bits = int(bits)
broken_pathes = main_checks(found_libs, broken, dependencies)
broken_pathes += broken_la
@@ -646,7 +672,7 @@ if __name__ == "__main__":
opts, args = getopt.getopt(sys.argv[1:], 'dehiklopqvCL:P', ['nocolor', 'debug', 'exact', 'help', 'ignore',\
'keep-temp', 'library=', 'no-ld-path', 'no-order', 'pretend', 'no-pretend', 'no-progress', 'quiet', 'verbose'])
- for key,val in opts:
+ for key, val in opts:
if key in ('-h', '--help'):
print_usage()
sys.exit(0)
next 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=016a60ce9a134f1dba61bcbae6e0b5a286cf6c90.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