diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-08-24 10:18:26 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-08-25 11:20:41 +0200 |
commit | 7952d6fbfc4f6430e043d65ddf2923ca359cfb73 (patch) | |
tree | 0b2a4d2326399e6fef190b49031e1f6393504006 | |
parent | 3c175e98bdd905897199a9ff6a46de828d9a2fc1 (diff) | |
download | devtools-7952d6fbfc4f6430e043d65ddf2923ca359cfb73.tar.xz |
checkpkg: Avoid unnecessary use of grep(1)/basename(1)
Use parameter expansion instead of invoking external binaries here.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
-rwxr-xr-x | checkpkg | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -52,14 +52,14 @@ for _pkgname in "${pkgname[@]}"; do oldpkg=${pkgurl##*://*/} - if [[ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]]; then + if [[ ${oldpkg##*/} = ${pkgfile##*/} ]]; then echo "The built package ($_pkgname) is the one in the repo right now!" exit 1 fi if [[ ! -f $oldpkg ]]; then - if echo $pkgurl | grep '^file:///' > /dev/null 2>&1; then - ln -s "${pkgurl#file://}" $(basename "${pkgurl#file://}") + if [[ $pkgurl = file://* ]]; then + ln -s "${pkgurl#file://}" "${pkgurl##file://*/}" elif [[ -f "$PKGDEST/$oldpkg" ]]; then ln -s "$PKGDEST/$oldpkg" "$oldpkg" elif [[ -f "$STARTDIR/$oldpkg" ]]; then |