Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Wu Fengguang <fengguang.wu@intel.com>
Subject: [PATCH 3/4] alsa-info.sh: let mv fail loudly
Date: Wed, 08 Jul 2009 21:07:25 +0800	[thread overview]
Message-ID: <20090708131504.200097234@intel.com> (raw)
In-Reply-To: 20090708130722.723912338@intel.com

[-- Attachment #1: alsa-mv-f.patch --]
[-- Type: text/plain, Size: 1440 bytes --]

When mv cannot overwrite target file, it will prompt and return TRUE.
Add the '-f' option so that it returns FALSE when failed.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 utils/alsa-info.sh |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- alsa-driver.orig/utils/alsa-info.sh
+++ alsa-driver/utils/alsa-info.sh
@@ -74,7 +74,7 @@ update() {
 					echo "Please re-run the script"
 					rm $SHFILE 2>/dev/null
 				else
-					mv $SHFILE /tmp/alsa-info.sh || exit 1
+					mv -f $SHFILE /tmp/alsa-info.sh || exit 1
 					echo "ALSA-Info script has been downloaded as /tmp/alsa-info.sh."
 					echo "Please re-run the script from new location."
 				fi
@@ -92,7 +92,7 @@ update() {
 				echo "ALSA-Info script has been updated. Please re-run it."
 				rm $SHFILE 2>/dev/null
 			else
-				mv $SHFILE /tmp/alsa-info.sh || exit 1
+				mv -f $SHFILE /tmp/alsa-info.sh || exit 1
 				echo "ALSA-Info script has been downloaded as /tmp/alsa-info.sh."
 				echo "Please, re-run it from new location."
 			fi
@@ -750,7 +750,7 @@ fi
 if [ "$UPLOAD" = "no" ]; then
 
 	if [ -z "$TOSTDOUT" ]; then
-		mv $FILE $NFILE || exit 1
+		mv -f $FILE $NFILE || exit 1
 	fi
 
 	if [[ -n $DIALOG ]]
@@ -863,7 +863,7 @@ echo ""
 
 #We couldnt find a suitable wget, so tell the user to upload manually.
 else
-	mv $FILE $NFILE || exit 1
+	mv -f $FILE $NFILE || exit 1
 	if [[ -z $DIALOG ]]
 	then
 		if [[ -z $PASTEBIN ]]; then

-- 

  parent reply	other threads:[~2009-07-08 13:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-08 13:07 [PATCH 0/4] alsa-info.sh updates Wu Fengguang
2009-07-08 13:07 ` [PATCH 1/4] alsa-info.sh: Do not automatically upload alsa info Wu Fengguang
2009-07-08 13:25   ` Wu Fengguang
2009-07-08 13:07 ` [PATCH 2/4] alsa-info.sh: fix whitespace leaked to stdout Wu Fengguang
2009-07-08 13:07 ` Wu Fengguang [this message]
2009-07-08 13:07 ` [PATCH 4/4] alsa-info.sh: introduce withall() Wu Fengguang
2009-07-09 16:51 ` [PATCH 0/4] alsa-info.sh updates Takashi Iwai
2009-07-09 17:03   ` Daniel Chen
2009-07-09 17:19     ` Mark Brown
2009-07-16  9:42 ` Takashi Iwai
2009-07-16 11:24   ` [PATCH] alsa-info.sh: add dmesg info on ALSA/HDA Wu Fengguang
2009-07-16 11:59     ` Takashi Iwai

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=20090708131504.200097234@intel.com \
    --to=fengguang.wu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox