xbps-src: replace basename(1) with ${var##*/}.

Reduce number of fork+exec due to using a subshell to execute basename(1).
This commit is contained in:
Juan RP 2015-09-11 07:55:40 +02:00
parent ea9c012c04
commit bcdacb66a0
20 changed files with 28 additions and 23 deletions

View file

@ -10,7 +10,7 @@
# $5 - internal [OPTIONAL]
if [ $# -lt 3 -o $# -gt 5 ]; then
echo "$(basename $0): invalid number of arguments: pkgname targetpkg target [cross-target]"
echo "${0##*/}: invalid number of arguments: pkgname targetpkg target [cross-target]"
exit 1
fi

View file

@ -7,7 +7,7 @@
# $2 - cross target [OPTIONAL]
if [ $# -lt 1 -o $# -gt 2 ]; then
echo "$(basename $0): invalid number of arguments: pkgname [cross-target]"
echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
exit 1
fi

View file

@ -7,7 +7,7 @@
# $2 - cross target [OPTIONAL]
if [ $# -lt 1 -o $# -gt 2 ]; then
echo "$(basename $0): invalid number of arguments: pkgname [cross-target]"
echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
exit 1
fi

View file

@ -7,7 +7,7 @@
# $2 - cross target [OPTIONAL]
if [ $# -lt 1 -o $# -gt 2 ]; then
echo "$(basename $0): invalid number of arguments: pkgname [cross-target]"
echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
exit 1
fi

View file

@ -7,7 +7,7 @@
# $2 - cross target [OPTIONAL]
if [ $# -lt 1 -o $# -gt 2 ]; then
echo "$(basename $0): invalid number of arguments: pkgname [cross-target]"
echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
exit 1
fi

View file

@ -7,7 +7,7 @@
# $2 - cross target [OPTIONAL]
if [ $# -lt 1 -o $# -gt 2 ]; then
echo "$(basename $0): invalid number of arguments: pkgname [cross-target]"
echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
exit 1
fi

View file

@ -8,7 +8,7 @@
# $3 - cross-target [OPTIONAL]
if [ $# -lt 2 -o $# -gt 3 ]; then
echo "$(basename $0): invalid number of arguments: pkgname repository [cross-target]"
echo "${0##*/}: invalid number of arguments: pkgname repository [cross-target]"
exit 1
fi

View file

@ -7,7 +7,7 @@
# $2 - cross target [OPTIONAL]
if [ $# -lt 1 -o $# -gt 2 ]; then
echo "$(basename $0): invalid number of arguments: pkgname [cross-target]"
echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
exit 1
fi