diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-08-28 18:36:53 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-08-29 13:58:49 +0200 |
commit | 50c311c2618305573e043124e95e966fb6df783d (patch) | |
tree | 6c9258a560c31c715ad5ee45f6c9bee134478a4c | |
parent | ef10f6c799c18adb555ee4f081097caf36823bfe (diff) | |
download | devtools-50c311c2618305573e043124e95e966fb6df783d.tar.gz devtools-50c311c2618305573e043124e95e966fb6df783d.tar.xz |
archbuild: Avoid unnecessary use of basename(1)
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
-rwxr-xr-x | archbuild | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -2,20 +2,21 @@ base_packages=(base base-devel sudo) -cmd="$(basename "${0%-build}")" -if [[ "${cmd%-*}" == 'multilib' ]]; then - repo="${cmd}" +cmd="${0##*/}" +if [[ "${cmd%%-*}" == 'multilib' ]]; then + repo="${cmd%-build}" arch='x86_64' base_packages+=(multilib-devel) else - repo=${cmd%-*} - arch=${cmd##*-} + tag="${cmd%-build}" + repo=${tag%-*} + arch=${tag##*-} fi chroots='/var/tmp/archbuild' clean_first=false usage() { - echo "usage $(basename "$0")" + echo "usage $cmd" echo ' -c Recreate the chroot before building' echo ' -r <dir> Create chroots in this directory' exit 1 |