summaryrefslogtreecommitdiff
path: root/db-functions
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-01-08 20:49:48 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-01-08 21:27:09 -0500
commitd3afe9bb766bbdfaab1474d21fd5e28f0a356039 (patch)
treefbbd414f8526b5ae053fc708cd6844dbfadd3ecb /db-functions
parentaefd5a4d961e3eca3326c90ba266d04b325c1f15 (diff)
Avoid using $(basename $var) , use ${var##*/} instead
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions10
1 files changed, 5 insertions, 5 deletions
diff --git a/db-functions b/db-functions
index 83e0613..52ad8bb 100644
--- a/db-functions
+++ b/db-functions
@@ -324,7 +324,7 @@ check_pkgfile() {
in_array "${pkgarch}" "${ARCHES[@]}" 'any' || return 1
- if echo "$(basename ${pkgfile})" | grep -q "${pkgname}-${pkgver}-${pkgarch}"; then
+ if echo "${pkgfile##*/}" | grep -q "${pkgname}-${pkgver}-${pkgarch}"; then
return 0
else
return 1
@@ -425,8 +425,8 @@ check_pkgrepos() {
[ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1
[ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1
- [ -f "${FTP_BASE}/${PKGPOOL}/$(basename ${pkgfile})" ] && return 1
- [ -f "${FTP_BASE}/${PKGPOOL}/$(basename ${pkgfile}).sig" ] && return 1
+ [ -f "${FTP_BASE}/${PKGPOOL}/${pkgfile##*/}" ] && return 1
+ [ -f "${FTP_BASE}/${PKGPOOL}/${pkgfile##*/}.sig" ] && return 1
local repo
local arch
@@ -434,8 +434,8 @@ check_pkgrepos() {
for arch in "${ARCHES[@]}"; do
[ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1
[ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1
- [ -f "${FTP_BASE}/${repo}/os/${arch}/$(basename ${pkgfile})" ] && return 1
- [ -f "${FTP_BASE}/${repo}/os/${arch}/$(basename ${pkgfile}).sig" ] && return 1
+ [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgfile##*/}" ] && return 1
+ [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgfile##*/}.sig" ] && return 1
done
done