diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-04-19 17:30:57 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-04-19 17:30:57 +0200 |
| commit | d19943ea8489e06a1f5cd0bd545e0a0aeb4b8551 (patch) | |
| tree | a41904c7fbeb9065be976b5dd15661c931e644b2 | |
| parent | a7026989dd1ea3b70cbfc80cf92077efb2f52ba3 (diff) | |
| download | python-apt-d19943ea8489e06a1f5cd0bd545e0a0aeb4b8551.tar.gz | |
* Update the code to use the new classes.
30 files changed, 88 insertions, 88 deletions
diff --git a/apt/cache.py b/apt/cache.py index 05d8d1a9..60fd6553 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -78,10 +78,10 @@ class Cache(object): if progress is None: progress = apt.progress.OpProgress() self._run_callbacks("cache_pre_open") - self._cache = apt_pkg.GetCache(progress) - self._depcache = apt_pkg.GetDepCache(self._cache) - self._records = apt_pkg.GetPkgRecords(self._cache) - self._list = apt_pkg.GetPkgSourceList() + self._cache = apt_pkg.Cache(progress) + self._depcache = apt_pkg.DepCache(self._cache) + self._records = apt_pkg.PackageRecords(self._cache) + self._list = apt_pkg.SourceList() self._list.ReadMainList() self._set = set() self._weakref = weakref.WeakValueDictionary() @@ -154,8 +154,8 @@ class Cache(object): @property def required_download(self): """Get the size of the packages that are required to download.""" - pm = apt_pkg.GetPackageManager(self._depcache) - fetcher = apt_pkg.GetAcquire() + pm = apt_pkg.PackageManager(self._depcache) + fetcher = apt_pkg.Acquire() pm.GetArchives(fetcher, self._list, self._records) return fetcher.FetchNeeded @@ -270,7 +270,7 @@ class Cache(object): def install_archives(self, pm, install_progress): """ The first parameter *pm* refers to an object returned by - apt_pkg.GetPackageManager(). + apt_pkg.PackageManager(). The second parameter *install_progress* refers to an InstallProgress() object of the module apt.progress. @@ -309,8 +309,8 @@ class Cache(object): if install_progress is None: install_progress = apt.progress.InstallProgress() - pm = apt_pkg.GetPackageManager(self._depcache) - fetcher = apt_pkg.GetAcquire(fetch_progress) + pm = apt_pkg.PackageManager(self._depcache) + fetcher = apt_pkg.Acquire(fetch_progress) while True: # fetch archives first res = self._fetch_archives(fetcher, pm) @@ -494,8 +494,8 @@ def _test(): if not os.path.exists(dir): os.mkdir(dir) apt_pkg.Config.Set("Dir::Cache::Archives", "/tmp/pytest") - pm = apt_pkg.GetPackageManager(cache._depcache) - fetcher = apt_pkg.GetAcquire(apt.progress.TextFetchProgress()) + pm = apt_pkg.PackageManager(cache._depcache) + fetcher = apt_pkg.Acquire(apt.progress.TextFetchProgress()) cache._fetch_archives(fetcher, pm) #sys.exit(1) diff --git a/apt/cdrom.py b/apt/cdrom.py index 907ac622..b9625ebf 100644 --- a/apt/cdrom.py +++ b/apt/cdrom.py @@ -45,7 +45,7 @@ class Cdrom(object): """ def __init__(self, progress=None, mountpoint=None, nomount=True): - self._cdrom = apt_pkg.GetCdrom() + self._cdrom = apt_pkg.Cdrom() if progress is None: self._progress = CdromProgress() else: diff --git a/apt/debfile.py b/apt/debfile.py index c60fc92d..6e4adb39 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -57,7 +57,7 @@ class DebPackage(object): "missing '%s' member" % "debian-binary")) control = apt_inst.debExtractControl(open(self.filename)) - self._sections = apt_pkg.ParseSection(control) + self._sections = apt_pkg.TagSection(control) self.pkgname = self._sections["Package"] def __getitem__(self, key): @@ -357,7 +357,7 @@ class DebPackage(object): """Satisfy the dependencies.""" # turn off MarkAndSweep via a action group (if available) try: - _actiongroup = apt_pkg.GetPkgActionGroup(self._cache._depcache) + _actiongroup = apt_pkg.ActionGroup(self._cache._depcache) except AttributeError: pass # check depends @@ -458,7 +458,7 @@ class DscSrcPackage(DebPackage): conflicts_tags = ["Build-Conflicts", "Build-Conflicts-Indep"] fobj = open(file) - tagfile = apt_pkg.ParseTagFile(fobj) + tagfile = apt_pkg.TagFile(fobj) sec = tagfile.Section try: while tagfile.Step() == 1: diff --git a/apt/package.py b/apt/package.py index 411f9635..3dbdf058 100644 --- a/apt/package.py +++ b/apt/package.py @@ -158,7 +158,7 @@ class Record(Mapping): """ def __init__(self, record_str): - self._rec = apt_pkg.ParseSection(record_str) + self._rec = apt_pkg.TagSection(record_str) def __hash__(self): return hash(self._rec) @@ -448,9 +448,9 @@ class Version(object): if _file_is_same(destfile, self.size, self._records.MD5Hash): print 'Ignoring already existing file:', destfile return - acq = apt_pkg.GetAcquire(progress or apt.progress.TextFetchProgress()) - apt_pkg.GetPkgAcqFile(acq, self.uri, self._records.MD5Hash, self.size, - base, destFile=destfile) + acq = apt_pkg.Acquire(progress or apt.progress.TextFetchProgress()) + apt_pkg.AcquireFile(acq, self.uri, self._records.MD5Hash, self.size, + base, destfile=destfile) acq.Run() for item in acq.Items: if item.Status != item.StatDone: @@ -474,8 +474,8 @@ class Version(object): If *unpack* is ``True``, the path to the extracted directory is returned. Otherwise, the path to the .dsc file is returned. """ - src = apt_pkg.GetPkgSrcRecords() - acq = apt_pkg.GetAcquire(progress or apt.progress.TextFetchProgress()) + src = apt_pkg.SourceRecords() + acq = apt_pkg.Acquire(progress or apt.progress.TextFetchProgress()) dsc = None src.Lookup(self.package.name) @@ -497,8 +497,8 @@ class Version(object): continue finally: fobj.close() - apt_pkg.GetPkgAcqFile(acq, src.Index.ArchiveURI(path), md5, size, - base, destFile=destfile) + apt_pkg.AcquireFile(acq, src.Index.ArchiveURI(path), md5, size, + base, destfile=destfile) acq.Run() for item in acq.Items: @@ -879,7 +879,7 @@ class Package(object): # this feature only works if the correct deb-src are in the # sources.list # otherwise we fall back to the binary version number - src_records = apt_pkg.GetPkgSrcRecords() + src_records = apt_pkg.SourceRecords() src_rec = src_records.Lookup(src_pkg) if src_rec: src_ver = src_records.Version @@ -1016,7 +1016,7 @@ class Package(object): self._pcache._depcache.MarkDelete(self._pkg, purge) # try to fix broken stuffsta if auto_fix and self._pcache._depcache.BrokenCount > 0: - fix = apt_pkg.GetPkgProblemResolver(self._pcache._depcache) + fix = apt_pkg.ProblemResolver(self._pcache._depcache) fix.Clear(self._pkg) fix.Protect(self._pkg) fix.Remove(self._pkg) @@ -1043,7 +1043,7 @@ class Package(object): self._pcache._depcache.MarkInstall(self._pkg, auto_inst, from_user) # try to fix broken stuff if auto_fix and self._pcache._depcache.BrokenCount > 0: - fixer = apt_pkg.GetPkgProblemResolver(self._pcache._depcache) + fixer = apt_pkg.ProblemResolver(self._pcache._depcache) fixer.Clear(self._pkg) fixer.Protect(self._pkg) fixer.Resolve(True) diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py index 41a38588..96426a32 100644 --- a/doc/examples/acquire.py +++ b/doc/examples/acquire.py @@ -4,10 +4,10 @@ import apt_pkg import os -def get_file(fetcher, uri, destFile): +def get_file(fetcher, uri, destfile): # get the file - af = apt_pkg.GetPkgAcqFile(fetcher, uri=uri, descr="sample descr", - destFile=destFile) + af = apt_pkg.AcquireFile(fetcher, uri=uri, descr="sample descr", + destfile=destfile) res = fetcher.Run() if res != fetcher.ResultContinue: return False @@ -19,21 +19,21 @@ apt_pkg.init() #apt_pkg.Config.Set("Debug::pkgPackageManager","1"); #apt_pkg.Config.Set("Debug::pkgDPkgProgressReporting","1"); -cache = apt_pkg.GetCache() -depcache = apt_pkg.GetDepCache(cache) +cache = apt_pkg.Cache() +depcache = apt_pkg.DepCache(cache) -recs = apt_pkg.GetPkgRecords(cache) -list = apt_pkg.GetPkgSourceList() +recs = apt_pkg.PackageRecords(cache) +list = apt_pkg.SourceList() list.ReadMainList() # show the amount fetch needed for a dist-upgrade depcache.Upgrade(True) progress = apt.progress.TextFetchProgress() -fetcher = apt_pkg.GetAcquire(progress) -pm = apt_pkg.GetPackageManager(depcache) +fetcher = apt_pkg.Acquire(progress) +pm = apt_pkg.PackageManager(depcache) pm.GetArchives(fetcher, list, recs) print "%s (%s)" % (apt_pkg.SizeToStr(fetcher.FetchNeeded), fetcher.FetchNeeded) -actiongroup = apt_pkg.GetPkgActionGroup(depcache) +actiongroup = apt_pkg.ActionGroup(depcache) for pkg in cache.Packages: depcache.MarkKeep(pkg) @@ -48,9 +48,9 @@ pkg = cache["3ddesktop"] depcache.MarkInstall(pkg) progress = apt.progress.TextFetchProgress() -fetcher = apt_pkg.GetAcquire(progress) -#fetcher = apt_pkg.GetAcquire() -pm = apt_pkg.GetPackageManager(depcache) +fetcher = apt_pkg.Acquire(progress) +#fetcher = apt_pkg.Acquire() +pm = apt_pkg.PackageManager(depcache) print pm print fetcher diff --git a/doc/examples/action.py b/doc/examples/action.py index 8ee86eb7..512945df 100644 --- a/doc/examples/action.py +++ b/doc/examples/action.py @@ -10,7 +10,7 @@ from progress import TextFetchProgress apt_pkg.init() progress = OpTextProgress() -cache = apt_pkg.GetCache(progress) +cache = apt_pkg.Cache(progress) print "Available packages: %s " % cache.PackageCount print "Fetching" @@ -25,7 +25,7 @@ print "example package iter: %s" % iter # get depcache print "\n\n depcache" -depcache = apt_pkg.GetDepCache(cache, progress) +depcache = apt_pkg.DepCache(cache, progress) depcache.ReadPinFile() print "got a depcache: %s " % depcache print "Marked for install: %s " % depcache.InstCount diff --git a/doc/examples/build-deps.py b/doc/examples/build-deps.py index b5ac88a2..656f1361 100755 --- a/doc/examples/build-deps.py +++ b/doc/examples/build-deps.py @@ -21,11 +21,11 @@ def get_source_pkg(pkg, records, depcache): # main apt_pkg.init() -cache = apt_pkg.GetCache() -depcache = apt_pkg.GetDepCache(cache) +cache = apt_pkg.Cache() +depcache = apt_pkg.DepCache(cache) depcache.Init() -records = apt_pkg.GetPkgRecords(cache) -srcrecords = apt_pkg.GetPkgSrcRecords() +records = apt_pkg.PackageRecords(cache) +srcrecords = apt_pkg.SourceRecords() # base package that we use for build-depends calculation if len(sys.argv) < 2: diff --git a/doc/examples/cdrom.py b/doc/examples/cdrom.py index 408bd720..78f2a8af 100644 --- a/doc/examples/cdrom.py +++ b/doc/examples/cdrom.py @@ -10,7 +10,7 @@ from progress import TextCdromProgress # init apt_pkg.init() -cdrom = apt_pkg.GetCdrom() +cdrom = apt_pkg.Cdrom() print cdrom progress = TextCdromProgress() diff --git a/doc/examples/checkstate.py b/doc/examples/checkstate.py index 3368d500..41040b6c 100755 --- a/doc/examples/checkstate.py +++ b/doc/examples/checkstate.py @@ -8,7 +8,7 @@ import apt_pkg apt_pkg.init() -cache = apt_pkg.GetCache() +cache = apt_pkg.Cache() packages = cache.Packages uninstalled, updated, upgradable = {}, {}, {} diff --git a/doc/examples/config.py b/doc/examples/config.py index 9d4e51fc..0dff4cac 100755 --- a/doc/examples/config.py +++ b/doc/examples/config.py @@ -21,7 +21,7 @@ import posixpath # configuration object apt_pkg.Config which is used interally by apt-pkg # routines to control unusual situations. I recommend using the sytem global # whenever possible.. -Cnf = apt_pkg.newConfiguration() +Cnf = apt_pkg.Configuration() print "Command line is", sys.argv diff --git a/doc/examples/configisc.py b/doc/examples/configisc.py index 8da1ad0a..fe3d161b 100755 --- a/doc/examples/configisc.py +++ b/doc/examples/configisc.py @@ -17,7 +17,7 @@ if len(ConfigFile) != 1: print "Must have exactly 1 file name" sys.exit(0) -Cnf = apt_pkg.newConfiguration() +Cnf = apt_pkg.Configuration() apt_pkg.ReadConfigFileISC(Cnf, ConfigFile[0]) # Print the configuration space diff --git a/doc/examples/deb_inspect.py b/doc/examples/deb_inspect.py index cc0d04be..54c52b7b 100755 --- a/doc/examples/deb_inspect.py +++ b/doc/examples/deb_inspect.py @@ -25,7 +25,7 @@ if __name__ == "__main__": print "Now extracting the control file:" control = apt_inst.debExtractControl(open(file)) - sections = apt_pkg.ParseSection(control) + sections = apt_pkg.TagSection(control) print "Maintainer is: " print sections["Maintainer"] diff --git a/doc/examples/depcache.py b/doc/examples/depcache.py index de038fe8..858e45a4 100644 --- a/doc/examples/depcache.py +++ b/doc/examples/depcache.py @@ -9,7 +9,7 @@ from progress import TextProgress apt_pkg.init() progress = TextProgress() -cache = apt_pkg.GetCache(progress) +cache = apt_pkg.Cache(progress) print "Available packages: %s " % cache.PackageCount iter = cache["base-config"] @@ -17,7 +17,7 @@ print "example package iter: %s" % iter # get depcache print "\n\n depcache" -depcache = apt_pkg.GetDepCache(cache) +depcache = apt_pkg.DepCache(cache) depcache.ReadPinFile() # init is needed after the creation/pin file reading depcache.Init(progress) diff --git a/doc/examples/desc.py b/doc/examples/desc.py index 2febf348..d50aa0ce 100644 --- a/doc/examples/desc.py +++ b/doc/examples/desc.py @@ -6,8 +6,8 @@ apt_pkg.init() apt_pkg.Config.Set("APT::Acquire::Translation", "de") -cache = apt_pkg.GetCache() -depcache = apt_pkg.GetDepCache(cache) +cache = apt_pkg.Cache() +depcache = apt_pkg.DepCache(cache) pkg = cache["gcc"] cand = depcache.GetCandidateVer(pkg) @@ -18,7 +18,7 @@ print desc print desc.FileList (f, index) = desc.FileList.pop(0) -records = apt_pkg.GetPkgRecords(cache) +records = apt_pkg.PackageRecords(cache) records.Lookup((f, index)) desc = records.LongDesc print len(desc) diff --git a/doc/examples/indexfile.py b/doc/examples/indexfile.py index 2f1f27f8..cc5070aa 100644 --- a/doc/examples/indexfile.py +++ b/doc/examples/indexfile.py @@ -4,11 +4,11 @@ import apt_pkg apt_pkg.init() -sources = apt_pkg.GetPkgSourceList() +sources = apt_pkg.SourceList() sources.ReadMainList() -cache = apt_pkg.GetCache() -depcache = apt_pkg.GetDepCache(cache) +cache = apt_pkg.Cache() +depcache = apt_pkg.DepCache(cache) pkg = cache["libimlib2"] cand = depcache.GetCandidateVer(pkg) for (f, i) in cand.FileList: diff --git a/doc/examples/metaindex.py b/doc/examples/metaindex.py index 816a3fd7..bbb4ac47 100644 --- a/doc/examples/metaindex.py +++ b/doc/examples/metaindex.py @@ -4,7 +4,7 @@ import apt_pkg apt_pkg.init() -sources = apt_pkg.GetPkgSourceList() +sources = apt_pkg.SourceList() sources.ReadMainList() diff --git a/doc/examples/print_uris.py b/doc/examples/print_uris.py index 3b678e83..c64a4b54 100755 --- a/doc/examples/print_uris.py +++ b/doc/examples/print_uris.py @@ -13,7 +13,7 @@ upgradable = filter(lambda p: p.isUpgradable, cache) for pkg in upgradable: pkg._lookupRecord(True) - path = apt_pkg.ParseSection(pkg._records.Record)["Filename"] + path = apt_pkg.TagSection(pkg._records.Record)["Filename"] cand = pkg._depcache.GetCandidateVer(pkg._pkg) for (packagefile, i) in cand.FileList: indexfile = cache._list.FindIndex(packagefile) diff --git a/doc/examples/recommends.py b/doc/examples/recommends.py index f0b3b1be..0ecd5882 100755 --- a/doc/examples/recommends.py +++ b/doc/examples/recommends.py @@ -3,7 +3,7 @@ import apt_pkg apt_pkg.init() -cache = apt_pkg.GetCache() +cache = apt_pkg.Cache() class Wanted: diff --git a/doc/examples/sources.py b/doc/examples/sources.py index 49652982..bc08ad69 100644 --- a/doc/examples/sources.py +++ b/doc/examples/sources.py @@ -4,10 +4,10 @@ import apt_pkg apt_pkg.init() -#cache = apt_pkg.GetCache() -#sources = apt_pkg.GetPkgSrcRecords(cache) +#cache = apt_pkg.Cache() +#sources = apt_pkg.SourceRecords(cache) -sources = apt_pkg.GetPkgSrcRecords() +sources = apt_pkg.SourceRecords() sources.Restart() while sources.Lookup('hello'): print sources.Package, sources.Version, sources.Maintainer, \ diff --git a/doc/examples/tagfile.py b/doc/examples/tagfile.py index 4faf08ac..770e40de 100755 --- a/doc/examples/tagfile.py +++ b/doc/examples/tagfile.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import apt_pkg -Parse = apt_pkg.ParseTagFile(open("/var/lib/dpkg/status", "r")) +Parse = apt_pkg.TagFile(open("/var/lib/dpkg/status", "r")) while Parse.Step() == 1: print Parse.Section.get("Package") diff --git a/doc/source/examples/cache-packages.py b/doc/source/examples/cache-packages.py index 1abe7cf2..0af96f7d 100644 --- a/doc/source/examples/cache-packages.py +++ b/doc/source/examples/cache-packages.py @@ -8,7 +8,7 @@ def main(): """Main.""" apt_pkg.InitConfig() apt_pkg.InitSystem() - cache = apt_pkg.GetCache() + cache = apt_pkg.Cache() print "Essential packages:" for pkg in cache.Packages: if pkg.Essential: diff --git a/doc/source/examples/cache-pkgfile.py b/doc/source/examples/cache-pkgfile.py index f25975d3..a7c22c97 100644 --- a/doc/source/examples/cache-pkgfile.py +++ b/doc/source/examples/cache-pkgfile.py @@ -5,7 +5,7 @@ import apt_pkg def main(): """Example for PackageFile()""" apt_pkg.init() - cache = apt_pkg.GetCache() + cache = apt_pkg.Cache() for pkgfile in cache.FileList: print 'Package-File:', pkgfile.FileName print 'Index-Type:', pkgfile.IndexType # 'Debian Package Index' diff --git a/doc/source/examples/missing-deps.py b/doc/source/examples/missing-deps.py index 3ca16e45..dd5eeb8a 100644 --- a/doc/source/examples/missing-deps.py +++ b/doc/source/examples/missing-deps.py @@ -35,7 +35,7 @@ def main(): apt_pkg.InitConfig() apt_pkg.InitSystem() - cache = apt_pkg.GetCache() + cache = apt_pkg.Cache() for pkg in sorted(cache.Packages, key=lambda pkg: pkg.Name): # pkg is from a list of packages, sorted by name. diff --git a/tests/cache.py b/tests/cache.py index 87a544e8..f0bf6761 100644 --- a/tests/cache.py +++ b/tests/cache.py @@ -9,8 +9,8 @@ import sys def main(): apt_pkg.init() - cache = apt_pkg.GetCache() - depcache = apt_pkg.GetDepCache(cache) + cache = apt_pkg.Cache() + depcache = apt_pkg.DepCache(cache) depcache.Init() i=0 all=cache.PackageCount diff --git a/tests/depcache.py b/tests/depcache.py index 19aba680..0d59648e 100644 --- a/tests/depcache.py +++ b/tests/depcache.py @@ -9,8 +9,8 @@ import sys def main(): apt_pkg.init() - cache = apt_pkg.GetCache() - depcache = apt_pkg.GetDepCache(cache) + cache = apt_pkg.Cache() + depcache = apt_pkg.DepCache(cache) depcache.Init() i=0 all=cache.PackageCount diff --git a/tests/getcache_mem_corruption.py b/tests/getcache_mem_corruption.py index c3f6eff3..c6e5ff80 100644 --- a/tests/getcache_mem_corruption.py +++ b/tests/getcache_mem_corruption.py @@ -13,12 +13,12 @@ class TestGetCache(unittest.TestCase): def testWrongInvocation(self): # wrongly invoke GetCache() rather than GetDepCache() - apt_cache = apt_pkg.GetCache() - self.assertRaises(ValueError, apt_pkg.GetCache, apt_cache) + apt_cache = apt_pkg.Cache() + self.assertRaises(ValueError, apt_pkg.Cache, apt_cache) def testProperInvocation(self): - apt_cache = apt_pkg.GetCache(apt.progress.OpTextProgress()) - apt_depcache = apt_pkg.GetDepCache(apt_cache) + apt_cache = apt_pkg.Cache(apt.progress.OpTextProgress()) + apt_depcache = apt_pkg.DepCache(apt_cache) if __name__ == "__main__": unittest.main() diff --git a/tests/memleak.py b/tests/memleak.py index 659091fc..5299f35f 100755 --- a/tests/memleak.py +++ b/tests/memleak.py @@ -29,10 +29,10 @@ for i in range(100): # no memleak, but more or less the apt.Cache.open() code for i in range(100): - cache = apt_pkg.GetCache() - depcache = apt_pkg.GetDepCache(cache) - records = apt_pkg.GetPkgRecords(cache) - list = apt_pkg.GetPkgSourceList() + cache = apt_pkg.Cache() + depcache = apt_pkg.DepCache(cache) + records = apt_pkg.PackageRecords(cache) + list = apt_pkg.SourceList() list.ReadMainList() dict = {} for pkg in cache.Packages: diff --git a/tests/pkgproblemresolver.py b/tests/pkgproblemresolver.py index a21d8d9d..0d6d0611 100644 --- a/tests/pkgproblemresolver.py +++ b/tests/pkgproblemresolver.py @@ -9,8 +9,8 @@ import sys def main(): apt_pkg.init() - cache = apt_pkg.GetCache() - depcache = apt_pkg.GetDepCache(cache) + cache = apt_pkg.Cache() + depcache = apt_pkg.DepCache(cache) depcache.Init() i=0 all=cache.PackageCount @@ -25,7 +25,7 @@ def main(): if ver is not None: depcache.MarkInstall(pkg) if depcache.BrokenCount > 0: - fixer = apt_pkg.GetPkgProblemResolver(depcache) + fixer = apt_pkg.ProblemResolver(depcache) fixer.Clear(pkg) fixer.Protect(pkg) # we first try to resolve the problem diff --git a/tests/pkgrecords.py b/tests/pkgrecords.py index 5866847d..2fe6ad20 100644 --- a/tests/pkgrecords.py +++ b/tests/pkgrecords.py @@ -10,14 +10,14 @@ import sys def main(): apt_pkg.init() - cache = apt_pkg.GetCache() - depcache = apt_pkg.GetDepCache(cache) + cache = apt_pkg.Cache() + depcache = apt_pkg.DepCache(cache) depcache.Init() i=0 print "Running PkgRecords test on all packages:" for pkg in cache.Packages: i += 1 - records = apt_pkg.GetPkgRecords(cache) + records = apt_pkg.PackageRecords(cache) if len(pkg.VersionList) == 0: #print "no available version, cruft" continue diff --git a/tests/pkgsrcrecords.py b/tests/pkgsrcrecords.py index 77670540..2ea9dd3a 100644 --- a/tests/pkgsrcrecords.py +++ b/tests/pkgsrcrecords.py @@ -10,12 +10,12 @@ import sys def main(): apt_pkg.init() - cache = apt_pkg.GetCache() + cache = apt_pkg.Cache() i=0 print "Running PkgSrcRecords test on all packages:" for x in cache.Packages: i += 1 - src = apt_pkg.GetPkgSrcRecords() + src = apt_pkg.SourceRecords() if src.Lookup(x.Name): #print src.Package pass |
