[packages/google-chrome] add die() function

glen glen at pld-linux.org
Tue Sep 13 21:38:43 CEST 2016


commit f1c7d842e99ff1df1f2c47a3d1daf97b7b593af1
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Sep 13 22:37:47 2016 +0300

    add die() function

 update-source.sh | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/update-source.sh b/update-source.sh
index 888b96f..14afdb5 100755
--- a/update-source.sh
+++ b/update-source.sh
@@ -1,5 +1,10 @@
 #!/bin/sh
 
+die() {
+	echo >&2 "$0: $*"
+	exit 1
+}
+
 if [ "$1" = "-k" ]; then
 	cache=yes
 	shift
@@ -22,8 +27,7 @@ case "${branch}" in
 	stable|beta|unstable)
 		;;
 	*)
-		echo "$0: Unknown branch: $branch. Supported branches: stable, beta, unstable." >&2
-		exit 1
+		die "Unknown branch: $branch. Supported branches: stable, beta, unstable."
 		;;
 esac
 
@@ -52,8 +56,7 @@ ver=$1
 rel=$2
 
 if [ -z "$ver" -o -z "$rel" ]; then
-	echo "Error: xml file is missing data for ${branch} type"
-	exit 1
+	die "Error: xml file is missing data for ${branch} type"
 fi
 
 # check google-chrome ver only
@@ -72,8 +75,7 @@ test -e $manifest || {
 	echo ./opt/google/chrome*/PepperFlash/manifest.json > $t
 	rpm2cpio $rpm | cpio -i -E $t --to-stdout > manifest-$ver.json
 	if [ ! -s manifest-$ver.json ]; then
-		echo "Failed to extract flash version."
-		exit 1
+		die "Failed to extract flash version."
 	fi
 }
 flashv=$(awk -F'"' '/version/{print $4}' manifest-$ver.json)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/google-chrome.git/commitdiff/f1c7d842e99ff1df1f2c47a3d1daf97b7b593af1



More information about the pld-cvs-commit mailing list