summaryrefslogtreecommitdiff
path: root/apt/debfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'apt/debfile.py')
-rw-r--r--apt/debfile.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/apt/debfile.py b/apt/debfile.py
index 6e4adb39..84bbe3ab 100644
--- a/apt/debfile.py
+++ b/apt/debfile.py
@@ -52,11 +52,11 @@ class DebPackage(object):
def open(self, filename):
" open given debfile "
self.filename = filename
- if not apt_inst.arCheckMember(open(self.filename), "debian-binary"):
+ if not apt_inst.ar_check_member(open(self.filename), "debian-binary"):
raise NoDebArchiveException(_("This is not a valid DEB archive, "
"missing '%s' member" %
"debian-binary"))
- control = apt_inst.debExtractControl(open(self.filename))
+ control = apt_inst.deb_extract_control(open(self.filename))
self._sections = apt_pkg.TagSection(control)
self.pkgname = self._sections["Package"]
@@ -72,9 +72,9 @@ class DebPackage(object):
files.append(name)
for member in self._supported_data_members:
- if apt_inst.arCheckMember(open(self.filename), member):
+ if apt_inst.ar_check_member(open(self.filename), member):
try:
- apt_inst.debExtract(open(self.filename), extract_cb,
+ apt_inst.deb_extract(open(self.filename), extract_cb,
member)
break
except SystemError:
@@ -106,7 +106,7 @@ class DebPackage(object):
continue
inst = self._cache[depname].installed
- if inst is not None and apt_pkg.CheckDep(inst.version, oper, ver):
+ if inst is not None and apt_pkg.check_dep(inst.version, oper, ver):
return True
return False
@@ -129,10 +129,10 @@ class DebPackage(object):
# now check if we can satisfy the deps with the candidate(s)
# in the cache
pkg = self._cache[depname]
- cand = self._cache._depcache.GetCandidateVer(pkg._pkg)
+ cand = self._cache._depcache.get_candidate_ver(pkg._pkg)
if not cand:
continue
- if not apt_pkg.CheckDep(cand.VerStr, oper, ver):
+ if not apt_pkg.check_dep(cand.ver_str, oper, ver):
continue
# check if we need to install it
@@ -168,7 +168,7 @@ class DebPackage(object):
#print "ver: %s" % ver
#print "pkgver: %s " % pkgver
#print "oper: %s " % oper
- if (apt_pkg.CheckDep(pkgver, oper, ver) and not
+ if (apt_pkg.check_dep(pkgver, oper, ver) and not
self.replaces_real_pkg(pkgname, oper, ver)):
self._failure_string += _("Conflicts with the installed package "
"'%s'" % pkg.name)
@@ -211,7 +211,7 @@ class DebPackage(object):
"""List of package names conflicting with this package."""
key = "Conflicts"
try:
- return apt_pkg.ParseDepends(self._sections[key])
+ return apt_pkg.parse_depends(self._sections[key])
except KeyError:
return []
@@ -222,7 +222,7 @@ class DebPackage(object):
# find depends
for key in "Depends", "PreDepends":
try:
- depends.extend(apt_pkg.ParseDepends(self._sections[key]))
+ depends.extend(apt_pkg.parse_depends(self._sections[key]))
except KeyError:
pass
return depends
@@ -232,7 +232,7 @@ class DebPackage(object):
"""List of virtual packages which are provided by this package."""
key = "Provides"
try:
- return apt_pkg.ParseDepends(self._sections[key])
+ return apt_pkg.parse_depends(self._sections[key])
except KeyError:
return []
@@ -241,7 +241,7 @@ class DebPackage(object):
"""List of packages which are replaced by this package."""
key = "Replaces"
try:
- return apt_pkg.ParseDepends(self._sections[key])
+ return apt_pkg.parse_depends(self._sections[key])
except KeyError:
return []
@@ -261,7 +261,7 @@ class DebPackage(object):
pkgver = None
for or_group in self.replaces:
for (name, ver, oper) in or_group:
- if (name == pkgname and apt_pkg.CheckDep(pkgver, oper, ver)):
+ if (name == pkgname and apt_pkg.check_dep(pkgver, oper, ver)):
self._dbg(3, "we have a replaces in our package for the "
"conflict against '%s'" % (pkgname))
return True
@@ -298,7 +298,7 @@ class DebPackage(object):
else:
cachever = self._cache[pkgname].candidate.version
if cachever is not None:
- cmp = apt_pkg.VersionCompare(cachever, debver)
+ cmp = apt_pkg.version_compare(cachever, debver)
self._dbg(1, "CompareVersion(debver,instver): %s" % cmp)
if cmp == 0:
return VERSION_SAME
@@ -310,11 +310,11 @@ class DebPackage(object):
def check(self):
"""Check if the package is installable."""
- self._dbg(3, "checkDepends")
+ self._dbg(3, "check_depends")
# check arch
arch = self._sections["Architecture"]
- if arch != "all" and arch != apt_pkg.Config.Find("APT::Architecture"):
+ if arch != "all" and arch != apt_pkg.config.find("APT::Architecture"):
self._dbg(1, "ERROR: Wrong architecture dude!")
self._failure_string = _("Wrong architecture '%s'" % arch)
return False
@@ -341,7 +341,7 @@ class DebPackage(object):
if not self.check_conflicts():
return False
- if self._cache._depcache.BrokenCount > 0:
+ if self._cache._depcache.broken_count > 0:
self._failure_string = _("Failed to satisfy all dependencies "
"(broken cache)")
# clean the cache again
@@ -351,7 +351,7 @@ class DebPackage(object):
def satisfy_depends_str(self, dependsstr):
"""Satisfy the dependencies in the given string."""
- return self._satisfy_depends(apt_pkg.ParseDepends(dependsstr))
+ return self._satisfy_depends(apt_pkg.parse_depends(dependsstr))
def _satisfy_depends(self, depends):
"""Satisfy the dependencies."""
@@ -459,17 +459,17 @@ class DscSrcPackage(DebPackage):
fobj = open(file)
tagfile = apt_pkg.TagFile(fobj)
- sec = tagfile.Section
+ sec = tagfile.section
try:
- while tagfile.Step() == 1:
+ while tagfile.step() == 1:
for tag in depends_tags:
if not tag in sec:
continue
- self._depends.extend(apt_pkg.ParseSrcDepends(sec[tag]))
+ self._depends.extend(apt_pkg.parse_src_depends(sec[tag]))
for tag in conflicts_tags:
if not tag in sec:
continue
- self._conflicts.extend(apt_pkg.ParseSrcDepends(sec[tag]))
+ self._conflicts.extend(apt_pkg.parse_src_depends(sec[tag]))
if 'Source' in sec:
self.pkgname = sec['Source']
if 'Binary' in sec:
@@ -490,7 +490,7 @@ class DscSrcPackage(DebPackage):
"""Check if the package is installable.."""
if not self.check_conflicts():
for pkgname in self._installed_conflicts:
- if self._cache[pkgname]._pkg.Essential:
+ if self._cache[pkgname]._pkg.essential:
raise Exception(_("An essential package would be removed"))
self._cache[pkgname].mark_delete()
# FIXME: a additional run of the checkConflicts()
@@ -525,13 +525,13 @@ def _test():
print ret
#s = DscSrcPackage(cache, "../tests/3ddesktop_0.2.9-6.dsc")
- #s.checkDep()
+ #s.check_dep()
#print "Missing deps: ",s.missingDeps
#print "Print required changes: ", s.requiredChanges
s = DscSrcPackage(cache=cache)
d = "libc6 (>= 2.3.2), libaio (>= 0.3.96) | libaio1 (>= 0.3.96)"
- print s._satisfy_depends(apt_pkg.ParseDepends(d))
+ print s._satisfy_depends(apt_pkg.parse_depends(d))
if __name__ == "__main__":
_test()