index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <d@falconindy.com> | 2011-06-22 09:30:35 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-23 23:27:07 -0500 |
commit | d8d287b4d215eceb382385b84495666f5a03399e (patch) | |
tree | d9965a2ff1d688ebf7bab9e9971f1b751f117cbc /scripts | |
parent | eedd56f320c175c430ead9226dc871a9ce04ba3f (diff) |
-rw-r--r-- | scripts/repo-add.sh.in | 13 |
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 |