Merge lp://staging/~jacseen/keryx/devel into lp://staging/~keryx-admins/keryx/devel

Proposed by Jack N
Status: Superseded
Proposed branch: lp://staging/~jacseen/keryx/devel
Merge into: lp://staging/~keryx-admins/keryx/devel
Diff against target: 97 lines
2 files modified
libkeryx/definitions/dpkg/__init__.py (+12/-5)
libkeryx/definitions/dpkg/minideblib/AptRepoClient.py (+12/-8)
To merge this branch: bzr merge lp://staging/~jacseen/keryx/devel
Reviewer Review Type Date Requested Status
mac9416 Needs Fixing
Review via email: mp+13393@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2009-10-17.

To post a comment you must log in.
Revision history for this message
Jack N (jacseen) wrote :

In dependency calculations, not-found packages can now be handled by keryx(for user feedback...).

Revision history for this message
mac9416 (mac9416) wrote :

Thanks for the work, jacseen. Good to have another head to help me out.

Uno problemo:

"""
(devel)mac9416@mac9416-laptop:~/jacseen-keryx-devel$ python keryx.py
Traceback (most recent call last):
  File "keryx.py", line 15, in <module>
    import libkeryx
  File "/home/mac9416/jacseen-keryx-devel/libkeryx/__init__.py", line 283, in <module>
    _initialize()
  File "/home/mac9416/jacseen-keryx-devel/libkeryx/__init__.py", line 264, in _initialize
    definitions = map(__import__, moduleNames)
  File "/home/mac9416/jacseen-keryx-devel/libkeryx/definitions/dpkg/__init__.py", line 265
    getpkg = self.apt_client.get_binary_name_version(?) # Nice short alias
                                                     ^
SyntaxError: invalid syntax
"""

I'd fix it myself, but I'm not sure what you had in mind using the "(?)", so I'll let you fix it.

Thanks again!

review: Needs Fixing
lp://staging/~jacseen/keryx/devel updated
33. By Jack N

merged in mac9416's fix to my fix to his correct code.

Unmerged revisions

33. By Jack N

merged in mac9416's fix to my fix to his correct code.

32. By Jack N

reconfigured not-found list for depcalc

31. By Jack N

Added packages-not-found to depcalc recursion.

30. By mac9416

Merged ~mac9416/keryx/devel changes - 10/11/09

29. By mac9416

Merged ~mac9416/keryx/devel changes

28. By mac9416

Merged ~mac9416/keryx/devel changes

27. By mac9416

Merged ~mac9416/keryx/devel changes

26. By mac9416

Merged ~mac9416/keryx/devel changes

25. By mac9416

Merge ~mac9416/keryx/devel changes

24. By mac9416

Merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libkeryx/definitions/dpkg/__init__.py'
2--- libkeryx/definitions/dpkg/__init__.py 2009-10-12 03:47:22 +0000
3+++ libkeryx/definitions/dpkg/__init__.py 2009-10-17 03:58:58 +0000
4@@ -210,12 +210,15 @@
5 #TODO: Add PPA support to minideblib so this will not be necessary.
6
7 depends = []
8- for pkg in upgrade:
9- depends += self.apt_client.get_binary_dependencies(pkg, exclude=[x.name for x in status])
10+ depends, nfound = self.apt_client.get_binary_dependencies(upgrade, exclude=[x.name for x in status])
11
12 print depends
13
14 print "%i upgradeable packages" % (len(upgrade))
15+ if nfound:
16+ #TODO: Should we abort if unresolved dependencies?
17+ print nfound
18+ print "%i packages not found" % (len(nfound))
19 self.Download(upgrade+depends)
20
21
22@@ -227,7 +230,8 @@
23 def OnDepends(self, packages):
24 """Print a list of depends/recommends/suggests of packages"""
25 for package in packages:
26- print package, self.apt_client.get_binary_dependencies(package)
27+ depends, nfound = self.apt_client.get_binary_dependencies(package)
28+ print package, depends+nfound
29
30
31 def OnDownload(self, packages):
32@@ -236,11 +240,14 @@
33 filter(Status.proj_id==self.project_entry.id).all()
34
35 print "Calculating dependencies...",
36- depends = self.apt_client.get_binary_dependencies(packages, exclude=[x.name for x in status])
37+ depends, nfound = self.apt_client.get_binary_dependencies(packages, exclude=[x.name for x in status])
38 print "Done"
39
40 print "The following extra packages will be downloaded:\n%s" % (" ".join(depends))
41- print "%i packages downloaded." % (len(depends))
42+ if nfound:
43+ #TODO: Should we abort if unresolved dependencies?
44+ print "The following packages could not be found:\n%s" % (" ".join(nfound))
45+ print "%i packages to download." % (len(depends))
46
47 answer = self._question("Do you want to continue")
48 if answer:
49
50=== modified file 'libkeryx/definitions/dpkg/minideblib/AptRepoClient.py'
51--- libkeryx/definitions/dpkg/minideblib/AptRepoClient.py 2009-10-10 02:54:03 +0000
52+++ libkeryx/definitions/dpkg/minideblib/AptRepoClient.py 2009-10-17 03:58:58 +0000
53@@ -565,20 +565,22 @@
54 return _get_available_pkgs(base_url, self.binaries)
55
56 def get_binary_dependencies(self, packages, depends=True, predepends=True,
57- recommends=True, exclude=[], current=[]):
58+ recommends=True, exclude=[], current=[], nfound=[]):
59 """Returns a list of packages that are dependencies of the provided
60- package names.
61+ package names, and a list of unresolvable dependencies.
62 """
63 for package in packages:
64- # If the package is already installed or dep-checked, skip it.
65- if package in exclude or package in current:
66+ # If the package is already installed or dep-checked or not-found, skip it.
67+ if package in exclude or package in current or package in nfound:
68 continue # Next package
69
70 # Get the dependencies for this package.
71 try:
72 data = self.get_binary_name_version(package)[0]
73 except IndexError:
74- return current
75+ # If package is not found, note it and skip to next one
76+ nfound += [package]
77+ continue
78 dependencies = []
79 if depends and data.has_key("depends"):
80 dependencies += [x.split()[0] for x in data["depends"].split(", ")]
81@@ -591,11 +593,13 @@
82 current += [package]
83
84 # Find each depend's depend's, adding them to the download list.
85- for item in dependencies:
86- current = self.get_binary_dependencies([item], exclude=exclude, current=current)
87+ # though whats actually returned is a list of
88+ # currently handled packages as well as all handled by the dependencies.
89+ if dependencies:
90+ current, nfound = self.get_binary_dependencies(dependencies, exclude=exclude, current=current, nfound=nfound)
91
92 # Return the package list.
93- return current
94+ return current, nfound
95
96 def __get_best_version(self, package, base_url, pkgcache):
97 """

Subscribers

People subscribed via source and target branches