aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-22 01:59:02 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-22 01:59:02 +0000
commit0c5d05bade01a87dcecb4a138974c74df792a84a (patch)
treececf1477a83dd86fba1c596652d220dc266e1b2a
parentd64ac544e733912643c6d19eeed94981d23beff1 (diff)
downloadpaludis-0c5d05bade01a87dcecb4a138974c74df792a84a.tar.gz
paludis-0c5d05bade01a87dcecb4a138974c74df792a84a.tar.xz
Add a repository blacklist.
-rw-r--r--doc/faq.html.skel16
-rw-r--r--paludis/Makefile.am.m46
-rw-r--r--paludis/repository.cc33
-rw-r--r--paludis/repository_blacklist.txt2
4 files changed, 56 insertions, 1 deletions
diff --git a/doc/faq.html.skel b/doc/faq.html.skel
index 8044a0a..c6e47a8 100644
--- a/doc/faq.html.skel
+++ b/doc/faq.html.skel
@@ -308,6 +308,22 @@ honour <code>ROOT</code>. To temporarily disable sandbox for these packages,
<code>export SANDBOX_PREDICT=/</code> or <code>export SANDBOX_WRITE=/</code> as
appropriate.</p>
+<h3 id="blacklist">Repository Blacklists</h3>
+
+<p>Paludis will sometimes blacklist certain repositories. When using a
+blacklisted repository, you will receive a warning when Paludis starts up. This
+is not a fatal error, but you should realise that use of the repository in
+question will likely lead to breakages.</p>
+
+<p>Repositories are only blacklisted under extreme circumstances, such as:</p>
+
+<ul>
+ <li>When they are known to be very broken.</li>
+ <li>When they are known to rely heavily upon quirks in Portage's behaviour
+ that Paludis will not emulate.</li>
+ <li>When they are known to be a security threat.</li>
+</ul>
+
<h2 id="misfunctionality">Undesirable Misfunctionality</h2>
<h3 id="wgetresume">wget Resume Support</h3>
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index b94876c..fa5d5a0 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -63,7 +63,8 @@ DEFS= \
-DDATADIR=\"$(datadir)\" \
-DLIBDIR=\"$(libdir)\"
EXTRA_DIST = about.hh.in Makefile.am.m4 paludis.hh.m4 files.m4 \
- hashed_containers.hh.in testscriptlist srlist srcleanlist
+ hashed_containers.hh.in testscriptlist srlist srcleanlist \
+ repository_blacklist.txt
SUBDIRS = digests fetchers syncers util selinux . dep_list merger repositories environment args qa tasks
BUILT_SOURCES = srcleanlist
@@ -94,6 +95,9 @@ TESTS_ENVIRONMENT = env \
check_PROGRAMS = $(TESTS)
check_SCRIPTS = testscriptlist
+paludis_datadir = $(datadir)/paludis
+paludis_data_DATA = repository_blacklist.txt
+
if MONOLITHIC
noinst_LTLIBRARIES = libpaludis.la libpaludismanpagethings.la
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 2d06675..4b39d9c 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -20,8 +20,12 @@
#include <paludis/repository.hh>
#include <paludis/util/compare.hh>
#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/iterator.hh>
+#include <paludis/util/log.hh>
+#include <paludis/config_file.hh>
#include <map>
#include <list>
+#include <algorithm>
#include <ctype.h>
/** \file
@@ -34,6 +38,30 @@ using namespace paludis;
#include <paludis/repository-sr.cc>
+namespace
+{
+ struct RepositoryBlacklist :
+ InstantiationPolicy<RepositoryBlacklist, instantiation_method::SingletonTag>
+ {
+ std::map<std::string, std::string> items;
+
+ RepositoryBlacklist()
+ {
+ if (! (FSEntry(DATADIR) / "paludis" / "repository_blacklist.txt").exists())
+ return;
+
+ LineConfigFile f(FSEntry(DATADIR) / "paludis" / "repository_blacklist.txt");
+ for (LineConfigFile::Iterator line(f.begin()), line_end(f.end()) ;
+ line != line_end ; ++line)
+ {
+ std::string::size_type p(line->find(" - "));
+ if (std::string::npos != p)
+ items.insert(std::make_pair(line->substr(0, p), line->substr(p + 3)));
+ }
+ }
+ };
+}
+
Repository::Repository(
const RepositoryName & our_name,
const RepositoryCapabilities & caps,
@@ -43,6 +71,11 @@ Repository::Repository(
_format(f),
_info(new RepositoryInfo)
{
+ std::map<std::string, std::string>::const_iterator i(
+ RepositoryBlacklist::get_instance()->items.find(stringify(_name)));
+ if (RepositoryBlacklist::get_instance()->items.end() != i)
+ Log::get_instance()->message(ll_warning, lc_no_context, "Repository '" + stringify(_name) +
+ "' is blacklisted with reason '" + i->second + "'. Consult the FAQ for more details.");
}
Repository::~Repository()
diff --git a/paludis/repository_blacklist.txt b/paludis/repository_blacklist.txt
new file mode 100644
index 0000000..b1cb966
--- /dev/null
+++ b/paludis/repository_blacklist.txt
@@ -0,0 +1,2 @@
+xeffects - Upstream hates Paludis and doesn't support us
+xeffects-experimental - Upstream hates Paludis and doesn't support us