switch to opkg
[enigma2.git] / lib / python / Components / Ipkg.py
old mode 100644 (file)
new mode 100755 (executable)
index 31889bc..cc55965
@@ -1,4 +1,5 @@
 from enigma import eConsoleAppContainer
+from Tools.Directories import fileExists
 
 class IpkgComponent:
        EVENT_INSTALL = 0
@@ -18,9 +19,8 @@ class IpkgComponent:
        CMD_UPDATE = 3
        CMD_UPGRADE = 4
        
-       def __init__(self, ipkg = '/usr/bin/ipkg'):
+       def __init__(self, ipkg = 'opkg'):
                self.ipkg = ipkg
-               
                self.cmd = eConsoleAppContainer()
                self.cache = None
                self.callbackList = []
@@ -52,6 +52,8 @@ class IpkgComponent:
                                self.runCmd("list")
                elif cmd == self.CMD_INSTALL:
                        self.runCmd("install " + args['package'])
+               elif cmd == self.CMD_REMOVE:
+                       self.runCmd("remove " + args['package'])
                self.setCurrentCommand(cmd)
        
        def cmdFinished(self, retval):
@@ -87,9 +89,11 @@ class IpkgComponent:
                        if data.find('Downloading') == 0:
                                self.callCallbacks(self.EVENT_DOWNLOAD, data.split(' ', 5)[1].strip())
                        elif data.find('Upgrading') == 0:
-                               self.callCallbacks(self.EVENT_UPGRADE, data.split('    ', 1)[1].split(' ')[0])
+                               self.callCallbacks(self.EVENT_UPGRADE, data.split(' ', 1)[1].split(' ')[0])
                        elif data.find('Installing') == 0:
                                self.callCallbacks(self.EVENT_INSTALL, data.split(' ', 1)[1].split(' ')[0])
+                       elif data.find('Removing') == 0:
+                               self.callCallbacks(self.EVENT_REMOVE, data.split(' ', 1)[1].split(' ')[1])
                        elif data.find('Configuring') == 0:
                                self.callCallbacks(self.EVENT_CONFIGURING, data.split(' ', 1)[1].split(' ')[0])
                        elif data.find('An error occurred') == 0: