aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2010-08-17 23:13:26 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2010-08-17 23:13:26 +0100
commitfd97abd6755edd293b7c28fbdfdc06bff5b58ab0 (patch)
treef3b925c6cfc8ccce39cd83f8be16ea123b2272bd
parentcb75f47b4cb9e01cffe10037dfbd3e5955d882d3 (diff)
downloadpaludis-fd97abd6755edd293b7c28fbdfdc06bff5b58ab0.tar.gz
paludis-fd97abd6755edd293b7c28fbdfdc06bff5b58ab0.tar.xz
Fix epic fail
-rw-r--r--paludis/broken_linkage_finder.cc3
-rw-r--r--paludis/elf_linkage_checker.cc20
-rw-r--r--paludis/elf_linkage_checker.hh2
3 files changed, 13 insertions, 12 deletions
diff --git a/paludis/broken_linkage_finder.cc b/paludis/broken_linkage_finder.cc
index 0c21739..9d39c5e 100644
--- a/paludis/broken_linkage_finder.cc
+++ b/paludis/broken_linkage_finder.cc
@@ -146,8 +146,7 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::sha
Context ctx("When checking for broken linkage in '" + stringify(env->preferred_root_key()->value()) + "':");
- for (auto i(libraries->begin()), i_end(libraries->end()) ; i != i_end ; ++i)
- _imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<ElfLinkageChecker>(env->preferred_root_key()->value(), *i)));
+ _imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<ElfLinkageChecker>(env->preferred_root_key()->value(), libraries)));
if (libraries->empty())
_imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<LibtoolLinkageChecker>(env->preferred_root_key()->value())));
diff --git a/paludis/elf_linkage_checker.cc b/paludis/elf_linkage_checker.cc
index a3959b1..fc3576d 100644
--- a/paludis/elf_linkage_checker.cc
+++ b/paludis/elf_linkage_checker.cc
@@ -32,6 +32,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -105,7 +106,7 @@ namespace paludis
struct Imp<ElfLinkageChecker>
{
FSEntry root;
- std::string library;
+ std::set<std::string> check_libraries;
Mutex mutex;
@@ -121,16 +122,17 @@ namespace paludis
void handle_library(const FSEntry &, const ElfArchitecture &);
template <typename> bool check_extra_elf(const FSEntry &, std::istream &, std::set<ElfArchitecture> &);
- Imp(const FSEntry & the_root, const std::string & the_library) :
- root(the_root),
- library(the_library)
+ Imp(const FSEntry & the_root, const std::shared_ptr<const Sequence<std::string>> & the_libraries) :
+ root(the_root)
{
+ for (auto it(the_libraries->begin()), it_end(the_libraries->end()); it_end != it; ++it)
+ check_libraries.insert(*it);
}
};
}
-ElfLinkageChecker::ElfLinkageChecker(const FSEntry & root, const std::string & library) :
- Pimp<ElfLinkageChecker>(root, library)
+ElfLinkageChecker::ElfLinkageChecker(const FSEntry & root, const std::shared_ptr<const Sequence<std::string>> & libraries) :
+ Pimp<ElfLinkageChecker>(root, libraries)
{
}
@@ -175,7 +177,7 @@ Imp<ElfLinkageChecker>::check_elf(const FSEntry & file, std::istream & stream)
Lock l(mutex);
- if (library.empty() && ET_DYN == elf.get_type())
+ if (check_libraries.empty() && ET_DYN == elf.get_type())
handle_library(file, arch);
for (typename ElfObject<ElfType_>::SectionIterator sec_it(elf.section_begin()),
@@ -192,7 +194,7 @@ Imp<ElfLinkageChecker>::check_elf(const FSEntry & file, std::istream & stream)
if (0 != ent_str && "NEEDED" == ent_str->tag_name())
{
const std::string & req((*ent_str)());
- if (library.empty() || library == req)
+ if (check_libraries.empty() || check_libraries.end() != check_libraries.find(req))
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.depends", ll_debug, lc_context)
<< "File depends on " << req;
@@ -231,7 +233,7 @@ Imp<ElfLinkageChecker>::handle_library(const FSEntry & file, const ElfArchitectu
void
ElfLinkageChecker::note_symlink(const FSEntry & link, const FSEntry & target)
{
- if (_imp->library.empty())
+ if (_imp->check_libraries.empty())
{
Lock l(_imp->mutex);
diff --git a/paludis/elf_linkage_checker.hh b/paludis/elf_linkage_checker.hh
index ec4493a..13c502c 100644
--- a/paludis/elf_linkage_checker.hh
+++ b/paludis/elf_linkage_checker.hh
@@ -32,7 +32,7 @@ namespace paludis
private paludis::Pimp<ElfLinkageChecker>
{
public:
- ElfLinkageChecker(const paludis::FSEntry &, const std::string &);
+ ElfLinkageChecker(const paludis::FSEntry &, const std::shared_ptr<const Sequence<std::string>> &);
virtual ~ElfLinkageChecker();
virtual bool check_file(const paludis::FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));