diff options
author | Ryan Pavlik <rpavlik@iastate.edu> | 2012-05-07 17:40:30 (GMT) |
---|---|---|
committer | Mark Brand <mabrand@mabrand.nl> | 2012-06-13 16:22:32 (GMT) |
commit | 2bdbb1360d21035c079b35c1a98261de95fd9d91 (patch) | |
tree | cd5f74d8b629c06b82e1f790ab185beb9a05fdff /tools | |
parent | febfb4954177f6fa36e648b67a6da7de342a689b (diff) | |
download | mxe-2bdbb1360d21035c079b35c1a98261de95fd9d91.zip mxe-2bdbb1360d21035c079b35c1a98261de95fd9d91.tar.gz mxe-2bdbb1360d21035c079b35c1a98261de95fd9d91.tar.bz2 |
Patch tool: replace elifs with case. Also handles errors.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/patch-tool-mxe | 30 |
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 + |