aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/vdb_unmerger.cc
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-08-12 15:05:41 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-08-12 15:05:41 +0000
commita613b16bb6af396ab612c294e5f8c8874bbac515 (patch)
tree927ce52d03035c0b4bc5c2b450e9ae402906f8f1 /paludis/repositories/e/vdb_unmerger.cc
parentc95bc893846259e3120cc5811533805115401f89 (diff)
downloadpaludis-a613b16bb6af396ab612c294e5f8c8874bbac515.tar.gz
paludis-a613b16bb6af396ab612c294e5f8c8874bbac515.tar.xz
Fix config protect handling for PMS compliance and ${ROOT}!=/.
Diffstat (limited to 'paludis/repositories/e/vdb_unmerger.cc')
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/paludis/repositories/e/vdb_unmerger.cc b/paludis/repositories/e/vdb_unmerger.cc
index 126a43c77..89ff8d15c 100644
--- a/paludis/repositories/e/vdb_unmerger.cc
+++ b/paludis/repositories/e/vdb_unmerger.cc
@@ -35,6 +35,7 @@ using namespace paludis;
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/strip.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -170,13 +171,19 @@ VDBUnmerger::config_protected(const FSEntry & f) const
bool result(false);
for (std::list<std::string>::const_iterator c(_imp->config_protect.begin()),
c_end(_imp->config_protect.end()) ; c != c_end && ! result ; ++c)
- if (0 == tidy.compare(0, c->length(), *c))
+ {
+ std::string cc(strip_trailing(*c, "/") + "/");
+ if (tidy == *c || 0 == tidy.compare(0, cc.length(), cc))
result = true;
+ }
if (result)
for (std::list<std::string>::const_iterator c(_imp->config_protect_mask.begin()),
c_end(_imp->config_protect_mask.end()) ; c != c_end && result ; ++c)
- if (0 == tidy.compare(0, c->length(), *c))
+ {
+ std::string cc(strip_trailing(*c, "/") + "/");
+ if (tidy == *c || 0 == tidy.compare(0, cc.length(), cc))
result = false;
+ }
return result;
}