git-update: Close stdin if non-interactive

To be 100% certain that any usage of stdin will actually fail
instead of silently waiting for input.
This commit is contained in:
Edward Hervey 2017-10-20 12:22:57 +02:00 committed by Edward Hervey
parent 1f847ffbf4
commit 13996d5244

View file

@ -3,6 +3,7 @@ import argparse
import os import os
import subprocess import subprocess
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
import sys
from common import git from common import git
from common import Colors from common import Colors
@ -114,6 +115,9 @@ if __name__ == "__main__":
if options.no_color: if options.no_color:
Colors.disable() Colors.disable()
if options.no_interaction:
sys.stdin.close()
if not update_repo('gst-build', SCRIPTDIR, None, options.no_interaction): if not update_repo('gst-build', SCRIPTDIR, None, options.no_interaction):
exit(1) exit(1)
if not update_subprojects(options.manifest, options.no_interaction): if not update_subprojects(options.manifest, options.no_interaction):