summaryrefslogtreecommitdiff
path: root/db-functions
diff options
context:
space:
mode:
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions14
1 files changed, 7 insertions, 7 deletions
diff --git a/db-functions b/db-functions
index 59e9c29..26b23e4 100644
--- a/db-functions
+++ b/db-functions
@@ -16,7 +16,7 @@ restore_umask () {
}
# set up general environment
-WORKDIR=$(mktemp -dt "$(basename $0).XXXXXXXXXX")
+WORKDIR=$(mktemp -dt "${0##*/}.XXXXXXXXXX")
LOCKS=()
# check if messages are to be printed using color
@@ -85,10 +85,10 @@ get_full_version() {
}
script_lock() {
- local LOCKDIR="$TMPDIR/.scriptlock.$(basename $0)"
+ local LOCKDIR="$TMPDIR/.scriptlock.${0##*/}"
if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then
local _owner="$(/usr/bin/stat -c %U $LOCKDIR)"
- error "Script $(basename $0) is already locked by $_owner."
+ error "Script ${0##*/} is already locked by $_owner."
exit 1
else
set_umask
@@ -97,9 +97,9 @@ script_lock() {
}
script_unlock() {
- local LOCKDIR="$TMPDIR/.scriptlock.$(basename $0)"
+ local LOCKDIR="$TMPDIR/.scriptlock.${0##*/}"
if [ ! -d "$LOCKDIR" ]; then
- warning "Script $(basename $0) was not locked!"
+ warning "Script ${0##*/} was not locked!"
restore_umask
return 1
else
@@ -123,8 +123,8 @@ cleanup() {
repo_unlock $repo $arch
fi
done
- if [ -d "$TMPDIR/.scriptlock.$(basename $0)" ]; then
- msg "Removing left over lock from $(basename $0)"
+ if [ -d "$TMPDIR/.scriptlock.${0##*/}" ]; then
+ msg "Removing left over lock from ${0##*/}"
script_unlock
fi
rm -rf "$WORKDIR"