diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-12-06 18:56:25 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-12-06 18:56:25 +0000 |
| commit | b1ce3179428c2b1c8384c2b0a12ef9d8c1172f72 (patch) | |
| tree | 54c556197c78b0a0af8bc0ce16bfb0def2841a73 /apt | |
| parent | 712fd8a6948cc3f11de57f7abf598a8df18a646b (diff) | |
| download | python-apt-b1ce3179428c2b1c8384c2b0a12ef9d8c1172f72.tar.gz | |
* candidate origin returns a list now
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/package.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/apt/package.py b/apt/package.py index 5fb6ade7..130340f4 100644 --- a/apt/package.py +++ b/apt/package.py @@ -235,14 +235,7 @@ class Package(object): # canidate origin class Origin: - def __init__(self,pkg): - ver = pkg._depcache.GetCandidateVer(pkg._pkg) - if not ver: - return None - (VerFileIter,index) = ver.FileList.pop() - #print len(VerFileIter) - #print VerFileIter - #return VerFileIter.Component + def __init__(self,VerFileIter): self.component = VerFileIter.Component self.archive = VerFileIter.Archive self.origin = VerFileIter.Origin @@ -254,7 +247,13 @@ class Package(object): self.origin, self.label, self.site) def candidateOrigin(self): - return self.Origin(self) + ver = pkg._depcache.GetCandidateVer(pkg._pkg) + if not ver: + return None + origins = [] + for (verFileIter,index) in ver.FileList: + origins.append(self.Origin(verFileIter)) + return origins candidateOrigin = property(candidateOrigin) # depcache actions @@ -319,7 +318,7 @@ if __name__ == "__main__": print "Installed: %s " % pkg.installedVersion print "Candidate: %s " % pkg.candidateVersion print "CandiateDownloadable: %s" % pkg.candidateDownloadable - print "CandiateOrigin: %s" % pkg.candidateOrigin + print "CandiateOrigins: %s" % pkg.candidateOrigin print "SourcePkg: %s " % pkg.sourcePackageName print "Section: %s " % pkg.section print "Summary: %s" % pkg.summary |
