bitbake build.py: Add interactive flag for tasks to allow i/o redirection to be disabled. Also fix NFS stamp error

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@681 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
Richard Purdie 2006-08-30 21:26:07 +00:00
parent 874a642961
commit 27e6638adc
1 changed files with 29 additions and 21 deletions

View File

@ -148,6 +148,7 @@ def exec_func_shell(func, d):
deps = data.getVarFlag(func, 'deps', d)
check = data.getVarFlag(func, 'check', d)
interact = data.getVarFlag(func, 'interactive', d)
if check in globals():
if globals()[check](func, deps):
return
@ -186,6 +187,7 @@ def exec_func_shell(func, d):
se = so
if not interact:
# dup the existing fds so we dont lose them
osi = [os.dup(sys.stdin.fileno()), sys.stdin.fileno()]
oso = [os.dup(sys.stdout.fileno()), sys.stdout.fileno()]
@ -205,6 +207,7 @@ def exec_func_shell(func, d):
ret = os.system('%ssh -e %s' % (maybe_fakeroot, runfile))
os.chdir(prevdir)
if not interact:
# restore the backups
os.dup2(osi[0], osi[1])
os.dup2(oso[0], oso[1])
@ -350,7 +353,12 @@ def mkstamp(task, d):
return
stamp = "%s.%s" % (data.expand(stamp, d), task)
mkdirhier(os.path.dirname(stamp))
open(stamp, "w+")
# Remove the file and recreate to force timestamp
# change on broken NFS filesystems
if os.access(stamp, os.F_OK):
os.remove(stamp)
f = open(stamp, "w")
f.close()
def add_task(task, deps, d):