mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-11 15:40:14 -04:00
repo-add: show better error when path to repo does not exist
Previously, the error message when trying to add to a repo where a parent directory didn't exist was: ==> ERROR: Failed to acquire lockfile: /path/to/noexist/repo.tar.gz.lck This sucks. Make an explicit check to ensure that the path to the repo really does exist, and throw a meaningful error message when it can't be found. Dan: reuse an existing (translated) error message. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
ee638415e3
commit
b899099327
@ -382,6 +382,12 @@ db_remove_entry() {
|
||||
|
||||
check_repo_db()
|
||||
{
|
||||
# ensure the path to the DB exists
|
||||
if [[ ! -d "${LOCKFILE%/*}" ]]; then
|
||||
error "$(gettext "%s does not exist or is not a directory.")" "${LOCKFILE%/*}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check lock file
|
||||
if ( set -o noclobber; echo "$$" > "$LOCKFILE") 2> /dev/null; then
|
||||
CLEAN_LOCK=1
|
||||
|
Loading…
x
Reference in New Issue
Block a user