From ad44ef46951d3419321a8c1dd297ae683519ca71 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Thu, 30 Jun 2016 16:13:17 -0400 Subject: [PATCH] Remove duplicate definition of find_old_composes... This lives now in pungi.util. It was copied there long ago and all the places that reference it reference it in that location. I think this code in pungi.phases.pkgset is unused and can be removed. The other function moved to the common module. Signed-off-by: Ralph Bean --- pungi/phases/pkgset/__init__.py | 53 --------------------------------- 1 file changed, 53 deletions(-) diff --git a/pungi/phases/pkgset/__init__.py b/pungi/phases/pkgset/__init__.py index 6f3a4208..cdb47469 100644 --- a/pungi/phases/pkgset/__init__.py +++ b/pungi/phases/pkgset/__init__.py @@ -44,56 +44,3 @@ class PkgsetPhase(PhaseBase): container = PkgsetSourceContainer() SourceClass = container[pkgset_source] self.package_sets, self.path_prefix = SourceClass(self.compose)() - - -# TODO: per arch? -def populate_arch_pkgsets(compose, path_prefix, global_pkgset): - result = {} - for arch in compose.get_arches(): - compose.log_info("Populating package set for arch: %s" % arch) - is_multilib = is_arch_multilib(compose.conf, arch) - arches = get_valid_arches(arch, is_multilib, add_src=True) - pkgset = pungi.phases.pkgset.pkgsets.PackageSetBase(compose.conf["sigkeys"], logger=compose._logger, arches=arches) - pkgset.merge(global_pkgset, arch, arches) - pkgset.save_file_list(compose.paths.work.package_list(arch=arch), remove_path_prefix=path_prefix) - result[arch] = pkgset - return result - - -def find_old_compose(old_compose_dirs, shortname=None, version=None): - composes = [] - - for compose_dir in force_list(old_compose_dirs): - if not os.path.isdir(compose_dir): - continue - - # get all finished composes - for i in os.listdir(compose_dir): - # TODO: read .composeinfo - if shortname and not i.startswith(shortname): - continue - - if shortname and version and not i.startswith("%s-%s" % (shortname, version)): - continue - - path = os.path.join(compose_dir, i) - if not os.path.isdir(path): - continue - - if os.path.islink(path): - continue - - status_path = os.path.join(path, "STATUS") - if not os.path.isfile(status_path): - continue - - try: - if open(status_path, "r").read().strip() in ("FINISHED", "DOOMED"): - composes.append((i, os.path.abspath(path))) - except: - continue - - if not composes: - return None - - return sorted(composes)[-1][1]