From aad18d570b05f8b95e87c45e89dadebff4d8bb22 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Jul 25 2017 02:46:42 +0000 Subject: avoid with statement --- diff --git a/builder/kojid b/builder/kojid index 5df7d27..45250b6 100755 --- a/builder/kojid +++ b/builder/kojid @@ -5124,23 +5124,23 @@ class createDistRepoTask(CreaterepoTask): # step 1: figure out which packages are multilib (should already exist) mlm = multilib.DevelMultilibMethod(ml_conf) fs_missing = set() - with open(self.pkglist) as pkglist: - for pkg in pkglist: - ppath = os.path.join(self.repodir, pkg.strip()) - po = yum.packages.YumLocalPackage(filename=ppath) - if mlm.select(po) and arch in self.archmap: - # we need a multilib package to be included - # we assume the same signature level is available - # XXX: what is a subarchitecture is the right answer? - pl_path = pkg.replace(arch, self.archmap[arch]).strip() - # assume this exists in the task results for the ml arch - real_path = os.path.join(mldir, pl_path) - if not os.path.exists(real_path): - self.logger.error('%s (multilib) is not on the filesystem' % real_path) - fs_missing.add(real_path) - # we defer failure so can report all the missing deps - continue - ml_true.add(real_path) + pkglist = open(self.pkglist) + for pkg in pkglist: + ppath = os.path.join(self.repodir, pkg.strip()) + po = yum.packages.YumLocalPackage(filename=ppath) + if mlm.select(po) and arch in self.archmap: + # we need a multilib package to be included + # we assume the same signature level is available + # XXX: what is a subarchitecture is the right answer? + pl_path = pkg.replace(arch, self.archmap[arch]).strip() + # assume this exists in the task results for the ml arch + real_path = os.path.join(mldir, pl_path) + if not os.path.exists(real_path): + self.logger.error('%s (multilib) is not on the filesystem' % real_path) + fs_missing.add(real_path) + # we defer failure so can report all the missing deps + continue + ml_true.add(real_path) # step 2: set up architectures for yum configuration self.logger.info("Resolving multilib for %s using method devel" % arch)