Пример #1
0
 def getDependeciesFromPath(cls, fileName):
     """given a file name it returns a Provide object with all the goodies in it
     """
     returnValue = []
     for line in getOutputAsList(['bash', cls._RPM_FIND_PROV], fileName)[0]:
         if len(line) == 0:
             continue
         newDep = Dependency( line )
         newDep.setPluginName( cls.pluginName )
         newDep.pathList.append( fileName )
         #i need to take the parenthesis out of the game
         tempList = re.split( '\(|\)', line )
         if len( tempList ) > 3:
             #set the 32/64 bits
             #probably unecessary
             if tempList[3].find( "64bit" ) >= 0 :
                 newDep.set64bits()
             elif tempList[3].find( "32bit" ) >= 0 :
                 #this should never happen
                 newDep.set32bits()
         else:
             #no parenthesis aka 32 bit
             newDep.set32bits()
         returnValue.append( newDep )
     return returnValue
Пример #2
0
    def _setDepsRequs(cls, swirlFile):
        """given a SwirlFile object it add to it all the dependency and all 
        the provides to it """

        #find deps
        for line in getOutputAsList(['bash', cls._RPM_FIND_DEPS], swirlFile.path)[0]:
            if len(line) > 0:
                newDep = Dependency( line )
                newDep.setPluginName( cls.pluginName )
                swirlFile.addDependency( newDep )
                #i need to take the parenthesis out of the game
                tempList = re.split('\(|\)',line)
                if len(tempList) > 3:
                    #set the 32/64 bits 
                    #probably unecessary
                    if tempList[3].find("64bit") >= 0 :
                        newDep.set64bits()
                    elif tempList[3].find("32bit") >= 0 :
                        #this should never happen
                        newDep.set32bits()
                else:
                    #no parenthesis aka 32 bit 
                    newDep.set32bits()
                p = cls.getPathToLibrary( newDep )
                if p:
                    newDep.pathList.append( p )
        
        #find provides
        for line in getOutputAsList(['bash', cls._RPM_FIND_PROV], swirlFile.path)[0]:
            if len(line) > 0 :
                newProv = Provide(line)
                newProv.setPluginName( cls.pluginName )
                swirlFile.addProvide(newProv)
Пример #3
0
 f.close()
 pythonVer = None
 if header[0:2] == '#!':
     for i in re.split(' |/|!', header):
         if 'python' in i:
             pythonVer = i
 if not pythonVer:
     pythonVer = cls._prefix
 for item in cls._getModules(lis) :
     newdepName = pythonVer + "(" + item + ")"
     # newdepName is not in buildin_modules and
     # it's really a new dep
     if item not in cls._buildin_modules and \
         newdepName not in [ i.depname for i in swirlFile.dependencies ]:
         newDep = Dependency( newdepName )
         newDep.setPluginName( cls.pluginName )
         #
         # we have to find which file provides this dep
         #
         #TODO move to a function
         paths = []
         #TODO load from a differen interpreter
         if pythonVer == 'python' or pythonVer == cls._prefix:
             #we can use this interpreter
             try:
                 if '.' in item:
                     # When the name variable is of the form package.module,
                     # normally, the top-level package (the name up till the
                     # first dot) is returned, not the module named by name.
                     # so we need __import__('xml.sax.handler', glob, local, 'handler')
                     module = __import__(item, globals(),