def _clean_rpmdb(persistdir): """Delete any cached data from the local rpmdb.""" cachedir = persistdir + "/rpmdb-indexes/" if not os.path.exists(cachedir): filelist = [] else: filelist = misc.getFileList(cachedir, '', []) return _clean_filelist('rpmdb', filelist)
def _clean_files(repos, exts, pathattr, filetype): filelist = [] for ext in exts: for repo in repos.iter_enabled(): if repo.local: continue path = getattr(repo, pathattr) if os.path.exists(path) and os.path.isdir(path): filelist = misc.getFileList(path, ext, filelist) return _clean_filelist(filetype, filelist)