From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-502814-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 379B8138010
	for <garchives@archives.gentoo.org>; Tue,  4 Sep 2012 01:34:18 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 8108721C024;
	Tue,  4 Sep 2012 01:34:08 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 4B65121C024
	for <gentoo-commits@lists.gentoo.org>; Tue,  4 Sep 2012 01:34:08 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 7FFEE33D7ED
	for <gentoo-commits@lists.gentoo.org>; Tue,  4 Sep 2012 01:34:07 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 5FBD4E543D
	for <gentoo-commits@lists.gentoo.org>; Tue,  4 Sep 2012 01:34:05 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <1346722406.24a91dd6fb9bd9acdc5a72d2e830128c0f06bf98.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/etc-update
X-VCS-Directories: bin/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: 24a91dd6fb9bd9acdc5a72d2e830128c0f06bf98
X-VCS-Branch: master
Date: Tue,  4 Sep 2012 01:34:05 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 26931149-72ed-4adb-9ae1-e526f62f6879
X-Archives-Hash: f97457982f34088aedd4a9f0fac28463

commit:     24a91dd6fb9bd9acdc5a72d2e830128c0f06bf98
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  4 01:33:26 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep  4 01:33:26 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=24a91dd6

etc-update: add --quiet for bug #416917

---
 bin/etc-update |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/bin/etc-update b/bin/etc-update
index d763c1f..347ba1a 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -62,7 +62,7 @@ do_mv_ln() {
 }
 
 scan() {
-	echo "Scanning Configuration files..."
+	${QUIET} || echo "Scanning Configuration files..."
 	rm -rf "${TMP}"/files > /dev/null 2>&1
 	mkdir "${TMP}"/files || die "Failed mkdir command!"
 	count=0
@@ -107,13 +107,13 @@ scan() {
 			for mpath in ${CONFIG_PROTECT_MASK}; do
 				mpath="${EROOT%/}${mpath}"
 				if [[ "${rpath}" == "${mpath}"* ]] ; then
-					echo "Updating masked file: ${live_file}"
+					${QUIET} || echo "Updating masked file: ${live_file}"
 					mv "${cfg_file}" "${live_file}"
 					continue 2
 				fi
 			done
 			if [[ ! -f ${file} ]] ; then
-				echo "Skipping non-file ${file} ..."
+				${QUIET} || echo "Skipping non-file ${file} ..."
 				continue
 			fi
 
@@ -140,7 +140,7 @@ scan() {
 				fi
 
 				if [[ ${MATCHES} == 1 ]] ; then
-					echo "Automerging trivial changes in: ${live_file}"
+					${QUIET} || echo "Automerging trivial changes in: ${live_file}"
 					do_mv_ln "${cfg_file}" "${live_file}"
 					continue
 				else
@@ -548,9 +548,9 @@ die() {
 	local msg=$1 exitcode=${2:-1}
 
 	if [ ${exitcode} -eq 0 ] ; then
-		printf 'Exiting: %b\n' "${msg}"
+		${QUIET} || printf 'Exiting: %b\n' "${msg}"
 		scan > /dev/null
-		[ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining"
+		! ${QUIET} && [ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining"
 	else
 		error "${msg}"
 	fi
@@ -575,6 +575,7 @@ usage() {
 	  -d, --debug    Enable shell debugging
 	  -h, --help     Show help and run away
 	  -p, --preen    Automerge trivial changes only and quit
+	  -q, --quiet    Show only essential output
 	  -v, --verbose  Show settings and such along the way
 	  -V, --version  Show version and trundle away
 
@@ -600,6 +601,7 @@ declare title="Gentoo's etc-update tool!"
 
 PREEN=false
 SET_X=false
+QUIET=false
 VERBOSE=false
 NONINTERACTIVE_MV=false
 while [[ -n $1 ]] ; do
@@ -607,6 +609,7 @@ while [[ -n $1 ]] ; do
 		-d|--debug)   SET_X=true;;
 		-h|--help)    usage;;
 		-p|--preen)   PREEN=true;;
+		-q|--quiet)   QUIET=true;;
 		-v|--verbose) VERBOSE=true;;
 		-V|--version) emerge --version; exit 0;;
 		--automode)   parse_automode_flag $2 && shift || usage 1 "Invalid mode '$2'";;