From 4ee97c700588dfd787457265e5334fbd2d8fac8c Mon Sep 17 00:00:00 2001 From: lxnay Date: Sat, 4 Aug 2007 21:12:09 +0000 Subject: [PATCH] one more fix git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@387 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- client/equoTools.py | 14 ++++++++------ libraries/portageTools.py | 33 ++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/client/equoTools.py b/client/equoTools.py index 8e795bdf7..db91f1078 100644 --- a/client/equoTools.py +++ b/client/equoTools.py @@ -941,7 +941,7 @@ def generateDependencyTree(unsatisfiedDeps): if (dependenciesNotFound): # Houston, we've got a problem - print "error! DEPS NOT FOUND -> "+str(dependenciesNotFound) + #print "error! DEPS NOT FOUND -> "+str(dependenciesNotFound) treeview = {} treeview[0] = {} treeview[0][0] = dependenciesNotFound @@ -1184,9 +1184,6 @@ def installFile(package, infoDict = None): tofile = fromfile[len(imageDir):] #print "copying file "+fromfile+" to "+tofile - user = os.stat(fromfile)[4] - group = os.stat(fromfile)[5] - if os.access(tofile,os.F_OK): try: os.remove(tofile) @@ -1200,8 +1197,13 @@ def installFile(package, infoDict = None): rc = os.system("/bin/cp "+fromfile+" "+tofile) if (rc != 0): return 4 - os.chown(tofile,user,group) - shutil.copystat(fromfile,tofile) + try: + user = os.stat(fromfile)[4] + group = os.stat(fromfile)[5] + os.chown(tofile,user,group) + shutil.copystat(fromfile,tofile) + except: + pass # sometimes, gentoo packages are fucked up and contain broken symlinks os.system("rm -rf "+imageDir) diff --git a/libraries/portageTools.py b/libraries/portageTools.py index 3dd104c86..63bbac40a 100644 --- a/libraries/portageTools.py +++ b/libraries/portageTools.py @@ -595,7 +595,7 @@ def getPackageDependencyList(atom): depcache = {} def getPackageRuntimeDependencies(NEEDED): - portageLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"getPackageRuntimeDependencies: called. ") + portageLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"getPackageRuntimeDependencies: called.") if not os.path.isfile(NEEDED): return [],[] # all empty @@ -683,7 +683,15 @@ def synthetizeRoughDependencies(roughDependencies, useflags = None): useflags = useflags.split() for atom in roughDependencies: - if atom.endswith("?"): + if atom.startswith("("): + if (openOr): + openParenthesisFromOr += 1 # 1 + openParenthesis += 1 # 1 + + elif atom.endswith("?"): + + if (useFlagQuestion) and (not useMatch): # if we're already in a question and the question is not accepted, skip the cycle + continue # we need to see if that useflag is enabled useFlag = atom.split("?")[0] useFlagQuestion = True # V @@ -693,21 +701,16 @@ def synthetizeRoughDependencies(roughDependencies, useflags = None): useflags.index(checkFlag) useMatch = True except: - useMatch = False + useMatch = False # V else: try: useflags.index(useFlag) - useMatch = True # V + useMatch = True except: - useMatch = False + useMatch = False # V - if atom.startswith("("): - if (openOr): - openParenthesisFromOr += 1 # 1 - openParenthesis += 1 # 1 | 2 - - if atom.startswith(")"): + elif atom.startswith(")"): if (openOr): # remove last "_or_" from dependencies if (openParenthesisFromOr == 1): @@ -725,12 +728,12 @@ def synthetizeRoughDependencies(roughDependencies, useflags = None): useFlagQuestion = False useMatch = False - if atom.startswith("||"): + elif atom.startswith("||"): openOr = True # V - if (atom.find("/") != -1) and (not atom.startswith("!")) and (not atom.endswith("?")): + elif (atom.find("/") != -1) and (not atom.startswith("!")) and (not atom.endswith("?")): # it's a package name /-??? - if ((useFlagQuestion) and (useMatch)) or ((not useFlagQuestion) and (not useMatch)): + if ((useFlagQuestion == True) and (useMatch == True)) or ((useFlagQuestion == False) and (useMatch == False)): # check if there's an OR if (openOr): dependencies += atom @@ -743,7 +746,7 @@ def synthetizeRoughDependencies(roughDependencies, useflags = None): dependencies += atom dependencies += " " - if atom.startswith("!") and (not atom.endswith("?")): + elif atom.startswith("!") and (not atom.endswith("?")): if ((useFlagQuestion) and (useMatch)) or ((not useFlagQuestion) and (not useMatch)): conflicts += atom if (openOr):