aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-03-23 16:23:16 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-03-23 16:23:43 +0000
commit21e8e56a7cb657ced234c0eb0bba3253c8f02616 (patch)
tree3ae23e3bf844b255600ecab8d2b5bc4fe4ae4a7b /src
parent3dec9c48b1e0c0b79bdeb0afe4e4e8e8362cef88 (diff)
downloadpaludis-21e8e56a7cb657ced234c0eb0bba3253c8f02616.tar.gz
paludis-21e8e56a7cb657ced234c0eb0bba3253c8f02616.tar.xz
Move broken_linkage_finder to paludis/
Diffstat (limited to 'src')
-rw-r--r--src/clients/reconcilio/Makefile.am3
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc447
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh67
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/configuration.cc357
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/configuration.hh61
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/configuration_TEST.cc73
-rwxr-xr-xsrc/clients/reconcilio/broken_linkage_finder/configuration_TEST_cleanup.sh11
-rwxr-xr-xsrc/clients/reconcilio/broken_linkage_finder/configuration_TEST_setup.sh28
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc369
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.hh49
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc167
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.hh47
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/linkage_checker.cc31
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/linkage_checker.hh54
-rw-r--r--src/clients/reconcilio/fix_linkage.cc3
15 files changed, 2 insertions, 1765 deletions
diff --git a/src/clients/reconcilio/Makefile.am b/src/clients/reconcilio/Makefile.am
index d273d279e..9a5d4a494 100644
--- a/src/clients/reconcilio/Makefile.am
+++ b/src/clients/reconcilio/Makefile.am
@@ -3,7 +3,7 @@ include $(top_srcdir)/misc/common-makefile.am
AM_CXXFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src \
@PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
-SUBDIRS = broken_linkage_finder .
+SUBDIRS = .
bin_PROGRAMS = reconcilio
noinst_PROGRAMS = man-reconcilio
@@ -32,7 +32,6 @@ reconcilio_SOURCES = \
reconcilio.cc
reconcilio_LDADD = \
- broken_linkage_finder/libbrokenlinkagefinder.a \
$(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
$(top_builddir)/paludis/args/libpaludisargs_@PALUDIS_PC_SLOT@.la \
$(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
diff --git a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
deleted file mode 100644
index bb8a502f6..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
+++ /dev/null
@@ -1,447 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "broken_linkage_finder.hh"
-#include "configuration.hh"
-#include "elf_linkage_checker.hh"
-#include "libtool_linkage_checker.hh"
-#include "linkage_checker.hh"
-
-#include <paludis/util/realpath.hh>
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/mutex.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/set-impl.hh>
-#include <paludis/util/sequence-impl.hh>
-#include <paludis/util/simple_visitor_cast.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/member_iterator-impl.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
-
-#include <paludis/contents.hh>
-#include <paludis/environment.hh>
-#include <paludis/metadata_key.hh>
-#include <paludis/package_database.hh>
-#include <paludis/package_id.hh>
-#include <paludis/generator.hh>
-#include <paludis/filter.hh>
-#include <paludis/filtered_generator.hh>
-#include <paludis/selection.hh>
-
-#include <tr1/functional>
-#include <algorithm>
-#include <iterator>
-#include <map>
-#include <set>
-#include <vector>
-
-using namespace paludis;
-using namespace broken_linkage_finder;
-
-typedef std::multimap<FSEntry, std::tr1::shared_ptr<const PackageID> > Files;
-typedef std::map<FSEntry, std::set<std::string> > PackageBreakage;
-typedef std::map<std::tr1::shared_ptr<const PackageID>, PackageBreakage, PackageIDSetComparator> Breakage;
-
-namespace paludis
-{
- template <>
- struct Implementation<BrokenLinkageFinder>
- {
- const Environment * env;
- const Configuration config;
- std::string library;
-
- std::vector<std::tr1::shared_ptr<LinkageChecker> > checkers;
- std::set<FSEntry> extra_lib_dirs;
-
- Mutex mutex;
-
- bool has_files;
- Files files;
-
- Breakage breakage;
- PackageBreakage orphan_breakage;
-
- void search_directory(const FSEntry &);
-
- void walk_directory(const FSEntry &);
- void check_file(const FSEntry &);
-
- void add_breakage(const FSEntry &, const std::string &);
- void gather_package(const std::tr1::shared_ptr<const PackageID> &);
-
- Implementation(const Environment * the_env, const std::string & the_library) :
- env(the_env),
- config(the_env->root()),
- library(the_library),
- has_files(false)
- {
- }
- };
-
- template <>
- struct WrappedForwardIteratorTraits<BrokenLinkageFinder::BrokenPackageConstIteratorTag>
- {
- typedef FirstIteratorTypes<Breakage::const_iterator>::Type UnderlyingIterator;
- };
-
- template <>
- struct WrappedForwardIteratorTraits<BrokenLinkageFinder::BrokenFileConstIteratorTag>
- {
- typedef FirstIteratorTypes<PackageBreakage::const_iterator>::Type UnderlyingIterator;
- };
-
- template <>
- struct WrappedForwardIteratorTraits<BrokenLinkageFinder::MissingRequirementConstIteratorTag>
- {
- typedef std::set<std::string>::const_iterator UnderlyingIterator;
- };
-}
-
-namespace
-{
- const std::map<FSEntry, std::set<std::string> > no_files;
- const std::set<std::string> no_reqs;
-
- struct ParentOf : std::unary_function<FSEntry, bool>
- {
- const FSEntry & _child;
-
- ParentOf(const FSEntry & child) :
- _child(child)
- {
- }
-
- bool operator() (const FSEntry & parent)
- {
- std::string child_str(stringify(_child)), parent_str(stringify(parent));
- return 0 == child_str.compare(0, parent_str.length(), parent_str) &&
- (parent_str.length() == child_str.length() || '/' == child_str[parent_str.length()]);
- }
- };
-}
-
-BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::string & library) :
- PrivateImplementationPattern<BrokenLinkageFinder>(new Implementation<BrokenLinkageFinder>(env, library))
-{
- using namespace std::tr1::placeholders;
-
- Context ctx("When checking for broken linkage in '" + stringify(env->root()) + "':");
-
- _imp->checkers.push_back(std::tr1::shared_ptr<LinkageChecker>(new ElfLinkageChecker(env->root(), library)));
- if (library.empty())
- _imp->checkers.push_back(std::tr1::shared_ptr<LinkageChecker>(new LibtoolLinkageChecker(env->root())));
-
- std::vector<FSEntry> search_dirs_nosyms, search_dirs_pruned;
- std::transform(_imp->config.begin_search_dirs(), _imp->config.end_search_dirs(),
- std::back_inserter(search_dirs_nosyms),
- std::tr1::bind(realpath_with_current_and_root, _1, FSEntry("/"), env->root()));
- std::sort(search_dirs_nosyms.begin(), search_dirs_nosyms.end());
-
- for (std::vector<FSEntry>::const_iterator it(search_dirs_nosyms.begin()),
- it_end(search_dirs_nosyms.end()); it_end != it; ++it)
- if (search_dirs_pruned.end() ==
- std::find_if(search_dirs_pruned.begin(), search_dirs_pruned.end(),
- ParentOf(*it)))
- search_dirs_pruned.push_back(*it);
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config",
- ll_debug, lc_context) << "After resolving symlinks and pruning subdirectories, SEARCH_DIRS=\"" <<
- join(search_dirs_pruned.begin(), search_dirs_pruned.end(), " ") << "\"";
-
- std::transform(_imp->config.begin_ld_so_conf(), _imp->config.end_ld_so_conf(),
- std::inserter(_imp->extra_lib_dirs, _imp->extra_lib_dirs.begin()),
- std::tr1::bind(realpath_with_current_and_root, _1, FSEntry("/"), env->root()));
-
- std::for_each(search_dirs_pruned.begin(), search_dirs_pruned.end(),
- std::tr1::bind(&Implementation<BrokenLinkageFinder>::search_directory, _imp.get(), _1));
-
- for (std::set<FSEntry>::const_iterator it(_imp->extra_lib_dirs.begin()),
- it_end(_imp->extra_lib_dirs.end()); it_end != it; ++it)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
- << "Need to check for extra libraries in '" << (env->root() / *it) << "'";
- std::for_each(indirect_iterator(_imp->checkers.begin()), indirect_iterator(_imp->checkers.end()),
- std::tr1::bind(&LinkageChecker::add_extra_lib_dir, _1, env->root() / *it));
- }
-
- std::tr1::function<void (const FSEntry &, const std::string &)> callback(
- std::tr1::bind(&Implementation<BrokenLinkageFinder>::add_breakage, _imp.get(), _1, _2));
- std::for_each(indirect_iterator(_imp->checkers.begin()), indirect_iterator(_imp->checkers.end()),
- std::tr1::bind(&LinkageChecker::need_breakage_added, _1, callback));
-
- _imp->checkers.clear();
-}
-
-BrokenLinkageFinder::~BrokenLinkageFinder()
-{
-}
-
-void
-Implementation<BrokenLinkageFinder>::search_directory(const FSEntry & directory)
-{
- FSEntry dir(directory);
- do
- {
- dir = dir.dirname();
- if (config.dir_is_masked(dir))
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.skipping", ll_debug, lc_context)
- << "Skipping '" << directory << "' because '" << dir << "' is search-masked";
- return;
- }
- }
- while (FSEntry("/") != dir);
-
- FSEntry with_root(env->root() / directory);
- if (with_root.is_directory())
- walk_directory(with_root);
- else
- Log::get_instance()->message("reconcilio.broken_linkage_finder.missing", ll_debug, lc_context)
- << "'" << directory << "' is missing or not a directory";
-}
-
-void
-Implementation<BrokenLinkageFinder>::walk_directory(const FSEntry & directory)
-{
- using namespace std::tr1::placeholders;
-
- FSEntry without_root(directory.strip_leading(env->root()));
- if (config.dir_is_masked(without_root))
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.masked", ll_debug, lc_context)
- << "'" << directory << "' is search-masked";
- return;
- }
-
- Log::get_instance()->message("reconcilio.broken_linkage_finder.entering", ll_debug, lc_context)
- << "Entering directory '" << directory << "'";
- {
- Lock l(mutex);
- extra_lib_dirs.erase(without_root);
- }
-
- try
- {
- std::for_each(DirIterator(directory, DirIteratorOptions() + dio_include_dotfiles + dio_inode_sort), DirIterator(),
- std::tr1::bind(&Implementation<BrokenLinkageFinder>::check_file, this, _1));
- }
- catch (const FSError & ex)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_no_context) << ex.message();
- }
-}
-
-void
-Implementation<BrokenLinkageFinder>::check_file(const FSEntry & file)
-{
- using namespace std::tr1::placeholders;
-
- try
- {
- if (file.is_symbolic_link())
- {
- FSEntry target(dereference_with_root(file, env->root()));
- if (target.is_regular_file())
- {
- std::for_each(indirect_iterator(checkers.begin()), indirect_iterator(checkers.end()),
- std::tr1::bind(&LinkageChecker::note_symlink, _1, file, target));
- }
- }
-
- else if (file.is_directory())
- walk_directory(file);
-
- else if (file.is_regular_file())
- {
- if (indirect_iterator(checkers.end()) ==
- std::find_if(indirect_iterator(checkers.begin()), indirect_iterator(checkers.end()),
- std::tr1::bind(&LinkageChecker::check_file, _1, file)))
- Log::get_instance()->message("reconcilio.broken_linkage_finder.unrecognised", ll_debug, lc_context)
- << "'" << file << "' is not a recognised file type";
- }
- }
- catch (const FSError & ex)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_no_context) << ex.message();
- }
-}
-
-void
-Implementation<BrokenLinkageFinder>::add_breakage(const FSEntry & file, const std::string & req)
-{
- using namespace std::tr1::placeholders;
-
- if (library.empty() && config.lib_is_masked(req))
- return;
-
- if (! has_files)
- {
- has_files = true;
-
- Context ctx("When building map from files to packages:");
-
- std::tr1::shared_ptr<const PackageIDSequence> pkgs((*env)[selection::AllVersionsUnsorted(
- generator::All() | filter::InstalledAtRoot(env->root()))]);
-
- std::for_each(pkgs->begin(), pkgs->end(),
- std::tr1::bind(&Implementation<BrokenLinkageFinder>::gather_package, this, _1));
- }
-
- FSEntry without_root(file.strip_leading(env->root()));
- std::pair<Files::const_iterator, Files::const_iterator> range(files.equal_range(without_root));
- if (range.first == range.second)
- orphan_breakage[without_root].insert(req);
- else
- while (range.first != range.second)
- {
- breakage[range.first->second][without_root].insert(req);
- ++range.first;
- }
-}
-
-void
-Implementation<BrokenLinkageFinder>::gather_package(const std::tr1::shared_ptr<const PackageID> & pkg)
-{
- using namespace std::tr1::placeholders;
-
- Context ctx("When gathering the contents of " + stringify(*pkg) + ":");
-
- std::tr1::shared_ptr<const MetadataValueKey<std::tr1::shared_ptr<const Contents> > > key(pkg->contents_key());
- if (! key)
- return;
- std::tr1::shared_ptr<const Contents> contents(key->value());
- if (! contents)
- return;
-
- for (Contents::ConstIterator it(contents->begin()),
- it_end(contents->end()); it_end != it; ++it)
- {
- const ContentsFileEntry * file(simple_visitor_cast<const ContentsFileEntry>(**it));
- if (0 != file)
- {
- Lock l(mutex);
- files.insert(std::make_pair(stringify(file->location_key()->value()), pkg));
- }
- }
-
- pkg->can_drop_in_memory_cache();
-}
-
-BrokenLinkageFinder::BrokenPackageConstIterator
-BrokenLinkageFinder::begin_broken_packages() const
-{
- return BrokenPackageConstIterator(first_iterator(_imp->breakage.begin()));
-}
-
-BrokenLinkageFinder::BrokenPackageConstIterator
-BrokenLinkageFinder::end_broken_packages() const
-{
- return BrokenPackageConstIterator(first_iterator(_imp->breakage.end()));
-}
-
-BrokenLinkageFinder::BrokenFileConstIterator
-BrokenLinkageFinder::begin_broken_files(const std::tr1::shared_ptr<const PackageID> & pkg) const
-{
- if (pkg)
- {
- Breakage::const_iterator it(_imp->breakage.find(pkg));
- if (_imp->breakage.end() == it)
- return BrokenFileConstIterator(no_files.begin());
-
- return BrokenFileConstIterator(first_iterator(it->second.begin()));
- }
- else
- return BrokenFileConstIterator(first_iterator(_imp->orphan_breakage.begin()));
-}
-
-BrokenLinkageFinder::BrokenFileConstIterator
-BrokenLinkageFinder::end_broken_files(const std::tr1::shared_ptr<const PackageID> & pkg) const
-{
- if (pkg)
- {
- Breakage::const_iterator it(_imp->breakage.find(pkg));
- if (_imp->breakage.end() == it)
- return BrokenFileConstIterator(no_files.end());
-
- return BrokenFileConstIterator(first_iterator(it->second.end()));
- }
- else
- return BrokenFileConstIterator(first_iterator(_imp->orphan_breakage.end()));
-}
-
-BrokenLinkageFinder::MissingRequirementConstIterator
-BrokenLinkageFinder::begin_missing_requirements(
- const std::tr1::shared_ptr<const PackageID> & pkg, const FSEntry & file) const
-{
- if (pkg)
- {
- Breakage::const_iterator pkg_it(_imp->breakage.find(pkg));
- if (_imp->breakage.end() == pkg_it)
- return MissingRequirementConstIterator(no_reqs.begin());
-
- PackageBreakage::const_iterator file_it(pkg_it->second.find(file));
- if (pkg_it->second.end() == file_it)
- return MissingRequirementConstIterator(no_reqs.begin());
-
- return MissingRequirementConstIterator(file_it->second.begin());
- }
- else
- {
- PackageBreakage::const_iterator file_it(_imp->orphan_breakage.find(file));
- if (_imp->orphan_breakage.end() == file_it)
- return MissingRequirementConstIterator(no_reqs.begin());
-
- return MissingRequirementConstIterator(file_it->second.begin());
- }
-}
-
-BrokenLinkageFinder::MissingRequirementConstIterator
-BrokenLinkageFinder::end_missing_requirements(
- const std::tr1::shared_ptr<const PackageID> & pkg, const FSEntry & file) const
-{
- if (pkg)
- {
- Breakage::const_iterator pkg_it(_imp->breakage.find(pkg));
- if (_imp->breakage.end() == pkg_it)
- return MissingRequirementConstIterator(no_reqs.end());
-
- PackageBreakage::const_iterator file_it(pkg_it->second.find(file));
- if (pkg_it->second.end() == file_it)
- return MissingRequirementConstIterator(no_reqs.end());
-
- return MissingRequirementConstIterator(file_it->second.end());
- }
- else
- {
- PackageBreakage::const_iterator file_it(_imp->orphan_breakage.find(file));
- if (_imp->orphan_breakage.end() == file_it)
- return MissingRequirementConstIterator(no_reqs.end());
-
- return MissingRequirementConstIterator(file_it->second.end());
- }
-}
-
-template class WrappedForwardIterator<BrokenLinkageFinder::BrokenPackageConstIteratorTag,
- const std::tr1::shared_ptr<const paludis::PackageID> >;
-template class WrappedForwardIterator<BrokenLinkageFinder::BrokenFileConstIteratorTag,
- const paludis::FSEntry>;
-template class WrappedForwardIterator<BrokenLinkageFinder::MissingRequirementConstIteratorTag, const std::string>;
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh
deleted file mode 100644
index 5789c1d02..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh
+++ /dev/null
@@ -1,67 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_HH
-#define PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_HH
-
-#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry-fwd.hh>
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
-
-#include <paludis/environment-fwd.hh>
-#include <paludis/package_id-fwd.hh>
-
-#include <tr1/memory>
-
-class BrokenLinkageFinder :
- private paludis::PrivateImplementationPattern<BrokenLinkageFinder>,
- private paludis::InstantiationPolicy<BrokenLinkageFinder, paludis::instantiation_method::NonCopyableTag>
-{
- public:
- BrokenLinkageFinder(const paludis::Environment *, const std::string &);
- ~BrokenLinkageFinder();
-
- struct BrokenPackageConstIteratorTag;
- typedef paludis::WrappedForwardIterator<BrokenPackageConstIteratorTag,
- const std::tr1::shared_ptr<const paludis::PackageID>
- > BrokenPackageConstIterator;
- BrokenPackageConstIterator begin_broken_packages() const PALUDIS_ATTRIBUTE((warn_unused_result));
- BrokenPackageConstIterator end_broken_packages() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- struct BrokenFileConstIteratorTag;
- typedef paludis::WrappedForwardIterator<BrokenFileConstIteratorTag, const paludis::FSEntry> BrokenFileConstIterator;
- BrokenFileConstIterator begin_broken_files(const std::tr1::shared_ptr<const paludis::PackageID> &)
- const PALUDIS_ATTRIBUTE((warn_unused_result));
- BrokenFileConstIterator end_broken_files(const std::tr1::shared_ptr<const paludis::PackageID> &)
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- struct MissingRequirementConstIteratorTag;
- typedef paludis::WrappedForwardIterator<MissingRequirementConstIteratorTag, const std::string> MissingRequirementConstIterator;
- MissingRequirementConstIterator begin_missing_requirements(
- const std::tr1::shared_ptr<const paludis::PackageID> &, const paludis::FSEntry &)
- const PALUDIS_ATTRIBUTE((warn_unused_result));
- MissingRequirementConstIterator end_missing_requirements(
- const std::tr1::shared_ptr<const paludis::PackageID> &, const paludis::FSEntry &)
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-};
-
-#endif
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration.cc b/src/clients/reconcilio/broken_linkage_finder/configuration.cc
deleted file mode 100644
index e11f1ad7a..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/configuration.cc
+++ /dev/null
@@ -1,357 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "configuration.hh"
-
-#include <paludis/util/realpath.hh>
-#include <paludis/util/wildcard_expander.hh>
-#include <paludis/util/config_file.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/join.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/options.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/system.hh>
-#include <paludis/util/tokeniser.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <tr1/functional>
-#include <algorithm>
-#include <functional>
-#include <iterator>
-#include <vector>
-
-using namespace paludis;
-using namespace broken_linkage_finder;
-
-namespace paludis
-{
- template <>
- struct Implementation<Configuration>
- {
- std::vector<std::string> ld_library_mask;
- std::vector<FSEntry> search_dirs;
- std::vector<FSEntry> search_dirs_mask;
- std::vector<FSEntry> ld_so_conf;
-
- void load_from_environment();
- void load_from_etc_revdep_rebuild(const FSEntry &);
- void load_from_etc_profile_env(const FSEntry &);
- void load_from_etc_ld_so_conf(const FSEntry &);
- void add_defaults();
- };
-
- template <>
- struct WrappedForwardIteratorTraits<Configuration::DirsIteratorTag>
- {
- typedef std::vector<FSEntry>::const_iterator UnderlyingIterator;
- };
-}
-
-namespace
-{
- struct IsGarbageFile : std::unary_function<const FSEntry &, bool>
- {
- bool operator() (const FSEntry & file)
- {
- std::string basename(file.basename());
- return '#' == basename[0] || '~' == basename[basename.length() - 1];
- }
- };
-
- template <typename T_>
- void
- from_colon_string(const std::tr1::function<std::string (const std::string &)> & source,
- const std::string & varname, std::vector<T_> & vec)
- {
- std::string str(source.operator() (varname)); /* silly 4.3 ICE */
- if (! str.empty())
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
- << "Got " << varname << "=\"" + str << "\"";
- tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(str, ":", "", std::back_inserter(vec));
- }
- }
-
- template <typename T_>
- void
- from_string(const std::tr1::function<std::string (const std::string &)> & source,
- const std::string & varname, std::vector<T_> & vec)
- {
- std::string str(source.operator() (varname)); /* silly 4.3 ICE */
- if (! str.empty())
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
- << "Got " << varname << "=\"" << str << "\"";
- tokenise_whitespace(str, std::back_inserter(vec));
- }
- }
-
- inline void
- do_wildcards(std::vector<std::string> &, const FSEntry &)
- {
- }
-
- inline void
- do_wildcards(std::vector<FSEntry> & vec, const FSEntry & root)
- {
- std::vector<FSEntry> scratch;
-
- for (std::vector<FSEntry>::const_iterator it(vec.begin()), it_end(vec.end()); it_end != it; ++it)
- std::copy(WildcardExpander(stringify(*it), root), WildcardExpander(),
- std::back_inserter(scratch));
-
- using std::swap;
- swap(vec, scratch);
- }
-
- template <typename T_>
- void
- cleanup(const std::string & varname, std::vector<T_> & vec, const FSEntry & root)
- {
- vec.erase(std::find(vec.begin(), vec.end(), T_("-*")), vec.end());
-
- do_wildcards(vec, root);
-
- std::sort(vec.begin(), vec.end());
- vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
-
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config",
- ll_debug, lc_context) << "Final " << varname << "=\"" <<
- join(vec.begin(), vec.end(), " ") << "\"";
- }
-}
-
-Configuration::Configuration(const FSEntry & root) :
- PrivateImplementationPattern<Configuration>(new Implementation<Configuration>)
-{
- Context ctx("When loading broken linkage checker configuration for '" + stringify(root) + "':");
-
- _imp->load_from_environment();
- _imp->load_from_etc_revdep_rebuild(root);
- _imp->load_from_etc_profile_env(root);
- _imp->load_from_etc_ld_so_conf(root);
- _imp->add_defaults();
-
- cleanup("LD_LIBRARY_MASK", _imp->ld_library_mask, root);
- cleanup("SEARCH_DIRS", _imp->search_dirs, root);
- cleanup("SEARCH_DIRS_MASK", _imp->search_dirs_mask, root);
-
- // don't need the extra cleanup here
- std::sort(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end());
- _imp->ld_so_conf.erase(std::unique(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end()),
- _imp->ld_so_conf.end());
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config",
- ll_debug, lc_context) << "Final ld.so.conf contents is \"" <<
- join(_imp->ld_so_conf.begin(), _imp->ld_so_conf.end(), " ") << "\"";
-}
-
-Configuration::~Configuration()
-{
-}
-
-void
-Implementation<Configuration>::load_from_environment()
-{
- using namespace std::tr1::placeholders;
-
- Context ctx("When checking environment variables:");
-
- std::tr1::function<std::string (const std::string &)> fromenv(
- std::tr1::bind(getenv_with_default, _1, ""));
-
- from_string(fromenv, "LD_LIBRARY_MASK", ld_library_mask);
- from_string(fromenv, "SEARCH_DIRS", search_dirs);
- from_string(fromenv, "SEARCH_DIRS_MASK", search_dirs_mask);
-}
-
-void
-Implementation<Configuration>::load_from_etc_revdep_rebuild(const FSEntry & root)
-{
- using namespace std::tr1::placeholders;
-
- FSEntry etc_revdep_rebuild(root / "etc" / "revdep-rebuild");
- Context ctx("When reading '" + stringify(etc_revdep_rebuild) + "':");
-
- if (etc_revdep_rebuild.is_directory_or_symlink_to_directory())
- {
- std::vector<FSEntry> conf_files = std::vector<FSEntry>(
- DirIterator(etc_revdep_rebuild), DirIterator());
- conf_files.erase(std::remove_if(conf_files.begin(), conf_files.end(),
- IsGarbageFile()),
- conf_files.end());
- std::sort(conf_files.begin(), conf_files.end());
-
- KeyValueConfigFileOptions opts;
- opts += kvcfo_disallow_space_around_equals;
- opts += kvcfo_disallow_space_inside_unquoted_values;
-
- for (std::vector<FSEntry>::iterator it(conf_files.begin()),
- it_end(conf_files.end()); it_end != it; ++it)
- {
- Context ctx_file("When reading '" + stringify(*it) + "':");
-
- if (it->is_regular_file_or_symlink_to_regular_file())
- {
- KeyValueConfigFile kvs(*it, opts,
- &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
-
- std::tr1::function<std::string (const std::string &)> fromfile(
- std::tr1::bind(&KeyValueConfigFile::get, std::tr1::cref(kvs), _1));
-
- from_string(fromfile, "LD_LIBRARY_MASK", ld_library_mask);
- from_string(fromfile, "SEARCH_DIRS", search_dirs);
- from_string(fromfile, "SEARCH_DIRS_MASK", search_dirs_mask);
- }
- else
- Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_context)
- << "'" << *it << "' is not a regular file";
- }
- }
- else if (etc_revdep_rebuild.exists())
- Log::get_instance()->message("reconcilio.broken_linkage_finder.etc_revdep_rebuild.not_a_directory", ll_warning, lc_context)
- << "'" << etc_revdep_rebuild << "' exists but is not a directory";
-}
-
-void
-Implementation<Configuration>::load_from_etc_profile_env(const FSEntry & root)
-{
- using namespace std::tr1::placeholders;
-
- FSEntry etc_profile_env(root / "etc" / "profile.env");
- Context ctx("When reading '" + stringify(etc_profile_env) + "':");
-
- if (etc_profile_env.is_regular_file_or_symlink_to_regular_file())
- {
- KeyValueConfigFileOptions opts;
- opts += kvcfo_disallow_space_around_equals;
- opts += kvcfo_disallow_space_inside_unquoted_values;
- opts += kvcfo_ignore_export;
-
- KeyValueConfigFile kvs(etc_profile_env, opts,
- &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
-
- std::tr1::function<std::string (const std::string &)> fromfile(
- std::tr1::bind(&KeyValueConfigFile::get, std::tr1::cref(kvs), _1));
-
- from_colon_string(fromfile, "PATH", search_dirs);
- from_colon_string(fromfile, "ROOTPATH", search_dirs);
- }
- else if (etc_profile_env.exists())
- Log::get_instance()->message("reconcilio.broken_linkage_finder.etc_profile_env.not_a_file", ll_warning, lc_context)
- << "'" << etc_profile_env << "' exists but is not a regular file";
-}
-
-void
-Implementation<Configuration>::load_from_etc_ld_so_conf(const FSEntry & root)
-{
- FSEntry etc_ld_so_conf(root / "etc" / "ld.so.conf");
- Context ctx("When reading '" + stringify(etc_ld_so_conf) + "':");
-
- if (etc_ld_so_conf.is_regular_file_or_symlink_to_regular_file())
- {
- LineConfigFileOptions opts;
- opts += lcfo_disallow_continuations;
-
- LineConfigFile lines(etc_ld_so_conf, opts);
- if (lines.begin() != lines.end())
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.got", ll_debug, lc_context)
- << "Got " << join(lines.begin(), lines.end(), " ");
- std::copy(lines.begin(), lines.end(), std::back_inserter(search_dirs));
- std::copy(lines.begin(), lines.end(), std::back_inserter(ld_so_conf));
- }
- }
- else if (etc_ld_so_conf.exists())
- Log::get_instance()->message("reconcilio.broken_linkage_finder.etc_ld_so_conf.not_a_file", ll_warning, lc_context)
- << "'" << etc_ld_so_conf << "' exists but is not a regular file";
-}
-
-void
-Implementation<Configuration>::add_defaults()
-{
- Context ctx("When adding default settings:");
-
- static const std::string default_ld_library_mask(
- "libodbcinst.so libodbc.so libjava.so libjvm.so");
- static const std::string default_search_dirs(
- "/bin /sbin /usr/bin /usr/sbin /lib* /usr/lib*");
- static const std::string default_search_dirs_mask(
- "/lib*/modules");
- static const std::string default_ld_so_conf("/lib /usr/lib");
-
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
- << "Got LD_LIBRARY_MASK=\"" << default_ld_library_mask << "\"";
- tokenise_whitespace(
- default_ld_library_mask, std::back_inserter(ld_library_mask));
-
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
- << "Got SEARCH_DIRS=\"" << default_search_dirs << "\"";
- tokenise_whitespace(
- default_search_dirs, std::back_inserter(search_dirs));
-
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
- << "Got SEARCH_DIRS_MASK=\"" << default_search_dirs_mask << "\"";
- tokenise_whitespace(
- default_search_dirs_mask, std::back_inserter(search_dirs_mask));
-
- Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
- << "Default ld.so.conf contents is \"" << default_ld_so_conf << "\"";
- tokenise_whitespace(
- default_ld_so_conf, std::back_inserter(ld_so_conf));
-}
-
-Configuration::DirsIterator
-Configuration::begin_search_dirs() const
-{
- return DirsIterator(_imp->search_dirs.begin());
-}
-
-Configuration::DirsIterator
-Configuration::end_search_dirs() const
-{
- return DirsIterator(_imp->search_dirs.end());
-}
-
-Configuration::DirsIterator
-Configuration::begin_ld_so_conf() const
-{
- return DirsIterator(_imp->ld_so_conf.begin());
-}
-
-Configuration::DirsIterator
-Configuration::end_ld_so_conf() const
-{
- return DirsIterator(_imp->ld_so_conf.end());
-}
-
-bool
-Configuration::dir_is_masked(const FSEntry & dir) const
-{
- return std::binary_search(_imp->search_dirs_mask.begin(), _imp->search_dirs_mask.end(), dir);
-}
-
-bool
-Configuration::lib_is_masked(const std::string & lib) const
-{
- return std::binary_search(_imp->ld_library_mask.begin(), _imp->ld_library_mask.end(), lib);
-}
-
-template class WrappedForwardIterator<Configuration::DirsIteratorTag, const paludis::FSEntry>;
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration.hh b/src/clients/reconcilio/broken_linkage_finder/configuration.hh
deleted file mode 100644
index c8bd7ef50..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/configuration.hh
+++ /dev/null
@@ -1,61 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_CONFIGURATION_HH
-#define PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_CONFIGURATION_HH
-
-#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry-fwd.hh>
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-
-#include <string>
-
-namespace broken_linkage_finder
-{
- class Configuration :
- private paludis::PrivateImplementationPattern<Configuration>,
- private paludis::InstantiationPolicy<Configuration, paludis::instantiation_method::NonCopyableTag>
- {
- public:
- Configuration(const paludis::FSEntry &);
- ~Configuration();
-
- struct DirsIteratorTag;
- typedef paludis::WrappedForwardIterator<DirsIteratorTag, const paludis::FSEntry> DirsIterator;
- DirsIterator begin_search_dirs() const PALUDIS_ATTRIBUTE((warn_unused_result));
- DirsIterator end_search_dirs() const PALUDIS_ATTRIBUTE((warn_unused_result));
- DirsIterator begin_ld_so_conf() const PALUDIS_ATTRIBUTE((warn_unused_result));
- DirsIterator end_ld_so_conf() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- bool dir_is_masked(const paludis::FSEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool lib_is_masked(const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-}
-
-#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
-namespace paludis
-{
- extern template class WrappedForwardIterator<broken_linkage_finder::Configuration::DirsIteratorTag, const FSEntry>;
-}
-#endif
-
-#endif
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration_TEST.cc b/src/clients/reconcilio/broken_linkage_finder/configuration_TEST.cc
deleted file mode 100644
index 8f65a3200..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/configuration_TEST.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "configuration.hh"
-
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/join.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-
-#include <test/test_runner.hh>
-#include <test/test_framework.hh>
-
-#include <unistd.h>
-#include <cstdlib>
-
-using namespace broken_linkage_finder;
-
-using namespace test;
-using namespace paludis;
-
-namespace test_cases
-{
- struct ConfigurationTest : TestCase
- {
- ConfigurationTest() : TestCase("configuration") {}
-
- void run()
- {
- setenv("SEARCH_DIRS", "/quuxlib", 1);
- setenv("SEARCH_DIRS_MASK", "/quuxlib/quux", 1);
- setenv("LD_LIBRARY_MASK", "libquux.so", 1);
-
- Configuration config(FSEntry::cwd() / "configuration_TEST_dir");
-
- TEST_CHECK_EQUAL(join(config.begin_search_dirs(), config.end_search_dirs(), " "),
- "/alib /barbin /barlib/foo /bazbin /bin /blib /foobin /foolib/bar /lib32 /lib64 /quuxlib /sbin /usr/bin /usr/lib* /usr/sbin");
- TEST_CHECK_EQUAL(join(config.begin_ld_so_conf(), config.end_ld_so_conf(), " "),
- "/barlib/foo /foolib/bar /lib /usr/lib");
-
- TEST_CHECK(config.dir_is_masked(FSEntry("/meh")));
- TEST_CHECK(config.dir_is_masked(FSEntry("/quuxlib/quux")));
- TEST_CHECK(! config.dir_is_masked(FSEntry("/feh")));
- TEST_CHECK(! config.dir_is_masked(FSEntry("/opt/OpenOffice")));
- TEST_CHECK(! config.dir_is_masked(FSEntry("/usr/lib/openoffice")));
- TEST_CHECK(! config.dir_is_masked(FSEntry("/foo")));
-
- TEST_CHECK(config.lib_is_masked("libquux.so"));
- TEST_CHECK(config.lib_is_masked("libxyzzy.so"));
- TEST_CHECK(config.lib_is_masked("libodbcinst.so"));
- TEST_CHECK(config.lib_is_masked("libodbc.so"));
- TEST_CHECK(config.lib_is_masked("libjava.so"));
- TEST_CHECK(config.lib_is_masked("libjvm.so"));
- TEST_CHECK(! config.lib_is_masked("libfoo.so"));
- }
- } configuration_test;
-}
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration_TEST_cleanup.sh b/src/clients/reconcilio/broken_linkage_finder/configuration_TEST_cleanup.sh
deleted file mode 100755
index e241fc553..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/configuration_TEST_cleanup.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-if [ -d configuration_TEST_dir ] ; then
- rm -fr configuration_TEST_dir
-else
- true
-fi
-
-
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration_TEST_setup.sh b/src/clients/reconcilio/broken_linkage_finder/configuration_TEST_setup.sh
deleted file mode 100755
index 59a952b4b..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/configuration_TEST_setup.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-mkdir configuration_TEST_dir || exit 1
-cd configuration_TEST_dir || exit 1
-
-mkdir -p etc/revdep-rebuild
-
-echo 'export PATH="/foobin:/barbin"' >>etc/profile.env
-echo 'export ROOTPATH="/bazbin"' >>etc/profile.env
-echo 'export WRATH="/goo"' >>etc/profile.env
-
-echo '/foolib/bar' >>etc/ld.so.conf
-echo '/barlib/foo' >>etc/ld.so.conf
-echo '#/shoe' >>etc/ld.so.conf
-
-echo 'SEARCH_DIRS="/alib /blib"' >>etc/revdep-rebuild/10-test
-echo 'SEARCH_DIRS_MASK="/meh -*"' >>etc/revdep-rebuild/10-test
-echo 'SEARCH_DIRS_MASK="/feh"' >>etc/revdep-rebuild/20-test
-echo 'LD_LIBRARY_MASK="libxyzzy.so"' >>etc/revdep-rebuild/30-test
-
-echo 'SEARCH_DIRS="/moo"' >>etc/revdep-rebuild/10test~
-echo 'SEARCH_DIRS="/foo"' >>etc/revdep-rebuild/.10test
-echo 'SEARCH_DIRS="/boo"' >>etc/revdep-rebuild/\#10test
-
-mkdir lib32 lib64
-
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc b/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc
deleted file mode 100644
index b5eb10177..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc
+++ /dev/null
@@ -1,369 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "elf_linkage_checker.hh"
-
-#include <paludis/util/elf.hh>
-#include <paludis/util/elf_dynamic_section.hh>
-#include <paludis/util/elf_types.hh>
-#include <paludis/util/elf_relocation_section.hh>
-#include <paludis/util/elf_symbol_section.hh>
-
-#include <paludis/util/realpath.hh>
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/join.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/mutex.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/member_iterator-impl.hh>
-#include <paludis/util/simple_visitor_cast.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/safe_ifstream.hh>
-
-#include <algorithm>
-#include <cerrno>
-#include <cstring>
-#include <map>
-#include <set>
-#include <vector>
-
-using namespace paludis;
-using namespace broken_linkage_finder;
-
-namespace
-{
- struct ElfArchitecture
- {
- // not in elf.h; from glibc-2.5/sysdeps/s390/s390-32/dl-machine.h
- static const unsigned S390_OLD = 0xA390;
- // not in FreeBSD elf.h
- static const unsigned MIPS_ABI2 = 32;
-
- unsigned _machine;
- unsigned char _class, _os_abi, _os_abi_version;
- bool _bigendian, _mips_n32;
-
- bool operator< (const ElfArchitecture &) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- static unsigned normalise_arch(unsigned arch)
- {
- switch (arch)
- {
- case EM_MIPS_RS3_LE:
- return EM_MIPS;
- case S390_OLD:
- return EM_S390;
- }
- return arch;
- }
-
- template <typename ElfType_>
- ElfArchitecture(const ElfObject<ElfType_> & elf) :
- _machine(normalise_arch(elf.get_arch())),
- _class(ElfType_::elf_class),
- _os_abi(elf.get_os_abi()),
- _os_abi_version(elf.get_os_abi_version()),
- _bigendian(elf.is_big_endian()),
- _mips_n32(EM_MIPS == _machine && MIPS_ABI2 & elf.get_flags())
- {
- }
- };
-
- bool
- ElfArchitecture::operator< (const ElfArchitecture & other) const
- {
- if (_machine != other._machine)
- return _machine < other._machine;
- if (_class != other._class)
- return _class < other._class;
- if (_os_abi != other._os_abi)
- return _os_abi < other._os_abi;
- if (_os_abi_version != other._os_abi_version)
- return _os_abi_version < other._os_abi_version;
- if (_bigendian != other._bigendian)
- return _bigendian < other._bigendian;
- return _mips_n32 < other._mips_n32;
- }
-}
-
-typedef std::multimap<FSEntry, FSEntry> Symlinks;
-typedef std::map<ElfArchitecture, std::map<std::string, std::vector<FSEntry> > > Needed;
-
-namespace paludis
-{
- template <>
- struct Implementation<ElfLinkageChecker>
- {
- FSEntry root;
- std::string library;
-
- Mutex mutex;
-
- std::map<FSEntry, ElfArchitecture> seen;
- Symlinks symlinks;
-
- std::map<ElfArchitecture, std::vector<std::string> > libraries;
- Needed needed;
-
- std::vector<FSEntry> extra_lib_dirs;
-
- template <typename> bool check_elf(const FSEntry &, std::istream &);
- void handle_library(const FSEntry &, const ElfArchitecture &);
- template <typename> bool check_extra_elf(const FSEntry &, std::istream &, std::set<ElfArchitecture> &);
-
- Implementation(const FSEntry & the_root, const std::string & the_library) :
- root(the_root),
- library(the_library)
- {
- }
- };
-}
-
-ElfLinkageChecker::ElfLinkageChecker(const FSEntry & root, const std::string & library) :
- PrivateImplementationPattern<ElfLinkageChecker>(new Implementation<ElfLinkageChecker>(root, library))
-{
-}
-
-ElfLinkageChecker::~ElfLinkageChecker()
-{
-}
-
-bool
-ElfLinkageChecker::check_file(const FSEntry & file)
-{
- std::string basename(file.basename());
- if (! (std::string::npos != basename.find(".so.") ||
- (3 <= basename.length() && ".so" == basename.substr(basename.length() - 3)) ||
- file.has_permission(fs_ug_owner, fs_perm_execute)))
- return false;
-
- SafeIFStream stream(file);
- return _imp->check_elf<Elf32Type>(file, stream) || _imp->check_elf<Elf64Type>(file, stream);
-}
-
-template <typename ElfType_>
-bool
-Implementation<ElfLinkageChecker>::check_elf(const FSEntry & file, std::istream & stream)
-{
- if (! ElfObject<ElfType_>::is_valid_elf(stream))
- return false;
-
- try
- {
- Context ctx("When checking '" + stringify(file) + "' as a " +
- stringify<int>(ElfType_::elf_class * 32) + "-bit ELF file:");
- ElfObject<ElfType_> elf(stream);
- if (ET_EXEC != elf.get_type() && ET_DYN != elf.get_type())
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.not_interesting", ll_debug, lc_context)
- << "File is not an executable or shared library";
- return true;
- }
-
- ElfArchitecture arch(elf);
- elf.resolve_all_strings();
-
- Lock l(mutex);
-
- if (library.empty() && ET_DYN == elf.get_type())
- handle_library(file, arch);
-
- for (typename ElfObject<ElfType_>::SectionIterator sec_it(elf.section_begin()),
- sec_it_end(elf.section_end()); sec_it_end != sec_it; ++sec_it)
- {
- const DynamicSection<ElfType_> * dyn_sec(simple_visitor_cast<const DynamicSection<ElfType_> >(*sec_it));
-
- if (0 != dyn_sec)
- for (typename DynamicSection<ElfType_>::EntryIterator ent_it(dyn_sec->entry_begin()),
- ent_it_end(dyn_sec->entry_end()); ent_it_end != ent_it; ++ent_it)
- {
- const DynamicEntryString<ElfType_> * ent_str(simple_visitor_cast<const DynamicEntryString<ElfType_> >(*ent_it));
-
- if (0 != ent_str && "NEEDED" == ent_str->tag_name())
- {
- const std::string & req((*ent_str)());
- if (library.empty() || library == req)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.depends", ll_debug, lc_context)
- << "File depends on " << req;
- needed[arch][req].push_back(file);
- }
- }
- }
- }
- }
- catch (const InvalidElfFileError & e)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.invalid", ll_warning, lc_no_context)
- << "'" << file << "' appears to be invalid or corrupted: " << e.message();
- }
-
- return true;
-}
-
-void
-Implementation<ElfLinkageChecker>::handle_library(const FSEntry & file, const ElfArchitecture & arch)
-{
- seen.insert(std::make_pair(file, arch));
- std::pair<Symlinks::const_iterator, Symlinks::const_iterator> range(symlinks.equal_range(file));
- libraries[arch].push_back(file.basename());
-
- if (range.first != range.second)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.known_symlinks_are",
- ll_debug, lc_context) << "Known symlinks are " <<
- join(second_iterator(range.first), second_iterator(range.second), " ");
- std::transform(second_iterator(range.first), second_iterator(range.second),
- std::back_inserter(libraries[arch]), std::tr1::mem_fn(&FSEntry::basename));
- }
-}
-
-void
-ElfLinkageChecker::note_symlink(const FSEntry & link, const FSEntry & target)
-{
- if (_imp->library.empty())
- {
- Lock l(_imp->mutex);
-
- std::map<FSEntry, ElfArchitecture>::const_iterator it(_imp->seen.find(target));
- if (_imp->seen.end() != it)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.note_symlink", ll_debug, lc_context)
- << "'" << link << "' is a symlink to known library '" << target << "'";
- _imp->libraries[it->second].push_back(link.basename());
- }
- else
- _imp->symlinks.insert(std::make_pair(target, link));
- }
-}
-
-void
-ElfLinkageChecker::add_extra_lib_dir(const FSEntry & dir)
-{
- _imp->extra_lib_dirs.push_back(dir);
-}
-
-void
-ElfLinkageChecker::need_breakage_added(
- const std::tr1::function<void (const FSEntry &, const std::string &)> & callback)
-{
- using namespace std::tr1::placeholders;
-
- typedef std::map<std::string, std::set<ElfArchitecture> > AllMissing;
- AllMissing all_missing;
-
- for (Needed::iterator arch_it(_imp->needed.begin()),
- arch_it_end(_imp->needed.end()); arch_it_end != arch_it; ++arch_it)
- {
- std::sort(_imp->libraries[arch_it->first].begin(), _imp->libraries[arch_it->first].end());
- _imp->libraries[arch_it->first].erase(
- std::unique(_imp->libraries[arch_it->first].begin(),
- _imp->libraries[arch_it->first].end()),
- _imp->libraries[arch_it->first].end());
-
- std::vector<std::string> missing;
- std::set_difference(first_iterator(arch_it->second.begin()),
- first_iterator(arch_it->second.end()),
- _imp->libraries[arch_it->first].begin(),
- _imp->libraries[arch_it->first].end(),
- std::back_inserter(missing));
- for (std::vector<std::string>::const_iterator it(missing.begin()),
- it_end(missing.end()); it_end != it; ++it)
- all_missing[*it].insert(arch_it->first);
- }
-
- for (std::vector<FSEntry>::const_iterator dir_it(_imp->extra_lib_dirs.begin()),
- dir_it_end(_imp->extra_lib_dirs.end()); dir_it_end != dir_it; ++dir_it)
- {
- Context ctx("When seaching for missing libraries in '" + stringify(*dir_it) + "':");
-
- for (AllMissing::iterator missing_it(all_missing.begin()),
- missing_it_end(all_missing.end()); missing_it_end != missing_it; ++missing_it)
- {
- if (missing_it->second.empty())
- continue;
-
- FSEntry file(dereference_with_root(*dir_it / missing_it->first, _imp->root));
- if (! file.is_regular_file())
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.missing", ll_debug, lc_context)
- << "'" << file << "' is missing or not a regular file";
- continue;
- }
-
- try
- {
- SafeIFStream stream(file);
-
- if (! (_imp->check_extra_elf<Elf32Type>(file, stream, missing_it->second) ||
- _imp->check_extra_elf<Elf64Type>(file, stream, missing_it->second)))
- Log::get_instance()->message("reconcilio.broken_linkage_finder.not_an_elf", ll_debug, lc_no_context)
- << "'" << file << "' is not an ELF file";
- }
- catch (const SafeIFStreamError & e)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_no_context)
- << "Error opening '" << file << "': '" << e.message() << "' (" << e.what() << ")";
- continue;
- }
- }
- }
-
- for (AllMissing::const_iterator missing_it(all_missing.begin()),
- missing_it_end(all_missing.end()); missing_it_end != missing_it; ++missing_it)
- for (std::set<ElfArchitecture>::const_iterator arch_it(missing_it->second.begin()),
- arch_it_end(missing_it->second.end()); arch_it_end != arch_it; ++arch_it)
- std::for_each(_imp->needed[*arch_it][missing_it->first].begin(),
- _imp->needed[*arch_it][missing_it->first].end(),
- std::tr1::bind(callback, _1, missing_it->first));
-
-}
-
-template <typename ElfType_>
-bool
-Implementation<ElfLinkageChecker>::check_extra_elf(const FSEntry & file, std::istream & stream, std::set<ElfArchitecture> & arches)
-{
- if (! ElfObject<ElfType_>::is_valid_elf(stream))
- return false;
-
- Context ctx("When checking '" + stringify(file) + "' as a " + stringify<int>(ElfType_::elf_class * 32) + "-bit ELF file");
-
- try
- {
- ElfObject<ElfType_> elf(stream);
- if (ET_DYN == elf.get_type())
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.is_library", ll_debug, lc_context)
- << "'" << file << "' is a library";
- arches.erase(ElfArchitecture(elf));
- }
- else
- Log::get_instance()->message("reconcilio.broken_linkage_finder.is_not_library", ll_debug, lc_context)
- << "'" << file << "' is not a library";
- }
- catch (const InvalidElfFileError & e)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.invalid", ll_warning, lc_no_context)
- << "'" << file << "' appears to be invalid or corrupted: " << e.message();
- }
-
- return true;
-}
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.hh b/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.hh
deleted file mode 100644
index a26987c27..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.hh
+++ /dev/null
@@ -1,49 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_ELF_LINKAGE_CHECKER_HH
-#define PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_ELF_LINKAGE_CHECKER_HH
-
-#include "linkage_checker.hh"
-
-#include <paludis/util/private_implementation_pattern.hh>
-#include <tr1/functional>
-#include <iosfwd>
-
-namespace broken_linkage_finder
-{
- class ElfLinkageChecker :
- public LinkageChecker,
- private paludis::PrivateImplementationPattern<ElfLinkageChecker>
- {
- public:
- ElfLinkageChecker(const paludis::FSEntry &, const std::string &);
- virtual ~ElfLinkageChecker();
-
- virtual bool check_file(const paludis::FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual void note_symlink(const paludis::FSEntry &, const paludis::FSEntry &);
-
- virtual void add_extra_lib_dir(const paludis::FSEntry &);
- virtual void need_breakage_added(
- const std::tr1::function<void (const paludis::FSEntry &, const std::string &)> &);
- };
-}
-
-#endif
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc b/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc
deleted file mode 100644
index 890bd30c7..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.cc
+++ /dev/null
@@ -1,167 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "libtool_linkage_checker.hh"
-
-#include <paludis/util/realpath.hh>
-#include <paludis/util/config_file.hh>
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/mutex.hh>
-#include <paludis/util/options.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/tokeniser.hh>
-#include <paludis/util/safe_ifstream.hh>
-
-#include <algorithm>
-#include <cstring>
-#include <cerrno>
-#include <functional>
-#include <vector>
-
-using namespace paludis;
-using namespace broken_linkage_finder;
-
-typedef std::vector<std::pair<FSEntry, std::string> > Breakage;
-
-namespace paludis
-{
- template <>
- struct Implementation<LibtoolLinkageChecker>
- {
- FSEntry root;
-
- Mutex mutex;
-
- Breakage breakage;
-
- Implementation(const FSEntry & the_root) :
- root(the_root)
- {
- }
- };
-}
-
-namespace
-{
- struct IsNotAbsolutePath : std::unary_function<std::string, bool>
- {
- bool operator() (const std::string & str)
- {
- return str.empty() || '/' != str[0];
- }
- };
-}
-
-LibtoolLinkageChecker::LibtoolLinkageChecker(const FSEntry & root) :
- PrivateImplementationPattern<LibtoolLinkageChecker>(new Implementation<LibtoolLinkageChecker>(root))
-{
-}
-
-LibtoolLinkageChecker::~LibtoolLinkageChecker()
-{
-}
-
-bool
-LibtoolLinkageChecker::check_file(const FSEntry & file)
-{
- std::string basename(file.basename());
- if (! (3 <= basename.length() &&
- ".la" == basename.substr(basename.length() - 3)))
- return false;
-
- Context ctx("When checking '" + stringify(file) + "' as a libtool library:");
-
- SafeIFStream stream(file);
-
- KeyValueConfigFileOptions opts;
- opts += kvcfo_disallow_space_around_equals;
- opts += kvcfo_disallow_space_inside_unquoted_values;
-
- std::vector<std::string> deps;
-
- try
- {
- KeyValueConfigFile kvs(stream, opts,
- &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
- tokenise_whitespace(kvs.get("dependency_libs"), std::back_inserter(deps));
- }
- catch (const ConfigFileError & ex)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_context) << ex.message();
- return true;
- }
-
- deps.erase(std::remove_if(deps.begin(), deps.end(), IsNotAbsolutePath()), deps.end());
- if (deps.empty())
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.no_libtool", ll_debug, lc_context)
- << "No libtool library dependencies found";
- return true;
- }
-
- for (std::vector<std::string>::const_iterator it(deps.begin()),
- it_end(deps.end()); it_end != it; ++it)
- {
- try
- {
- FSEntry dep(_imp->root / *it);
- if (! dereference_with_root(dep, _imp->root).is_regular_file())
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.dependency_missing",
- ll_debug, lc_context) << "Dependency '" << *it <<
- "' is missing or not a regular file in '" << _imp->root << "'";
-
- Lock l(_imp->mutex);
- _imp->breakage.push_back(std::make_pair(file, *it));
- }
-
- else
- Log::get_instance()->message("reconcilio.broken_linkage_finder.dependency_exists", ll_debug, lc_context)
- << "Dependency '" << *it << "' exists in '" << _imp->root << "'";
- }
-
- catch (const FSError & ex)
- {
- Log::get_instance()->message("reconcilio.broken_linkage_finder.failure", ll_warning, lc_no_context) << ex.message();
- }
- }
-
- return true;
-}
-
-void
-LibtoolLinkageChecker::note_symlink(const FSEntry &, const FSEntry &)
-{
-}
-
-void
-LibtoolLinkageChecker::add_extra_lib_dir(const FSEntry &)
-{
-}
-
-void
-LibtoolLinkageChecker::need_breakage_added(
- const std::tr1::function<void (const FSEntry &, const std::string &)> & callback)
-{
- for (Breakage::const_iterator it(_imp->breakage.begin()), it_end(_imp->breakage.end()); it_end != it; ++it)
- callback(it->first, it->second);
-}
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.hh b/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.hh
deleted file mode 100644
index 905a12a2a..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/libtool_linkage_checker.hh
+++ /dev/null
@@ -1,47 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_LIBTOOL_LINKAGE_CHECKER_HH
-#define PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_LIBTOOL_LINKAGE_CHECKER_HH
-
-#include "linkage_checker.hh"
-
-#include <paludis/util/private_implementation_pattern.hh>
-
-namespace broken_linkage_finder
-{
- class LibtoolLinkageChecker :
- public LinkageChecker,
- private paludis::PrivateImplementationPattern<LibtoolLinkageChecker>
- {
- public:
- LibtoolLinkageChecker(const paludis::FSEntry &);
- virtual ~LibtoolLinkageChecker();
-
- virtual bool check_file(const paludis::FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual void note_symlink(const paludis::FSEntry &, const paludis::FSEntry &);
-
- virtual void add_extra_lib_dir(const paludis::FSEntry &);
- virtual void need_breakage_added(
- const std::tr1::function<void (const paludis::FSEntry &, const std::string &)> &);
- };
-}
-
-#endif
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/linkage_checker.cc b/src/clients/reconcilio/broken_linkage_finder/linkage_checker.cc
deleted file mode 100644
index 47f5d41e5..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/linkage_checker.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "linkage_checker.hh"
-
-using namespace broken_linkage_finder;
-
-LinkageChecker::LinkageChecker()
-{
-}
-
-LinkageChecker::~LinkageChecker()
-{
-}
-
diff --git a/src/clients/reconcilio/broken_linkage_finder/linkage_checker.hh b/src/clients/reconcilio/broken_linkage_finder/linkage_checker.hh
deleted file mode 100644
index 8bad40833..000000000
--- a/src/clients/reconcilio/broken_linkage_finder/linkage_checker.hh
+++ /dev/null
@@ -1,54 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 David Leverton
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_LINKAGE_CHECKER_HH
-#define PALUDIS_GUARD_RECONCILIO_BROKEN_LINKAGE_FINDER_LINKAGE_CHECKER_HH
-
-#include "broken_linkage_finder.hh"
-
-#include <paludis/util/fs_entry-fwd.hh>
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/set-fwd.hh>
-
-#include <paludis/package_id-fwd.hh>
-#include <tr1/memory>
-#include <tr1/functional>
-#include <string>
-
-namespace broken_linkage_finder
-{
- class LinkageChecker :
- private paludis::InstantiationPolicy<LinkageChecker, paludis::instantiation_method::NonCopyableTag>
- {
- public:
- LinkageChecker();
- virtual ~LinkageChecker();
-
- virtual bool check_file(const paludis::FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual void note_symlink(const paludis::FSEntry &, const paludis::FSEntry &) = 0;
-
- virtual void add_extra_lib_dir(const paludis::FSEntry &) = 0;
- virtual void need_breakage_added(
- const std::tr1::function<void (const paludis::FSEntry &, const std::string &)> &) = 0;
-
- };
-}
-
-#endif
-
diff --git a/src/clients/reconcilio/fix_linkage.cc b/src/clients/reconcilio/fix_linkage.cc
index 38cb41368..226bd306e 100644
--- a/src/clients/reconcilio/fix_linkage.cc
+++ b/src/clients/reconcilio/fix_linkage.cc
@@ -21,8 +21,6 @@
#include "fix_linkage.hh"
#include "install.hh"
-#include <src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh>
-
#include <paludis/util/fs_entry.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
@@ -31,6 +29,7 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/broken_linkage_finder.hh>
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/name.hh>