diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-06-26 13:29:24 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-06-26 13:29:24 +0200 |
commit | 1f2933a8de0f3a26f51b4a0a2112cbdfd4461e9b (patch) | |
tree | f3276dc8ca70d3648af677251943b789a5c55abb /apt-pkg/depcache.cc | |
parent | 9f9717fa6bca13817cf9cf84d513e59d258af154 (diff) |
- use the new MatchAgainstConfig for the DefaultRootSetFunc
* apt-pkg/contrib/configuration.{cc,h}:
- add a wrapper to match strings against configurable regex patterns
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r-- | apt-pkg/depcache.cc | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index d082b8404..8bca3e36e 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1638,54 +1638,6 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep) return false; } /*}}}*/ -pkgDepCache::DefaultRootSetFunc::DefaultRootSetFunc() /*{{{*/ - : constructedSuccessfully(false) -{ - Configuration::Item const *Opts; - Opts = _config->Tree("APT::NeverAutoRemove"); - if (Opts != 0 && Opts->Child != 0) - { - Opts = Opts->Child; - for (; Opts != 0; Opts = Opts->Next) - { - if (Opts->Value.empty() == true) - continue; - - regex_t *p = new regex_t; - if(regcomp(p,Opts->Value.c_str(), - REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0) - { - regfree(p); - delete p; - _error->Error("Regex compilation error for APT::NeverAutoRemove"); - return; - } - - rootSetRegexp.push_back(p); - } - } - - constructedSuccessfully = true; -} - /*}}}*/ -pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc() /*{{{*/ -{ - for(unsigned int i = 0; i < rootSetRegexp.size(); i++) - { - regfree(rootSetRegexp[i]); - delete rootSetRegexp[i]; - } -} - /*}}}*/ -bool pkgDepCache::DefaultRootSetFunc::InRootSet(const pkgCache::PkgIterator &pkg) /*{{{*/ -{ - for(unsigned int i = 0; i < rootSetRegexp.size(); i++) - if (regexec(rootSetRegexp[i], pkg.Name(), 0, 0, 0) == 0) - return true; - - return false; -} - /*}}}*/ pkgDepCache::InRootSetFunc *pkgDepCache::GetRootSetFunc() /*{{{*/ { DefaultRootSetFunc *f = new DefaultRootSetFunc; |