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: allow specifying symlink as repo file

If the repo file already exists, we allow specifying the symlink instead
of the tarball itself.

Signed-off-by: Dave Reisner <d@falconindy.com>
---
I'm fairly sure this is a safe use of readlink, since it doesn't involve any of
the flags for canonicalizing paths. I was able to test it on OSX with great
success.

scripts/repo-add.sh.in | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 8865188..3581765 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -582,7 +582,10 @@ done
if (( success )); then
msg "$(gettext "Creating updated database file '%s'")" "$REPO_DB_FILE"

- case "$REPO_DB_FILE" in
+ # allows for syntax such as: repo-add repo.db /path/to/pkg
+ [[ -L "$REPO_DB_FILE" ]] && resolved=$(readlink "$REPO_DB_FILE")
+
+ case "${resolved:-$REPO_DB_FILE}" in
*.@(db|files).tar.gz) TAR_OPT="z" ;;
*.@(db|files).tar.bz2) TAR_OPT="j" ;;
*.@(db|files).tar.xz) TAR_OPT="J" ;;
--
1.7.5.4
 

Thread Tools




All times are GMT. The time now is 07:44 AM.

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