commit the first half of tims patch
This commit is contained in:
parent
62f8137ef0
commit
e60fbf7804
@ -83,7 +83,7 @@ class PackageKitBaseBackend:
|
||||
send 'status' signal
|
||||
@param state: STATE_DOWNLOAD, STATE_INSTALL, STATE_UPDATE, STATE_REMOVE
|
||||
'''
|
||||
print >> sys.stderr,"status\t%s" % (status)
|
||||
print >> sys.stderr,"status\t%s" % (state)
|
||||
|
||||
def data(self,data):
|
||||
'''
|
||||
|
@ -10,44 +10,11 @@
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
import yum
|
||||
from yum.rpmtrans import RPMBaseCallback, RPMTransaction
|
||||
import sys
|
||||
|
||||
my = yum.YumBase()
|
||||
#my.doConfigSetup()
|
||||
my.conf.cache = 1
|
||||
from yumBackend import PackageKitYumBackend
|
||||
|
||||
package = sys.argv[1]
|
||||
backend = PackageKitYumBackend(sys.argv[1:])
|
||||
backend.install(package)
|
||||
sys.exit(1)
|
||||
|
||||
#DOES NOT WORK
|
||||
class PackageKitCallback(RPMBaseCallback)
|
||||
def __init__(self):
|
||||
RPMBaseCallback.__init__()
|
||||
self.pct = 0
|
||||
|
||||
def event(self, package, action, te_current, te_total, ts_current, ts_total):
|
||||
val = (ts_current*100L)/ts_total
|
||||
if val != self.pct:
|
||||
self.pct = val
|
||||
print >> sys.stderr, pct
|
||||
|
||||
def errorlog(self, msg):
|
||||
# grrrrrrrr
|
||||
pass
|
||||
|
||||
my = yum.YumBase()
|
||||
|
||||
term = sys.argv[1]
|
||||
|
||||
|
||||
my.install(name=term)
|
||||
my.buildTransaction()
|
||||
|
||||
# download pkgs
|
||||
# check
|
||||
# order
|
||||
# run
|
||||
cb = RPMTransaction(self, display=PackageKitCallback)
|
||||
my.runTransaction(cb=cb)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user