FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-23-2011, 12:38 AM
Dave Reisner
 
Default 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.
---
scripts/repo-add.sh.in | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 17639ed..029e17d 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -374,9 +374,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

--
1.7.5.4
 

Thread Tools




All times are GMT. The time now is 02:50 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org