repo-add: fix path designation regression
b899099
made path checking a bit more strict than I had intended, and
would actually forbid creation of a repo in $PWD if only the filename
was specified. readlink would be the fun and easy solution here, but
it's avoided due to portability issues, making the validation process a
bit more verbose.
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
eedd56f320
commit
d8d287b4d2
1 changed files with 11 additions and 2 deletions
|
@ -377,9 +377,18 @@ db_remove_entry() {
|
||||||
} # end db_remove_entry
|
} # end db_remove_entry
|
||||||
|
|
||||||
check_repo_db() {
|
check_repo_db() {
|
||||||
|
local repodir
|
||||||
|
|
||||||
# ensure the path to the DB exists
|
# ensure the path to the DB exists
|
||||||
if [[ ! -d "${LOCKFILE%/*}" ]]; then
|
if [[ "$LOCKFILE" == /* ]]; then
|
||||||
error "$(gettext "%s does not exist or is not a directory.")" "${LOCKFILE%/*}"
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue