starting to add arch independancy
git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@55 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
@@ -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+"/")
|
||||
|
||||
@@ -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|"
|
||||
dbOR = "|or|"
|
||||
dbKEYWORDS = "KEYWORDS"
|
||||
@@ -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 <pkgcat>/<pkgname>-???
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user