Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2810)

Unified Diff: build/install-build-deps.sh

Issue 10166023: Add a --no-prompt flag to install quietly. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Change option name to make it means less and 'do' more. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/install-build-deps.sh
===================================================================
--- build/install-build-deps.sh (revision 132122)
+++ build/install-build-deps.sh (working copy)
@@ -13,6 +13,7 @@
echo "Options:"
echo "--[no-]syms: enable or disable installation of debugging symbols"
echo "--[no-]lib32: enable or disable installation of 32 bit libraries"
+ echo "--no-prompt: silently select standard options/defaults"
echo "Script will prompt interactively if options not given."
exit 1
}
@@ -24,6 +25,11 @@
--no-syms) do_inst_syms=0;;
--lib32) do_inst_lib32=1;;
--no-lib32) do_inst_lib32=0;;
+ --no-prompt) do_default=1
+ do_inst_syms=${do_inst_syms-0}
+ do_inst_lib32=${do_inst_lib32-0}
cmp 2012/04/21 23:49:26 Hi Peter, I still think lines 29-30 should be rem
+ do_quietly="-qq --assume-yes"
+ ;;
*) usage;;
esac
shift
@@ -122,6 +128,9 @@
# The function will echo the user's selection followed by a newline character.
# Users can abort the function by pressing CTRL-C. This will call "exit 1".
yes_no() {
+ if [ 0 -ne "${do_default-0}" ] ; then
+ return $1
+ fi
local c
while :; do
c="$(trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT
@@ -180,7 +189,7 @@
# Intentionally leaving $packages unquoted so it's more readable.
echo "Packages required: " $packages
echo
-new_list_cmd="sudo apt-get install --reinstall $(echo $packages)"
+new_list_cmd="sudo apt-get install --reinstall ${do_quietly-} $(echo $packages)"
if new_list="$(yes n | LANG=C $new_list_cmd)"; then
# We probably never hit this following line.
echo "No missing packages, and the packages are up-to-date."
@@ -194,7 +203,7 @@
echo "No missing packages, and the packages are up-to-date."
else
echo "Installing missing packages: $new_list."
- sudo apt-get install ${new_list}
+ sudo apt-get install ${do_quietly-} ${new_list}
fi
echo
else
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698