diff --git a/handlers/entropy-specifications-generator b/handlers/entropy-specifications-generator index afed4bbc3..fa4b30c38 100644 --- a/handlers/entropy-specifications-generator +++ b/handlers/entropy-specifications-generator @@ -64,8 +64,9 @@ if (not validFile): sys.exit(4) -entropyTools.print_info(".tbz2 file found: "+tbz2File) +entropyTools.print_info("tbz2 file found: "+tbz2File) +entropyTools.print_info("extracting data for: "+tbz2File+" please wait...") # fill all the info pData = entropyTools.extractPkgData(tbz2File) #os.mkdir(pTmpDir+"/") diff --git a/libraries/entropyConstants.py b/libraries/entropyConstants.py index b4a94e6bb..8236fdd7d 100644 --- a/libraries/entropyConstants.py +++ b/libraries/entropyConstants.py @@ -16,12 +16,14 @@ pData = { 'homepage': "", # home page of the package 'useflags': "", # USE flags used 'license': "", # License adpoted + 'keywords': "", # supported ARCHs 'download': "", # link to download the binary package 'sources': "", # link to the sources 'dependencies': "", # dependencies 'rundependencies': "", # runtime dependencies 'rundependenciesXT': "", # runtime dependencies + version 'conflicts': "", # blockers + 'etpapi': "", # blockers } ETP_API = "1.0" @@ -67,4 +69,5 @@ dbDEPEND = "DEPEND" dbRDEPEND = "RDEPEND" dbPDEPEND = "PDEPEND" dbNEEDED = "NEEDED" -dbOR = "|or|" \ No newline at end of file +dbOR = "|or|" +dbKEYWORDS = "KEYWORDS" \ No newline at end of file diff --git a/libraries/entropyTools.py b/libraries/entropyTools.py index 826e4aade..139d2d340 100644 --- a/libraries/entropyTools.py +++ b/libraries/entropyTools.py @@ -103,6 +103,7 @@ def extractPkgData(package): f.close() # Fill sources + # FIXME: resolve mirror:// in something useful f = open(tbz2TmpDir+dbSRC_URI,"r") pData['sources'] = f.readline().strip() f.close() @@ -150,9 +151,14 @@ def extractPkgData(package): useFlag = atom.split("?")[0] useFlagQuestion = True for i in pData['useflags'].split(): - if (i == useFlag): - useMatch = True - break + if i.startswith("!"): + if (i != useFlag): + useMatch = True + break + else: + if (i == useFlag): + useMatch = True + break if atom.startswith("("): openParenthesis += 1 @@ -165,13 +171,16 @@ def extractPkgData(package): pData['dependencies'] = pData['dependencies'][:len(pData['dependencies'])-len(dbOR)] pData['dependencies'] += " " openParenthesis -= 1 + if (openParenthesis == 0): + useFlagQuestion = False + useMatch = False if atom.startswith("||"): openOr = True - if atom.find("/") != -1 and (not atom.startswith("!")): + if atom.find("/") != -1 and (not atom.startswith("!")) and (not atom.endswith("?")): # it's a package name /-??? - if ((useFlagQuestion) and (useMatch)): + if ((useFlagQuestion) and (useMatch)) or ((not useFlagQuestion) and (not useMatch)): # check if there's an OR pData['dependencies'] += atom if (openOr): @@ -179,8 +188,14 @@ def extractPkgData(package): else: pData['dependencies'] += " " - if atom.startswith("!"): - pData['conflicts'] += atom+" " + if atom.startswith("!") and (not atom.endswith("?")): + if ((useFlagQuestion) and (useMatch)) or ((not useFlagQuestion) and (not useMatch)): + pData['conflicts'] += atom + if (openOr): + pData['conflicts'] += dbOR + else: + pData['conflicts'] += " " + # format properly tmpConflicts = list(set(pData['conflicts'].split())) @@ -251,9 +266,12 @@ def extractPkgData(package): if pData['rundependenciesXT'].endswith(" "): pData['rundependenciesXT'] = pData['rundependenciesXT'][:len(pData['rundependenciesXT'])-1] + # write API info + pData['etpapi'] = ETP_API + return pData # This function will handle all the shit needed to write the *.etp file in the # right directory, under the right name and revision def writeEtpSpecFile(etpOutputFile): - return + return