summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Pavlik <rpavlik@iastate.edu>2012-05-07 17:40:30 (GMT)
committerRyan Pavlik <rpavlik@iastate.edu>2012-05-07 17:57:04 (GMT)
commit46f1e2262ff7c68551ef733e6175bc6f68d2d68a (patch)
treefa8d197c3ad78615bdb56ed952d896ba3b897f1a
parentf212b7479b0f9257863686f9751813df19cfb225 (diff)
downloadmxe-46f1e2262ff7c68551ef733e6175bc6f68d2d68a.zip
mxe-46f1e2262ff7c68551ef733e6175bc6f68d2d68a.tar.gz
mxe-46f1e2262ff7c68551ef733e6175bc6f68d2d68a.tar.bz2
Patch tool: replace elifs with case. Also handles errors.
-rwxr-xr-xtools/patch-tool-mxe30
1 files changed, 23 insertions, 7 deletions
diff --git a/tools/patch-tool-mxe b/tools/patch-tool-mxe
index 8c30eb1..38d4f17 100755
--- a/tools/patch-tool-mxe
+++ b/tools/patch-tool-mxe
@@ -73,10 +73,26 @@ function import_patch {
git am --keep-cr
}
-if [ "$cmd" == "init" ]; then
- init_git $pkg
-elif [ "$cmd" == "import" ]; then
- import_patch $pkg
-elif [ "$cmd" == "export" ]; then
- export_patch $pkg
-fi
+case "$cmd" in
+ init)
+ init_git $pkg
+ ;;
+ import)
+ import_patch $pkg
+ ;;
+ export)
+ export_patch $pkg
+ ;;
+ *)
+ echo "Unrecognized command '${cmd}'" >&2
+ cat <<EOS
+ Usage: $0 COMMAND PACKAGENAME
+ where COMMAND is one of:
+ init - create a git directory for the package with the raw source
+ import - apply the "pkgname-1-fixes.patch" patch commits
+ export - create/replace the "pkgname-1-fixes.patch" patch with a patch of all commits since init.
+EOS
+ exit 1
+ ;;
+esac
+