[PATCH 3/4] alsa-info.sh: let mv fail loudly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

-- 

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux