- make portage_doebuild silent when etpUi['mute'] is set

- fix an issue with /lib/modules in extractPkgData that caused vmware-server to be tagged

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@922 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2007-12-20 14:37:23 +00:00
parent 03ccf1985a
commit 8a118b7d8f
3 changed files with 28 additions and 5 deletions
+1 -1
View File
@@ -1723,7 +1723,7 @@ def extractPkgData(package, etpBranch = etpConst['branch'], silent = False, inje
kernelDependentModule = False
kernelItself = False
for item in data['content']:
if item.find("/lib/modules/") != -1:
if item.startswith("/lib/modules/"):
kernelDependentModule = True
# get the version of the modules
kmodver = item.split("/lib/modules/")[1]
+2
View File
@@ -263,6 +263,8 @@ def print_generic(msg): # here we'll wrap any nice formatting
print msg
def writechar(char):
if etpUi['mute']:
return
stdout.write(char); stdout.flush()
def readtext(request):
+25 -4
View File
@@ -29,6 +29,7 @@
#####################################################################################
import os
import sys
from entropyConstants import *
import portage
import portage_const
@@ -631,12 +632,32 @@ def portage_doebuild(myebuild, mydo, tree, cpv, portage_tmpdir = None):
mysettings['PORTAGE_TMPDIR'] = str(portage_tmpdir)
mysettings.backup_changes("PORTAGE_TMPDIR")
# disable portage hooks
mysettings['PORTAGE_BASHRC'] = ''
mysettings.backup_changes("PORTAGE_BASHRC")
#mysettings['PORTAGE_BASHRC'] = ''
#mysettings.backup_changes("PORTAGE_BASHRC")
mydbapi = portage.fakedbapi(settings=mysettings)
mydbapi.cpv_inject(cpv, metadata = metadata)
vartree = portage.vartree(root=etpConst['systemroot']+"/")
mypath = etpConst['systemroot']+"/"
cached = portageRoots.get(mypath)
if cached == None:
vartree = portage.vartree(root=mypath)
portageRoots[mypath] = mytree
else:
vartree = cached
# if mute, supress portage output
if etpUi['mute']:
oldstdout = sys.stdout
oldstderr = sys.stderr
f = open("/dev/null","w")
sys.stdout = f
sys.stderr = f
os.environ["SKIP_EQUO_SYNC"] = "1"
portage.doebuild(myebuild = str(myebuild), mydo = str(mydo), myroot = etpConst['systemroot']+"/", tree = tree, mysettings = mysettings, mydbapi = mydbapi, vartree = vartree)
portage.doebuild(myebuild = str(myebuild), mydo = str(mydo), myroot = mypath, tree = tree, mysettings = mysettings, mydbapi = mydbapi, vartree = vartree)
os.unsetenv("SKIP_EQUO_SYNC")
# if mute, restore old stdout/stderr
if etpUi['mute']:
sys.stdout = oldstdout
sys.stderr = oldstderr
f.close()