From mboxrd@z Thu Jan 1 00:00:00 1970 From: stan Subject: [Fwd: [PATCH] Patch for alsa-info.sh to check if pastebin.ca is down, and handle with grace.] Date: Wed, 04 Jun 2008 05:59:01 -0700 Message-ID: <48469195.30309@cox.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040800030907080505000003" Return-path: Received: from fed1rmmtao102.cox.net (fed1rmmtao102.cox.net [68.230.241.44]) by alsa0.perex.cz (Postfix) with ESMTP id EB3312440E for ; Wed, 4 Jun 2008 14:59:03 +0200 (CEST) Received: from fed1rmimpo02.cox.net ([70.169.32.72]) by fed1rmmtao102.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20080604125901.TCXE1308.fed1rmmtao102.cox.net@fed1rmimpo02.cox.net> for ; Wed, 4 Jun 2008 08:59:01 -0400 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: ALSA Developers List-Id: alsa-devel@alsa-project.org This is a multi-part message in MIME format. --------------040800030907080505000003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This one? --------------040800030907080505000003 Content-Type: message/rfc822; name="[alsa-devel] [PATCH] Patch for alsa-info.sh to check if pastebin.ca is down,and handle with grace..eml" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="[alsa-devel] [PATCH] Patch for alsa-info.sh to check if past"; filename*1="ebin.ca is down, and handle with grace..eml" X-Account-Key: account6 X-Mozilla-Keys: Return-Path: Received: from eastrmimpi03.cox.net ([68.1.16.121]) by eastrmmtai111.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20080522180935.ODYY4652.eastrmmtai111.cox.net@eastrmimpi03.cox.net> for ; Thu, 22 May 2008 14:09:35 -0400 Received: from alsa0.perex.cz ([212.20.107.51]) by eastrmimpi03.cox.net with IMP id Ui9Z1Z07u16Zmb001i9bWK; Thu, 22 May 2008 14:09:36 -0400 X-VR-Score: -100.00 X-CM-Score: 0.00 Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4B0DB24421; Thu, 22 May 2008 20:09:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on alsa0.alsa-project.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=RDNS_DYNAMIC autolearn=disabled version=3.2.4 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7D02C243F9; Thu, 22 May 2008 20:09:30 +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 13C79243EE; Thu, 22 May 2008 20:09:22 +0200 (CEST) Received: from wishie.net (202-137-100-089.dial.usertools.net [202.137.100.89]) by alsa0.perex.cz (Postfix) with ESMTP id 9F4D5243F9 for ; Thu, 22 May 2008 20:09:19 +0200 (CEST) Received: from [192.168.0.2] (fallen [192.168.0.2]) by wishie.net (Postfix) with ESMTP id 403355CAE4 for ; Thu, 22 May 2008 18:30:22 +1000 (EST) From: Travis Place To: alsa-devel@alsa-project.org Date: Fri, 23 May 2008 04:08:33 +1000 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_habNIG4KCVIpnkg" Message-Id: <200805230408.33303.wishie@wishie.net> Subject: [alsa-devel] [PATCH] Patch for alsa-info.sh to check if pastebin.ca is down, and handle with grace. X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.9 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: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org --Boundary-00=_habNIG4KCVIpnkg Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Changelog: This patch will allow alsa-info.sh to check if the pastebin site (www.pastebin.ca) is down, before trying to upload to it. It will fail gracefully, with a message letting the user know what happened. The script will also keep the ALSA information it collected (same way it does with --no-upload). Patch is attached. Signed-off-by: Travis Place -- Happiness is like peeing your pants. Everyone can see it, but only you can feel its warmth --Boundary-00=_habNIG4KCVIpnkg Content-Type: text/x-diff; charset="us-ascii"; name="alsa-info.sh-0.4.45.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="alsa-info.sh-0.4.45.patch" diff -r 2ea9a8a108ea alsa-info.sh --- a/alsa-info.sh Mon May 19 18:29:17 2008 +0200 +++ b/alsa-info.sh Fri May 23 04:06:32 2008 +1000 @@ -1,6 +1,6 @@ #!/bin/bash -SCRIPT_VERSION=0.4.44 +SCRIPT_VERSION=0.4.45 CHANGELOG="http://hg.alsa-project.org/alsa/log/tip/alsa-info.sh" ################################################################################# @@ -31,6 +31,10 @@ BGTITLE="ALSA-Info v $SCRIPT_VERSION" BGTITLE="ALSA-Info v $SCRIPT_VERSION" PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc" #Define some simple functions + +pbcheck(){ + [[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes" +} update() { wget -O /tmp/alsa-info.sh http://hg.alsa-project.org/alsa/raw-file/tip/alsa-info.sh >/dev/null 2>&1 @@ -190,7 +194,6 @@ SNDOPTIONS=$(modprobe -c|sed -n 's/^opti QUESTION="yes" PROCEED="yes" -NOUPLOAD="" REPEAT="" while [ -z "$REPEAT" ]; do REPEAT="no" @@ -411,9 +414,7 @@ then withamixer withalsactl withlsmod - #Workaround, while we sort out pastebin location, since pastebin.ca blocked us. - #NOUPLOAD="yes" - + pbcheck fi fi # proceed @@ -457,17 +458,6 @@ then withalsactl withlsmod ;; - #### FIX ME - --secure) - withdevices - withconfigs - withaplay - withamixer - withalsactl - withlsmod - withsecure - ;; - ########### --with-aplay) withaplay ;; @@ -598,7 +588,11 @@ if [[ -n $DIALOG ]] if [[ -n $DIALOG ]] then if [[ -n $NOUPLOAD ]]; then - dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the pastebin\n\nYour ALSA information can be seen by looking in $FILE" 10 100 + if [[ -n $PBERROR ]]; then + dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the pastebin. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $FILE" 10 100 + else + dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the pastebin\n\nYour ALSA information can be seen by looking in $FILE" 10 100 + fi else dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100 DIALOG_EXIT_CODE=$? @@ -610,10 +604,17 @@ fi fi clear if [[ -n $NOUPLOAD ]]; then - echo "You requested that your information was NOT automatically uploaded to the pastebin" - echo "" - echo "Your ALSA information can be seen by looking in $FILE" - echo "" + if [[ -n $PBERROR ]]; then + echo "An error occured while contacting the pastebin. Your information was NOT automatically uploaded." + echo "" + echo "Your ALSA information can be seen by looking in $FILE" + echo "" + else + echo "You requested that your information was NOT automatically uploaded to the pastebin" + echo "" + echo "Your ALSA information can be seen by looking in $FILE" + echo "" + fi fi if [[ -z $NOUPLOAD ]]; then echo "Your ALSA information is located at $FINAL_URL" --Boundary-00=_habNIG4KCVIpnkg Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel --Boundary-00=_habNIG4KCVIpnkg-- --------------040800030907080505000003 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel --------------040800030907080505000003--