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 4e2e4a70..de0b12c1 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