archbuild: Avoid unnecessary use of basename(1)

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
This commit is contained in:
Lukas Fleischer 2011-08-28 18:36:53 +02:00 committed by Pierre Schmitz
parent ef10f6c799
commit 50c311c261
1 changed files with 7 additions and 6 deletions

View File

@ -2,20 +2,21 @@
base_packages=(base base-devel sudo) base_packages=(base base-devel sudo)
cmd="$(basename "${0%-build}")" cmd="${0##*/}"
if [[ "${cmd%-*}" == 'multilib' ]]; then if [[ "${cmd%%-*}" == 'multilib' ]]; then
repo="${cmd}" repo="${cmd%-build}"
arch='x86_64' arch='x86_64'
base_packages+=(multilib-devel) base_packages+=(multilib-devel)
else else
repo=${cmd%-*} tag="${cmd%-build}"
arch=${cmd##*-} repo=${tag%-*}
arch=${tag##*-}
fi fi
chroots='/var/tmp/archbuild' chroots='/var/tmp/archbuild'
clean_first=false clean_first=false
usage() { usage() {
echo "usage $(basename "$0")" echo "usage $cmd"
echo ' -c Recreate the chroot before building' echo ' -c Recreate the chroot before building'
echo ' -r <dir> Create chroots in this directory' echo ' -r <dir> Create chroots in this directory'
exit 1 exit 1