From: Maxim Levitsky <maximlevitsky@gmail.com>
To: Travis Place <wishie@wishie.net>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] alsa-info.sh - Check if pastebin.ca is up, and gracefully fallback to --no-upload if its down.
Date: Wed, 04 Jun 2008 17:01:59 +0300 [thread overview]
Message-ID: <4846A057.2050806@gmail.com> (raw)
In-Reply-To: <1212586845.20980.0.camel@temp-fallen>
[-- Attachment #1: Type: text/plain, Size: 857 bytes --]
Travis Place wrote:
> 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 <wishie at wishie dot net>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
You mean this message,
your patch attached.
[-- Attachment #2: alsa-info.sh-0.4.45.patch --]
[-- Type: text/x-diff, Size: 3097 bytes --]
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"
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
prev parent reply other threads:[~2008-06-04 14:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 13:40 [PATCH] alsa-info.sh - Check if pastebin.ca is up, and gracefully fallback to --no-upload if its down Travis Place
2008-06-04 14:01 ` Maxim Levitsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4846A057.2050806@gmail.com \
--to=maximlevitsky@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=wishie@wishie.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.