+// Helper for APT::NeverAutoRemove, always include the packages matching
+// this regexp into the root-set
+inline bool
+pkgMarkAlwaysInclude(pkgCache::PkgIterator p, vector<regex_t*> alwaysMark)
+{
+ for(unsigned int i=0;i<alwaysMark.size();i++)
+ if (regexec(alwaysMark[i],p.Name(),0,0,0) == 0)
+ return true;
+
+ return false;
+}
+
+// the main mark algorithm
+bool pkgMarkUsed(pkgDepCache &Cache, InRootSetFunc func)