def refresh(self):
     "clears and repopulates the list from the filesystem"
     self.clear_cache()
     del self[:] 
     for dir in PortageInterface.get_config_protect():
         self._add_update_proposals(dir)
     self.sort()
 def refresh(self, current_file_callback = None):
     "clears and repopulates the list from the filesystem"
     self.clear_cache()
     del self[:] 
     for dir in PortageInterface.get_config_protect(Config.Backend):
         self._add_update_proposals(dir, current_file_callback)
     self.sort()
 def scan_all_files():
     allpkgparts = PortageInterface.get_fileinfo_from_vdb(
         [os.path.join(path, file)
         for configbasedir in PortageInterface.get_config_protect(
             Config.Backend)
         for (path, dir, files) in os.walk(configbasedir)
         for file in files])
     return len([EtcProposalConfigFile(pkgpart.path).update_unmodified(pkgpart.md5) for pkgpart in allpkgparts.values()])
 def clear_all_states(self):
     "this is pretty much 'undo all' but it also removes orphaned state files"
     # removing deprecated old style statefile
     for dir in PortageInterface.get_config_protect():
         self._remove_statefiles(dir)
     self.refresh()
 def runTest(self):
     """Testing CONFIG_PROTECT calculation"""
     portage_config_protect = set(portage.settings['CONFIG_PROTECT'].split(' '))
     stubs_config_protect = set(PortageInterface.get_config_protect())
     self.failUnless(stubs_config_protect == portage_config_protect, 'Calculated CONFIG_PROTECT differs from the one calculated by portage.')
 def _assure_etc_in_config_protect(self):
     self.failUnless('/etc' in PortageInterface.get_config_protect(), 'This test can only run if /etc is in CONFIG_PROTECT.')