summaryrefslogtreecommitdiff
path: root/scripts/repo-add.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/repo-add.sh.in')
-rw-r--r--scripts/repo-add.sh.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index f47c9557..e970da38 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -377,9 +377,18 @@ db_remove_entry() {
} # end db_remove_entry
check_repo_db() {
+ local repodir
+
# ensure the path to the DB exists
- if [[ ! -d "${LOCKFILE%/*}" ]]; then
- error "$(gettext "%s does not exist or is not a directory.")" "${LOCKFILE%/*}"
+ if [[ "$LOCKFILE" == /* ]]; then
+ repodir=${LOCKFILE%/*}/
+ else
+ repodir=$PWD/$LOCKFILE
+ repodir=${repodir%/*}/
+ fi
+
+ if [[ ! -d "$repodir" ]]; then
+ error "$(gettext "%s does not exist or is not a directory.")" "$repodir"
exit 1
fi