From patchwork Fri Aug 22 08:31:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 4762111 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EC8C59F37E for ; Fri, 22 Aug 2014 08:32:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECCC52017A for ; Fri, 22 Aug 2014 08:32:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A9B1220160 for ; Fri, 22 Aug 2014 08:32:06 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B0795265741; Fri, 22 Aug 2014 10:32:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 41957265782; Fri, 22 Aug 2014 10:31:53 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1B78C2658E8; Fri, 22 Aug 2014 10:31:52 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id 69039265741 for ; Fri, 22 Aug 2014 10:31:44 +0200 (CEST) Received: from hd9483857.selulk5.dyn.perspektivbredband.net ([217.72.56.87] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XKkG7-0008WD-KI; Fri, 22 Aug 2014 08:31:43 +0000 From: David Henningsson To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Fri, 22 Aug 2014 10:31:41 +0200 Message-Id: <1408696301-5622-2-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408696301-5622-1-git-send-email-david.henningsson@canonical.com> References: <1408696301-5622-1-git-send-email-david.henningsson@canonical.com> Cc: David Henningsson Subject: [alsa-devel] [PATCH 2/2] alsa-info: Refactor "withall" logic X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Previously, using --output, --no-upload, --upload and --pastebin switches implied the withall switch. A more intuitive logic would be that --with-all is disabled if you use another --with* switch, such as --withdmesg, and only then. Also update script version to reflect the behaviour change. Signed-off-by: David Henningsson --- alsa-info/alsa-info.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/alsa-info/alsa-info.sh b/alsa-info/alsa-info.sh index 47157f0..acd8495 100755 --- a/alsa-info/alsa-info.sh +++ b/alsa-info/alsa-info.sh @@ -1,6 +1,6 @@ #!/bin/bash -SCRIPT_VERSION=0.4.63 +SCRIPT_VERSION=0.4.64 CHANGELOG="http://www.alsa-project.org/alsa-info.sh.changelog" ################################################################################# @@ -260,6 +260,7 @@ withall() { withlsmod withsysfs withdmesg + WITHALL="no" } get_alsa_library_version() { @@ -629,7 +630,6 @@ fi #If no command line options are specified, then run as though --with-all was specified if [ -z "$1" ]; then update - withall pbcheck fi @@ -642,7 +642,6 @@ if [ -n "$1" ]; then case "$1" in --pastebin) update - withall pbcheck ;; --update) @@ -651,43 +650,45 @@ if [ -n "$1" ]; then ;; --upload) UPLOAD="yes" - withall ;; --no-upload) UPLOAD="no" - withall ;; --output) shift NFILE="$1" KEEP_OUTPUT="yes" - withall ;; --debug) echo "Debugging enabled. $FILE and $TEMPDIR will not be deleted" KEEP_FILES="yes" echo "" - withall ;; --with-all) withall ;; --with-aplay) withaplay + WITHALL="no" ;; --with-amixer) withamixer + WITHALL="no" ;; --with-alsactl) withalsactl + WITHALL="no" ;; --with-devices) withdevices + WITHALL="no" ;; --with-dmesg) withdmesg + WITHALL="no" ;; --with-configs) + WITHALL="no" if [[ -e $HOME/.asoundrc ]] || [[ -e /etc/asound.conf ]] then echo "!!ALSA configuration files" >> $FILE @@ -717,7 +718,9 @@ if [ -n "$1" ]; then ;; --stdout) UPLOAD="no" - withall + if [ -z "$WITHALL" ]; then + withall + fi cat $FILE rm $FILE ;; @@ -766,6 +769,10 @@ if [ "$PROCEED" = "no" ]; then exit 1 fi +if [ -z "$WITHALL" ]; then + withall +fi + if [ "$UPLOAD" = "ask" ]; then if [ -n "$DIALOG" ]; then dialog --backtitle "$BGTITLE" --title "Information collected" --yes-label " UPLOAD / SHARE " --no-label " SAVE LOCALLY " --defaultno --yesno "\n\nAutomatically upload ALSA information to $WWWSERVICE?" 10 80