]> git.pld-linux.org Git - packages/google-chrome.git/blobdiff - update-source.sh
add die() function
[packages/google-chrome.git] / update-source.sh
index 888b96f5e603c900d672f5a4b722d72fa0d0b084..14afdb5adc11203771bf1f15b433f27e8d4af916 100755 (executable)
@@ -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)
This page took 0.070976 seconds and 4 git commands to generate.