From 10b40d5ad5eeb179d57435b44b44756e97a91c7b Mon Sep 17 00:00:00 2001 From: devrandom Date: Sat, 16 Jul 2011 18:27:23 -0700 Subject: [PATCH] improve quietness flag --- bin/gbuild | 5 +++-- libexec/copy-from-target | 7 ++++++- libexec/copy-to-target | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/bin/gbuild b/bin/gbuild index 0b0cea6..d11b5aa 100755 --- a/bin/gbuild +++ b/bin/gbuild @@ -64,7 +64,7 @@ def build_one_configuration(suite, arch, build_desc, reference_datetime) build_desc["files"].each do |filename| filename = sanitize(filename, "files section") - system! "cd inputs && copy-to-target #{filename} build/" + system! "cd inputs && copy-to-target #{@quiet_flag} #{filename} build/" end info "Updating apt-get repository (log in var/install.log)" @@ -134,6 +134,7 @@ ENV['PATH'] = libexec_dir.to_s + ":" + ENV['PATH'] ENV['GITIAN_BASE'] = base_dir.to_s ENV['NPROCS'] = @options[:num_procs].to_s ENV['VMEM'] = @options[:memory].to_s +@quiet_flag = @options[:quiet] ? "-q" : "" build_desc_file = ARGV.shift or raise "must supply YAML build description file" @@ -192,7 +193,7 @@ suites.each do |suite| build_one_configuration(suite, arch, build_desc, reference_datetime) info "Grabbing results" - system! "copy-from-target out #{build_dir}" + system! "copy-from-target #{@quiet_flag} out #{build_dir}" base_manifest = File.read("var/base-#{suite}-#{arch}.manifest") base_manifests["#{suite}-#{arch}"] = base_manifest diff --git a/libexec/copy-from-target b/libexec/copy-from-target index 35b5363..e094ee4 100755 --- a/libexec/copy-from-target +++ b/libexec/copy-from-target @@ -3,6 +3,7 @@ . gconfig TUSER=ubuntu +QUIET_FLAG= usage() { echo "Usage: ${0##*/} [OPTION]... " @@ -25,6 +26,10 @@ if [ $# != 0 ] ; then TUSER="$2" shift 2 ;; + --quiet|-q) + QUIET_FLAG="-q" + shift 1 + ;; --*) echo "unrecognized option $1" exit 1 @@ -41,4 +46,4 @@ if [ $# = 0 ] ; then exit 1 fi -scp -oConnectTimeout=5 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_dsa -P $VM_SSH_PORT -r $TUSER@localhost:$1 $2 +scp $QUIET_FLAG -oConnectTimeout=5 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_dsa -P $VM_SSH_PORT -r $TUSER@localhost:$1 $2 diff --git a/libexec/copy-to-target b/libexec/copy-to-target index 1eebd02..917d92a 100755 --- a/libexec/copy-to-target +++ b/libexec/copy-to-target @@ -3,6 +3,7 @@ . gconfig TUSER=ubuntu +QUIET_FLAG= usage() { echo "Usage: ${0##*/} [OPTION]... " @@ -25,6 +26,10 @@ if [ $# != 0 ] ; then TUSER="$2" shift 2 ;; + --quiet|-q) + QUIET_FLAG="-q" + shift 1 + ;; --*) echo "unrecognized option $1" exit 1 @@ -41,4 +46,4 @@ if [ $# = 0 ] ; then exit 1 fi -scp -oConnectTimeout=5 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_dsa -P $VM_SSH_PORT $1 $TUSER@localhost:$2 +scp $QUIET_FLAG -oConnectTimeout=5 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_dsa -P $VM_SSH_PORT $1 $TUSER@localhost:$2