FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Build System

 
 
LinkBack Thread Tools
 
Old 07-19-2012, 08:21 PM
Bill Nottingham
 
Default Use a single method for finding inital packages, regardless of 'alldeps' config setting.

Greedy matching should only matter for dependencies, not for explicitly specified packages.

Signed-off-by: Bill Nottingham <notting@redhat.com>
---
src/pypungi/__init__.py | 57 +++++++++++++++--------------------------------
1 file changed, 18 insertions(+), 39 deletions(-)

diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py
index 8366434..3cfc05b 100644
--- a/src/pypungi/__init__.py
+++ b/src/pypungi/__init__.py
@@ -483,45 +483,24 @@ class Pungi(pypungi.PungiBase):
# Make the search list unique
searchlist = yum.misc.unique(searchlist)

- if self.config.getboolean('pungi', 'alldeps'):
- # greedy
- # Search repos for things in our searchlist, supports globs
- (exactmatched, matched, unmatched) = yum.packages.parsePackages(self.ayum.pkgSack.retur nPackages(), searchlist, casematch=1)
- matches = filter(self._filtersrcdebug, exactmatched + matched)
- matches = self.excludePackages(matches)
-
- # Populate a dict of package objects to their names
- for match in matches:
- matchdict[match.name] = match
-
- # Get the newest results from the search
- mysack = yum.packageSack.ListPackageSack(matches)
- for match in mysack.returnNewestByNameArch():
- self.ayum.tsInfo.addInstall(match)
- self.logger.info('Found %s.%s' % (match.name, match.arch))
-
- for pkg in unmatched:
- if not pkg in matchdict.keys():
- self.logger.warn('Could not find a match for %s in any configured repo' % pkg)
- else:
- # nogreedy
- for name in searchlist:
- arch = None
- if "." in name:
- name, arch = name.rsplit(".", 1)
-
- pkg_sack = self.ayum.pkgSack.searchNevra(name=name, arch=arch)
- # filter sources out of the package sack
- pkg_sack = [ i for i in pkg_sack if i.arch not in ("src", "nosrc") ]
- pkg_sack = self.excludePackages(pkg_sack)
-
- match = self.ayum._bestPackageFromList(pkg_sack)
- if not match:
- self.logger.warn('Could not find a match for %s in any configured repo' % name)
- continue
-
- self.ayum.tsInfo.addInstall(match)
- self.logger.info('Found %s.%s' % (match.name, match.arch))
+ # Search repos for things in our searchlist, supports globs
+ (exactmatched, matched, unmatched) = yum.packages.parsePackages(self.ayum.pkgSack.retur nPackages(), searchlist, casematch=1)
+ matches = filter(self._filtersrcdebug, exactmatched + matched)
+ matches = self.excludePackages(matches)
+
+ # Populate a dict of package objects to their names
+ for match in matches:
+ matchdict[match.name] = match
+
+ # Get the newest results from the search
+ mysack = yum.packageSack.ListPackageSack(matches)
+ for match in mysack.returnNewestByNameArch():
+ self.ayum.tsInfo.addInstall(match)
+ self.logger.info('Found %s.%s' % (match.name, match.arch))
+
+ for pkg in unmatched:
+ if not pkg in matchdict.keys():
+ self.logger.warn('Could not find a match for %s in any configured repo' % pkg)

if len(self.ayum.tsInfo) == 0:
raise yum.Errors.MiscError, 'No packages found to download.'
--
1.7.10.4

--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 

Thread Tools




All times are GMT. The time now is 03:51 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org