def clean_tests(self): # do not remove incorrect dirs accidentally top_dir = os.path.normpath(os.path.join(self.build_lib, "..")) cprefix = os.path.commonprefix((self.build_base, top_dir)) if cprefix != self.build_base: return bin_dir = os.path.join(top_dir, "bin") if os.path.exists(bin_dir): remove_tree(bin_dir) conf_dir = os.path.join(top_dir, "cnf") if os.path.islink(conf_dir): print("removing %s symlink" % repr(conf_dir)) os.unlink(conf_dir) pni_file = os.path.join(top_dir, ".portage_not_installed") if os.path.exists(pni_file): print("removing %s" % repr(pni_file)) os.unlink(pni_file)
def clean_tests(self): # do not remove incorrect dirs accidentally top_dir = os.path.normpath(os.path.join(self.build_lib, '..')) cprefix = os.path.commonprefix((self.build_base, top_dir)) if cprefix != self.build_base: return bin_dir = os.path.join(top_dir, 'bin') if os.path.exists(bin_dir): remove_tree(bin_dir) conf_dir = os.path.join(top_dir, 'cnf') if os.path.islink(conf_dir): print('removing %s symlink' % repr(conf_dir)) os.unlink(conf_dir) pni_file = os.path.join(top_dir, '.repoman_not_installed') if os.path.exists(pni_file): print('removing %s' % repr(pni_file)) os.unlink(pni_file)
def clean_docs(): def get_doc_outfiles(): for dirpath, _dirnames, filenames in os.walk("doc"): for f in filenames: if f.endswith(".docbook") or f == "custom.xsl": pass else: yield os.path.join(dirpath, f) # do not recurse break for f in get_doc_outfiles(): print("removing %s" % repr(f)) os.remove(f) if os.path.isdir("doc/fragment"): remove_tree("doc/fragment") if os.path.isdir("doc/api/build"): remove_tree("doc/api/build")
def clean_man(self): man_dir = os.path.join(self.build_base, "man") if os.path.exists(man_dir): remove_tree(man_dir)