Skip to content

Commit

Permalink
Bug 584474 part 10 - Make expandlibs_exec.py less verbose by default.…
Browse files Browse the repository at this point in the history
… r=ted
  • Loading branch information
glandium committed Mar 4, 2011
1 parent c445bc0 commit 93f8060
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
15 changes: 9 additions & 6 deletions config/expandlibs_exec.py
Expand Up @@ -131,6 +131,8 @@ def main():
help="when a library has no descriptor file, extract it first, when possible")
parser.add_option("--uselist", action="store_true", dest="uselist",
help="use a list file for objects when executing a command")
parser.add_option("--verbose", action="store_true", dest="verbose",
help="display executed command and temporary files content")

(options, args) = parser.parse_args()

Expand All @@ -140,12 +142,13 @@ def main():
if options.uselist:
args.makelist()

print >>sys.stderr, "Executing: " + " ".join(args)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print >>sys.stderr, tmp + ":"
with open(tmp) as file:
print >>sys.stderr, "".join([" " + l for l in file.readlines()])
sys.stderr.flush()
if options.verbose:
print >>sys.stderr, "Executing: " + " ".join(args)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print >>sys.stderr, tmp + ":"
with open(tmp) as file:
print >>sys.stderr, "".join([" " + l for l in file.readlines()])
sys.stderr.flush()
exit(subprocess.call(args))

if __name__ == '__main__':
Expand Down
15 changes: 9 additions & 6 deletions js/src/config/expandlibs_exec.py
Expand Up @@ -131,6 +131,8 @@ def main():
help="when a library has no descriptor file, extract it first, when possible")
parser.add_option("--uselist", action="store_true", dest="uselist",
help="use a list file for objects when executing a command")
parser.add_option("--verbose", action="store_true", dest="verbose",
help="display executed command and temporary files content")

(options, args) = parser.parse_args()

Expand All @@ -140,12 +142,13 @@ def main():
if options.uselist:
args.makelist()

print >>sys.stderr, "Executing: " + " ".join(args)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print >>sys.stderr, tmp + ":"
with open(tmp) as file:
print >>sys.stderr, "".join([" " + l for l in file.readlines()])
sys.stderr.flush()
if options.verbose:
print >>sys.stderr, "Executing: " + " ".join(args)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print >>sys.stderr, tmp + ":"
with open(tmp) as file:
print >>sys.stderr, "".join([" " + l for l in file.readlines()])
sys.stderr.flush()
exit(subprocess.call(args))

if __name__ == '__main__':
Expand Down

0 comments on commit 93f8060

Please sign in to comment.