summaryrefslogtreecommitdiffstats
path: root/db-functions
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-11-21 06:57:46 +0100
committerAaron Griffin <aaronmgriffin@gmail.com>2008-11-21 06:57:46 +0100
commitc7fa1913b56e7619b64b93a10e130cf90508737a (patch)
tree730c8ca6164fdfbe051efb85e982453ab39a43a2 /db-functions
parent830af506b6b1ed7f3c73d55e0771f2ded6cc795a (diff)
downloaddbscripts-c7fa1913b56e7619b64b93a10e130cf90508737a.tar.gz
dbscripts-c7fa1913b56e7619b64b93a10e130cf90508737a.tar.xz
Fix patching for chmod call
dirname was failing if the target was a dir Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions4
1 files changed, 3 insertions, 1 deletions
diff --git a/db-functions b/db-functions
index 4252c59..11ab422 100644
--- a/db-functions
+++ b/db-functions
@@ -70,7 +70,9 @@ check_pkg_arch () { #check_pkg_arch pkgfile arch
# have proper DB permissions
copy_helper () { #copy_helper file dest
/bin/cp $1 $2 || return 1
- /bin/chmod 664 "$(dirname $2)/$(basename $1)" || return 1
+ dir=$2
+ [ -f $dir ] && dir=$(dirname $dir)
+ /bin/chmod 664 "$dir/$(basename $1)" || return 1
}
# vim: set ts=4 sw=4 noet ft=sh: