コード例 #1
0
 def readChecksum(self, line, pkg):
     strUtils = StringUtils()
     line = pkg.decodeContents(line)
     data = line.strip()
     words = data.split(" ")
     nrWords = len(words)
     if (nrWords != 3):
         print "Error: Unable to parse line: " + line
         return False
     value = words[2].split("=")
     if (len(value) != 2):
         print "Error: Unable to parse line: " + line
         return False
     matchedSources = []
     for source in pkg.sources:
         sourceName = strUtils.getFileNameFromURL(source)
         if (sourceName.startswith(value[0])):
             matchedSources.append(sourceName)
     if (len(matchedSources) == 0):
         print "Error: Can not find match for sha1 " + value[0]
         return False
     if (len(matchedSources) > 1):
         print "Error: Too many matches in sources: " + matchedSources + " for sha1 " + value[
             0]
         return False
     pkg.checksums[sourceName] = value[1]
     return True
コード例 #2
0
ファイル: SpecParser.py プロジェクト: DheerajSShetty/photon
 def readChecksum(self,line,pkg):
     strUtils = StringUtils()
     line=pkg.decodeContents(line)
     data = line.strip();
     words=data.split(" ")
     nrWords = len(words)
     if (nrWords != 3):
         print "Error: Unable to parse line: "+line
         return False
     value=words[2].split("=")
     if (len(value) != 2):
         print "Error: Unable to parse line: "+line
         return False
     matchedSources=[]
     for source in pkg.sources:
         sourceName=strUtils.getFileNameFromURL(source)
         if (sourceName.startswith(value[0])):
             matchedSources.append(sourceName)
     if (len(matchedSources) == 0):
         print "Error: Can not find match for sha1 "+value[0]
         return False
     if (len(matchedSources) > 1):
         print "Error: Too many matches in sources: "+matchedSources+" for sha1 "+value[0]
         return False
     pkg.checksums[sourceName] = value[1]
     return True;
コード例 #3
0
ファイル: SpecParser.py プロジェクト: lparth/photon
 def _readChecksum(self, line, pkg):
     strUtils = StringUtils()
     line = self._replaceMacros(line)
     data = line.strip()
     words = data.split()
     nrWords = len(words)
     if nrWords != 3:
         print("Error: Unable to parse line: " + line)
         return False
     value = words[2].split("=")
     if len(value) != 2:
         print("Error: Unable to parse line: " + line)
         return False
     matchedSources = []
     for source in pkg.sources:
         sourceName = strUtils.getFileNameFromURL(source)
         if sourceName.startswith(value[0]):
             matchedSources.append(sourceName)
     if not matchedSources:
         print("Error: Can not find match for sha1 " + value[0])
         return False
     if len(matchedSources) > 1:
         print("Error: Too many matched Sources:" +
               ' '.join(matchedSources) + " for sha1 " + value[0])
         return False
     pkg.checksums[sourceName] = value[1]
     return True
コード例 #4
0
ファイル: SpecParser.py プロジェクト: TiejunChina/photon
 def _readChecksum(self, line, pkg):
     strUtils = StringUtils()
     line = self._replaceMacros(line)
     data = line.strip()
     words = data.split()
     nrWords = len(words)
     if nrWords != 3:
         print("Error: Unable to parse line: " + line)
         return False
     value = words[2].split("=")
     if len(value) != 2:
         print("Error: Unable to parse line: "+line)
         return False
     matchedSources = []
     for source in pkg.sources:
         sourceName = strUtils.getFileNameFromURL(source)
         if sourceName.startswith(value[0]):
             matchedSources.append(sourceName)
     if not matchedSources:
         print("Error: Can not find match for sha1 " + value[0])
         return False
     if len(matchedSources) > 1:
         print("Error: Too many matched Sources:" +
               ' '.join(matchedSources) + " for sha1 " + value[0])
         return False
     pkg.checksums[sourceName] = value[1]
     return True
コード例 #5
0
ファイル: SpecParser.py プロジェクト: cybernetics/photon-1
 def _getPatchNames(self):
     patchNames = []
     strUtils = StringUtils()
     pkg = self.packages.get('default')
     for patch in pkg.patches:
         patchName = strUtils.getFileNameFromURL(patch)
         patchNames.append(patchName)
     return patchNames
コード例 #6
0
ファイル: SpecParser.py プロジェクト: cybernetics/photon-1
 def _getSourceNames(self):
     sourceNames = []
     strUtils = StringUtils()
     pkg = self.packages.get('default')
     for source in pkg.sources:
         sourceName = strUtils.getFileNameFromURL(source)
         sourceNames.append(sourceName)
     return sourceNames
コード例 #7
0
ファイル: SpecParser.py プロジェクト: frapposelli/photon
 def _getPatchNames(self):
     patchNames = []
     strUtils = StringUtils()
     pkg = self.packages.get('default')
     for patch in pkg.patches:
         patchName = strUtils.getFileNameFromURL(patch)
         patchNames.append(patchName)
     return patchNames
コード例 #8
0
ファイル: SpecParser.py プロジェクト: frapposelli/photon
 def _getSourceNames(self):
     sourceNames = []
     strUtils = StringUtils()
     pkg = self.packages.get('default')
     for source in pkg.sources:
         sourceName = strUtils.getFileNameFromURL(source)
         sourceNames.append(sourceName)
     return sourceNames
コード例 #9
0
ファイル: SpecUtils.py プロジェクト: casualjim/photon
 def getPatchNames(self):
     patchNames = []
     strUtils = StringUtils()
     pkg = self.spec.packages.get("default")
     if pkg is None:
         return None
     for patch in pkg.patches:
         patchName = strUtils.getFileNameFromURL(patch)
         patchNames.append(patchName)
     return patchNames
コード例 #10
0
ファイル: SpecUtils.py プロジェクト: casualjim/photon
 def getSourceNames(self):
     sourceNames = []
     strUtils = StringUtils()
     pkg = self.spec.packages.get("default")
     if pkg is None:
         return None
     for source in pkg.sources:
         sourceName = strUtils.getFileNameFromURL(source)
         sourceNames.append(sourceName)
     return sourceNames