diff options
| author | Sebastian Heinlein <sebi@glatzor.de> | 2008-08-22 06:11:16 +0200 |
|---|---|---|
| committer | Sebastian Heinlein <sebi@glatzor.de> | 2008-08-22 06:11:16 +0200 |
| commit | 5ea022079850f3d7ab2411cf3f150435f140fdfe (patch) | |
| tree | c658c57263d646ef80e9f8a4aa8cd09f76c0edd0 /apt/dpkg.py | |
| parent | 142e015192e7c4f97664a08d50753073106a689f (diff) | |
| download | python-apt-5ea022079850f3d7ab2411cf3f150435f140fdfe.tar.gz | |
Make DpkgInstallProgress an inheritance of InstallProgress
Diffstat (limited to 'apt/dpkg.py')
| -rw-r--r-- | apt/dpkg.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apt/dpkg.py b/apt/dpkg.py index 7f4341f3..7ebc551f 100644 --- a/apt/dpkg.py +++ b/apt/dpkg.py @@ -29,6 +29,7 @@ import sys import os from gettext import gettext as _ from cache import Cache +from progress import DpkgInstallProgress class DebPackage(object): debug = 0 @@ -397,6 +398,13 @@ class DebPackage(object): if level <= self.debug: print >> sys.stderr, msg + def install(self, installProgress=None): + """ Install the package """ + if installProgress == None: + res = os.system("/usr/sbin/dpkg -i %s" % self.file) + else: + res = installProgress.run(self.file) + return res class DscSrcPackage(DebPackage): def __init__(self, cache, file=None): @@ -468,6 +476,10 @@ if __name__ == "__main__": print "missing deps: %s" % d.missingDeps print d.requiredChanges + print "Installing ..." + ret = d.install(DpkgInstallProgress()) + print ret + #s = DscSrcPackage(cache, "../tests/3ddesktop_0.2.9-6.dsc") #s.checkDep() #print "Missing deps: ",s.missingDeps @@ -477,3 +489,4 @@ if __name__ == "__main__": d = "libc6 (>= 2.3.2), libaio (>= 0.3.96) | libaio1 (>= 0.3.96)" print s._satisfyDepends(apt_pkg.ParseDepends(d)) + |
