savannah-hackers-public
[Top][All Lists]
Advanced

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

[Savannah-hackers-public] [PATCH 3/6] gsv-eval-remote.sh (process_packag


From: Bruno Félix Rezende Ribeiro
Subject: [Savannah-hackers-public] [PATCH 3/6] gsv-eval-remote.sh (process_package): improve error reporting of unknown method.
Date: Wed, 23 Sep 2015 04:02:41 -0300

---
 gsv-eval-remote.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gsv-eval-remote.sh b/gsv-eval-remote.sh
index 5d2bc43..d44cbe0 100755
--- a/gsv-eval-remote.sh
+++ b/gsv-eval-remote.sh
@@ -96,9 +96,11 @@ fetch_package() {
 }
 
 process_package() {
-    local DIRECTORY
+    local DIRECTORY TYPE
 
-    case $(echo $(file -b --mime-type "$1") $(file -b "$1"))  in
+    TYPE="$(echo $(file -b --mime-type "$1") \| $(file -b "$1"))"
+
+    case $TYPE in
         *application/gzip*)
             gunzip "$1" || die "failed to decompress '$1'"
             process_package "${1%.*}"
@@ -142,7 +144,7 @@ process_package() {
             pwd
             ;;
         *)
-            die "there is no known method to process '$1'"
+            die "there is no known method to process '$TYPE'"
             ;;
     esac
 }
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]