Mercurial > masqmail
view devel/gen-dist @ 249:f9da5a7caeda
refactored the cmdline argument processing
I replaced the nested switch statements with one single
large else-if construct. Instead of char comparision now
str(n)cmp(3) is used. Although this is slower it is much
more readable and covers corner-cases which were uncovered
before (e.g. -bdxxx).
As always: Readability and simplicity matter, not performance.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Thu, 04 Nov 2010 11:02:42 -0300 |
parents | 7b70bf4f1f42 |
children |
line wrap: on
line source
#!/bin/sh # # generate a tar.gz archive to distribute # generate an md5sum and a detached signature of the archive # # requires: # - mercurial (hg) # - md5sum # - gnupg if [ $# -ne 1 -o -e "$1" ] ; then echo "usage: gen-dist DEST.tar.gz" 2>&1 exit 1 fi dir="${1%/*}" file="${1##*/}" hg archive -t tgz -X .hg\* "$1" cd "$dir" md5sum "$file" >"$file.md5sum" gpg -ab "$file"