aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-06-07 18:35:13 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-06-07 18:35:13 +0000
commit9be4e8df428772722cf77d2d7ca1cd60252990e0 (patch)
tree4eb9d76cac09110e012b0e59f4f82a095f07a673
parent74e3bdc8964518e4b5a47c95182eccedd5415624 (diff)
downloadpaludis-9be4e8df428772722cf77d2d7ca1cd60252990e0.tar.gz
paludis-9be4e8df428772722cf77d2d7ca1cd60252990e0.tar.xz
Add directories to LD_LIBRARY_PATH, to reduce false positives.
-rw-r--r--ruby/demos/check_linkage.rb28
1 files changed, 22 insertions, 6 deletions
diff --git a/ruby/demos/check_linkage.rb b/ruby/demos/check_linkage.rb
index 3dd5cc7..8ca4ebd 100644
--- a/ruby/demos/check_linkage.rb
+++ b/ruby/demos/check_linkage.rb
@@ -159,10 +159,12 @@ vars = read_shell_vars "/etc/profile.env"
prelim_search_dirs += (vars["PATH"] || "").split(/:/)
prelim_search_dirs += (vars["ROOTPATH"] || "").split(/:/)
+ld_so_conf = []
IO.foreach("/etc/ld.so.conf") do | line |
line.chomp!
- line =~ /^[^\s#]/ and prelim_search_dirs << line
+ line =~ /^[^\s#]/ and ld_so_conf << line
end
+prelim_search_dirs += ld_so_conf
@ld_library_mask = {}
prelim_ld_library_mask.each do | mask |
@@ -190,27 +192,41 @@ env = Paludis::EnvironmentMaker.instance.make_from_spec env_spec
status "Checking linkage for package-manager installed files"
-broken = [ ]
+
+files = { }
+directories = { }
env.package_database.repositories.each do | repo |
(repo.installed_interface and repo.contents_interface) or next
repo.category_names.each do | cat |
repo.package_names(cat).each do | pkg |
repo.version_specs(pkg).each do | ver |
+ package = Paludis::PackageDatabaseEntry.new(pkg, ver, repo.name)
repo.contents(pkg, ver).entries.each do | entry |
entry.kind_of? Paludis::ContentsFileEntry or next
eligible?(entry.name) or next
(entry.name =~ /\.(la|so|so\..*)$/ or executable(entry.name)) or next
- check_file entry.name or next
- puts " * #{entry.name} is broken" if verbose
- broken << Paludis::PackageDatabaseEntry.new(pkg, ver, repo.name)
- break
+ files[package] ||= []
+ files[package] << entry.name
+ directories[File.dirname(entry.name)] = true
end
end
end
end
end
+ENV["LD_LIBRARY_PATH"] = (Dir["/lib*"] + Dir["/usr/lib*"] + ld_so_conf + directories.keys).join(":")
+
+broken = [ ]
+files.each_pair do | package, files |
+ files.each do | filename |
+ check_file filename or next
+ puts " * #{filename} is broken" if verbose
+ broken << package
+ break
+ end
+end
+
broken = broken.find_all { | x | x }.sort { | x, y | x.to_s <=> y.to_s }.uniq_using { | x | x.to_s }
if broken.empty?