allow installing from multiple directories
[enigma2.git] / lib / python / Components / DreamInfoHandler.py
index 8e9a8a2..858b99a 100644 (file)
@@ -130,7 +130,13 @@ class DreamInfoHandler:
        # prerequisites = True: give only packages matching the prerequisites
        def fillPackagesList(self, prerequisites = True):
                self.packageslist = []
-               packages = crawlDirectory(self.directory, ".*\.info$")
+               packages = []
+               if not isinstance(self.directory, list):
+                       self.directory = [self.directory]
+               
+               for directory in self.directory:
+                       packages += crawlDirectory(directory, ".*\.info$")
+
                for package in packages:
                        self.readInfo(package[0] + "/", package[0] + "/" + package[1])
                        
@@ -149,9 +155,13 @@ class DreamInfoHandler:
                                return False
                else:
                        if prerequisites.has_key("tag"):
-                               if self.neededTag in prerequisites["tag"]:
-                                       return True
-                       return False
+                               if not self.neededTag in prerequisites["tag"]:
+                                       return False
+                               
+               if prerequisites.has_key("satellite"):
+                       for sat in prerequisites["satellite"]:
+                               if int(sat) not in nimmanager.getConfiguredSats():
+                                       return False                            
                if prerequisites.has_key("bcastsystem"):
                        for bcastsystem in prerequisites["bcastsystem"]:
                                if nimmanager.hasNimType(bcastsystem):
@@ -193,10 +203,13 @@ class DreamInfoHandler:
                #print "attributes:", attributes
                
                if self.currentAttributeIndex >= len(self.attributeNames): # end of package reached
+                       print "end of package reached"
                        if self.currentlyInstallingMetaIndex is None or self.currentlyInstallingMetaIndex >= len(self.installIndexes) - 1:
+                               print "set status to DONE"
                                self.setStatus(self.STATUS_DONE)
                                return
                        else:
+                               print "increment meta index to install next package"
                                self.currentlyInstallingMetaIndex += 1
                                self.installPackage(self.installIndexes[self.currentlyInstallingMetaIndex])