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)
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