more bug fixes

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@59 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2007-02-04 19:01:08 +00:00
parent 7c4c9e1f71
commit d38097f8a3
2 changed files with 45 additions and 30 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ else:
options = sys.argv[1:]
# parameters test
if len(options) < 1 or string.join(options).find("--help") != -1 or string.join(options).find("-h") != -1:
if len(options) < 1 or string.join(options).find("--help") != -1 or string.join(options).find(" -h") != -1:
entropyTools.print_help()
if len(options) < 1:
entropyTools.print_error("not enough parameters")
+44 -29
View File
@@ -83,14 +83,20 @@ def extractPkgData(package):
# Fill description
f = open(tbz2TmpDir+dbDESCRIPTION,"r")
pData['description'] = f.readline().strip()
f.close()
try:
f = open(tbz2TmpDir+dbDESCRIPTION,"r")
pData['description'] = f.readline().strip()
f.close()
except IOError:
pData['description'] = ""
# Fill homepage
f = open(tbz2TmpDir+dbHOMEPAGE,"r")
pData['homepage'] = f.readline().strip()
f.close()
try:
f = open(tbz2TmpDir+dbHOMEPAGE,"r")
pData['homepage'] = f.readline().strip()
f.close()
except IOError:
pData['homepage'] = ""
# Fill chost
f = open(tbz2TmpDir+dbCHOST,"r")
@@ -111,14 +117,20 @@ def extractPkgData(package):
f.close()
# Fill CXXFLAGS
f = open(tbz2TmpDir+dbCXXFLAGS,"r")
pData['cxxflags'] = f.readline().strip()
f.close()
try:
f = open(tbz2TmpDir+dbCXXFLAGS,"r")
pData['cxxflags'] = f.readline().strip()
f.close()
except IOError:
pData['cxxflags'] = ""
# Fill license
f = open(tbz2TmpDir+dbLICENSE,"r")
pData['license'] = f.readline().strip()
f.close()
try:
f = open(tbz2TmpDir+dbLICENSE,"r")
pData['license'] = f.readline().strip()
f.close()
except IOError:
pData['license'] = ""
# Fill sources
# FIXME: resolve mirror:// in something useful
@@ -135,23 +147,13 @@ def extractPkgData(package):
f = open(tbz2TmpDir+dbUSE,"r")
tmpUSE = f.readline().strip()
f.close()
f = open(tbz2TmpDir+dbIUSE,"r")
tmpIUSE = f.readline().strip().split()
f.close()
# fill KEYWORDS
f = open(tbz2TmpDir+dbKEYWORDS,"r")
pData['keywords'] = f.readline().strip()
f.close()
# fill ARCHs
pkgArchs = pData['keywords']
for i in pArchs:
if pkgArchs.find(i) != -1 and (pkgArchs.find("-"+i) == -1): # in case we find something like -amd64...
pData['supportedBinaryARCHs'] += i+" "
pData['supportedBinaryARCHs'] = removeSpaceAtTheEnd(pData['supportedBinaryARCHs'])
try:
f = open(tbz2TmpDir+dbIUSE,"r")
tmpIUSE = f.readline().strip().split()
f.close()
except IOError:
tmpIUSE = ""
for i in tmpIUSE:
if tmpUSE.find(i) != -1:
pData['useflags'] += i+" "
@@ -159,6 +161,19 @@ def extractPkgData(package):
pData['useflags'] += "-"+i+" "
pData['useflags'] = removeSpaceAtTheEnd(pData['useflags'])
# fill KEYWORDS
f = open(tbz2TmpDir+dbKEYWORDS,"r")
pData['keywords'] = f.readline().strip()
f.close()
# fill ARCHs
pkgArchs = pData['keywords']
for i in pArchs:
if pkgArchs.find(i) != -1 and (pkgArchs.find("-"+i) == -1): # in case we find something like -amd64...
pData['supportedBinaryARCHs'] += i+" "
pData['supportedBinaryARCHs'] = removeSpaceAtTheEnd(pData['supportedBinaryARCHs'])
# Fill dependencies
# to fill dependencies we use *DEPEND files
f = open(tbz2TmpDir+dbDEPEND,"r")