Jack N has proposed merging lp:~jacseen/keryx/devel into lp:keryx/devel. Requested reviews: Keryx Admins (keryx-admins)
In dependency calculations, not-found packages can now be handled by keryx(for user feedback...). -- https://code.launchpad.net/~jacseen/keryx/devel/+merge/13393 Your team Keryx Development Team is subscribed to branch lp:keryx/devel.
=== modified file 'libkeryx/definitions/dpkg/__init__.py' --- libkeryx/definitions/dpkg/__init__.py 2009-10-12 03:47:22 +0000 +++ libkeryx/definitions/dpkg/__init__.py 2009-10-15 01:25:20 +0000 @@ -210,12 +210,15 @@ #TODO: Add PPA support to minideblib so this will not be necessary. depends = [] - for pkg in upgrade: - depends += self.apt_client.get_binary_dependencies(pkg, exclude=[x.name for x in status]) + depends, nfound = self.apt_client.get_binary_dependencies(upgrade, exclude=[x.name for x in status]) print depends print "%i upgradeable packages" % (len(upgrade)) + if nfound: + #TODO: Should we abort if unresolved dependencies? + print nfound + print "%i packages not found" % (len(nfound)) self.Download(upgrade+depends) @@ -227,7 +230,8 @@ def OnDepends(self, packages): """Print a list of depends/recommends/suggests of packages""" for package in packages: - print package, self.apt_client.get_binary_dependencies(package) + depends, nfound = self.apt_client.get_binary_dependencies(package) + print package, depends+nfound def OnDownload(self, packages): @@ -236,11 +240,14 @@ filter(Status.proj_id==self.project_entry.id).all() print "Calculating dependencies...", - depends = self.apt_client.get_binary_dependencies(packages, exclude=[x.name for x in status]) + depends, nfound = self.apt_client.get_binary_dependencies(packages, exclude=[x.name for x in status]) print "Done" print "The following extra packages will be downloaded:\n%s" % (" ".join(depends)) - print "%i packages downloaded." % (len(depends)) + if nfound: + #TODO: Should we abort if unresolved dependencies? + print "The following packages could not be found:\n%s" % (" ".join(nfound)) + print "%i packages to download." % (len(depends)) answer = self._question("Do you want to continue") if answer: @@ -255,7 +262,7 @@ available = self.apt_client.get_available_binaries() # Make a list of packnames - descriptions - getpkg = self.apt_client.get_binary_name_version # Nice short alias + getpkg = self.apt_client.get_binary_name_version(?) # Nice short alias data = ["%s - %s" % (x, "\n".join(getpkg(x)[0]["description"])) for x in available] # Build the results list. === modified file 'libkeryx/definitions/dpkg/minideblib/AptRepoClient.py' --- libkeryx/definitions/dpkg/minideblib/AptRepoClient.py 2009-10-10 02:54:03 +0000 +++ libkeryx/definitions/dpkg/minideblib/AptRepoClient.py 2009-10-15 01:25:20 +0000 @@ -565,20 +565,22 @@ return _get_available_pkgs(base_url, self.binaries) def get_binary_dependencies(self, packages, depends=True, predepends=True, - recommends=True, exclude=[], current=[]): + recommends=True, exclude=[], current=[], nfound=[]): """Returns a list of packages that are dependencies of the provided - package names. + package names, and a list of unresolvable dependencies. """ for package in packages: - # If the package is already installed or dep-checked, skip it. - if package in exclude or package in current: + # If the package is already installed or dep-checked or not-found, skip it. + if package in exclude or package in current or package in nfound: continue # Next package # Get the dependencies for this package. try: data = self.get_binary_name_version(package)[0] except IndexError: - return current + # If package is not found, note it and skip to next one + nfound += [package] + continue dependencies = [] if depends and data.has_key("depends"): dependencies += [x.split()[0] for x in data["depends"].split(", ")] @@ -591,11 +593,13 @@ current += [package] # Find each depend's depend's, adding them to the download list. - for item in dependencies: - current = self.get_binary_dependencies([item], exclude=exclude, current=current) + # though whats actually returned is a list of + # currently handled packages as well as all handled by the dependencies. + if dependencies: + current, nfound = self.get_binary_dependencies(dependencies, exclude=exclude, current=current, nfound=nfound) # Return the package list. - return current + return current, nfound def __get_best_version(self, package, base_url, pkgcache): """
_______________________________________________ Mailing list: https://launchpad.net/~keryx Post to : keryx@lists.launchpad.net Unsubscribe : https://launchpad.net/~keryx More help : https://help.launchpad.net/ListHelp