summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2006-10-31 10:20:40 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2006-10-31 10:20:40 +0000
commit4a51e59d12294676cadb44aa00ce3b58f92b530d (patch)
treebc4589c49d87a7bfc110d9bf4034ee8e22ecc57c
parent5bacaffe5a54d5d0fea2fcdb518522b50525a3d6 (diff)
downloadbitbake-4a51e59d12294676cadb44aa00ce3b58f92b530d.tar.gz
build.py: Add support for the interact flag, backported from trunk
-rw-r--r--lib/bb/build.py47
1 files changed, 25 insertions, 22 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index e0e5246f7..176a500dc 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -132,6 +132,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
@@ -170,15 +171,16 @@ def exec_func_shell(func, d):
se = so
- # 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()]
- ose = [os.dup(sys.stderr.fileno()), sys.stderr.fileno()]
+ 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()]
+ ose = [os.dup(sys.stderr.fileno()), sys.stderr.fileno()]
- # replace those fds with our own
- os.dup2(si.fileno(), osi[1])
- os.dup2(so.fileno(), oso[1])
- os.dup2(se.fileno(), ose[1])
+ # replace those fds with our own
+ os.dup2(si.fileno(), osi[1])
+ os.dup2(so.fileno(), oso[1])
+ os.dup2(se.fileno(), ose[1])
# execute function
prevdir = os.getcwd()
@@ -192,20 +194,21 @@ def exec_func_shell(func, d):
except:
pass
- # restore the backups
- os.dup2(osi[0], osi[1])
- os.dup2(oso[0], oso[1])
- os.dup2(ose[0], ose[1])
-
- # close our logs
- si.close()
- so.close()
- se.close()
-
- # close the backup fds
- os.close(osi[0])
- os.close(oso[0])
- os.close(ose[0])
+ if not interact:
+ # restore the backups
+ os.dup2(osi[0], osi[1])
+ os.dup2(oso[0], oso[1])
+ os.dup2(ose[0], ose[1])
+
+ # close our logs
+ si.close()
+ so.close()
+ se.close()
+
+ # close the backup fds
+ os.close(osi[0])
+ os.close(oso[0])
+ os.close(ose[0])
if ret==0:
if bb.msg.debug_level > 0: