diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2009-07-21 00:22:00 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-07-21 00:22:00 +0200 |
commit | 2ff2ae734f8909054776f89fdb2f6fb3795aac15 (patch) | |
tree | 2a4e861b6e166b6333c42e493950d99cf04640be | |
parent | 9316686c4c29f92a9723d47f5137e172dea04441 (diff) | |
download | dbscripts-2ff2ae734f8909054776f89fdb2f6fb3795aac15.tar.gz dbscripts-2ff2ae734f8909054776f89fdb2f6fb3795aac15.tar.xz |
db-scripts: getpkgbase: return pkgbase by default
Check for pkgbase first. If and only if this doesn't exist,
return pkgname. This fixes potential ordering issues.
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rw-r--r-- | db-functions | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/db-functions b/db-functions index 6d84d31..fb00d89 100644 --- a/db-functions +++ b/db-functions @@ -66,14 +66,13 @@ _grep_pkginfo() { } -# Get the package base or name +# Get the package base or name as fallback getpkgbase() { local _base - _base="$(_grep_pkginfo "$1" "^pkg(base|name)")" + _base="$(_grep_pkginfo "$1" "^pkgbase")" if [ -z "$_base" ]; then - echo "ERROR: Package '$1' has no pkgbase or pkgname in the PKGINFO. Fail!" - exit 1 + echo $(getpkgname "$1") fi echo "$_base" |