summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: