fixed two really nasty bugs
git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@379 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
@@ -87,7 +87,7 @@ def database(options):
|
||||
print_info(green(" * ")+red("Analyzing: ")+bold(pkg), back = True)
|
||||
currCounter += 1
|
||||
print_info(green(" (")+ blue(str(currCounter))+"/"+red(str(atomsnumber))+green(") ")+red("Analyzing ")+bold(pkg)+red(" ..."))
|
||||
etpData = reagentTools.extractPkgData(etpConst['packagesbindir']+"/"+pkg)
|
||||
etpData = reagentTools.extractPkgData(package = etpConst['packagesbindir']+"/"+pkg, structuredLayout = True)
|
||||
|
||||
# remove shait
|
||||
entropyTools.spawnCommand("rm -rf "+etpConst['packagestmpdir']+"/"+pkg)
|
||||
|
||||
+18
-14
@@ -677,29 +677,32 @@ def synthetizeRoughDependencies(roughDependencies, useflags = None):
|
||||
useFlagQuestion = False
|
||||
dependencies = ""
|
||||
conflicts = ""
|
||||
useflags = useflags.split()
|
||||
for atom in roughDependencies:
|
||||
|
||||
if atom.endswith("?"):
|
||||
# we need to see if that useflag is enabled
|
||||
useFlag = atom.split("?")[0]
|
||||
useFlagQuestion = True
|
||||
for i in useflags.split():
|
||||
if useFlag.startswith("!"):
|
||||
checkFlag = "-"+useFlag[1:]
|
||||
if (i == checkFlag):
|
||||
useMatch = True
|
||||
break
|
||||
useFlagQuestion = True # V
|
||||
if useFlag.startswith("!"):
|
||||
checkFlag = "-"+useFlag[1:]
|
||||
try:
|
||||
useflags.index(checkFlag)
|
||||
useMatch = True
|
||||
except:
|
||||
useMatch = False
|
||||
else:
|
||||
if (i == useFlag):
|
||||
useMatch = True
|
||||
break
|
||||
else:
|
||||
try:
|
||||
useflags.index(useFlag)
|
||||
useMatch = True # V
|
||||
except:
|
||||
useMatch = False
|
||||
|
||||
|
||||
if atom.startswith("("):
|
||||
if (openOr):
|
||||
openParenthesisFromOr += 1
|
||||
openParenthesis += 1 # 1 | 2 | 3
|
||||
openParenthesisFromOr += 1 # 1
|
||||
openParenthesis += 1 # 1 | 2
|
||||
|
||||
if atom.startswith(")"):
|
||||
if (openOr):
|
||||
@@ -722,7 +725,7 @@ def synthetizeRoughDependencies(roughDependencies, useflags = None):
|
||||
if atom.startswith("||"):
|
||||
openOr = True # V
|
||||
|
||||
if atom.find("/") != -1 and (not atom.startswith("!")) and (not atom.endswith("?")):
|
||||
if (atom.find("/") != -1) and (not atom.startswith("!")) and (not atom.endswith("?")):
|
||||
# it's a package name <pkgcat>/<pkgname>-???
|
||||
if ((useFlagQuestion) and (useMatch)) or ((not useFlagQuestion) and (not useMatch)):
|
||||
# check if there's an OR
|
||||
@@ -734,6 +737,7 @@ def synthetizeRoughDependencies(roughDependencies, useflags = None):
|
||||
else:
|
||||
dependencies += dbOR
|
||||
else:
|
||||
dependencies += atom
|
||||
dependencies += " "
|
||||
|
||||
if atom.startswith("!") and (not atom.endswith("?")):
|
||||
|
||||
@@ -175,7 +175,7 @@ def enzyme(options):
|
||||
print_info(green(" * ")+red("Statistics: ")+blue("Entries created/updated: ")+bold(str(etpCreated))+yellow(" - ")+darkblue("Entries discarded: ")+bold(str(etpNotCreated)))
|
||||
|
||||
# This function extracts all the info from a .tbz2 file and returns them
|
||||
def extractPkgData(package, etpBranch = "unstable"):
|
||||
def extractPkgData(package, etpBranch = "unstable", structuredLayout = False):
|
||||
|
||||
reagentLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"extractPkgData: called -> package: "+str(package))
|
||||
|
||||
@@ -214,6 +214,16 @@ def extractPkgData(package, etpBranch = "unstable"):
|
||||
etpData['name'] = pkgname
|
||||
etpData['version'] = pkgver
|
||||
|
||||
if (structuredLayout):
|
||||
# extract tbz2
|
||||
structuredPackageDir = etpConst['packagestmpdir']+"/"+etpData['name']+"-"+etpData['version']+"-structured"
|
||||
if os.path.isdir(structuredPackageDir):
|
||||
spawnCommand("rm -rf "+structuredPackageDir)
|
||||
os.makedirs(structuredPackageDir)
|
||||
uncompressTarBz2(tbz2File,structuredPackageDir)
|
||||
tbz2filename = os.path.basename(tbz2File)
|
||||
tbz2File = structuredPackageDir+etpConst['packagecontentdir']+"/"+tbz2filename
|
||||
|
||||
print_info(yellow(" * ")+red("Getting package md5..."),back = True)
|
||||
# .tbz2 md5
|
||||
etpData['digest'] = md5sum(tbz2File)
|
||||
@@ -582,6 +592,9 @@ def extractPkgData(package, etpBranch = "unstable"):
|
||||
|
||||
# removing temporary directory
|
||||
os.system("rm -rf "+tbz2TmpDir)
|
||||
if (structuredLayout):
|
||||
if os.path.isdir(structuredPackageDir):
|
||||
spawnCommand("rm -rf "+structuredPackageDir)
|
||||
|
||||
print_info(yellow(" * ")+red("Done"),back = True)
|
||||
return etpData
|
||||
|
||||
Reference in New Issue
Block a user