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-30-2011, 03:24 AM
Dave Reisner
 
Default repo-add.sh.in: avoid being clever with repo repacking

Revert to the old behavior that 6f5a90 attempted to simplify and go with
the original proposed solution of using "ugly" bash to detect empty
directories.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
And here's such a patch...

scripts/repo-add.sh.in | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 17b32aa..37466ea 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -629,8 +629,13 @@ if (( success )); then
filename=${REPO_DB_FILE##*/}

pushd "$tmpdir" >/dev/null
- # strip the './' off filenames; this also allows us to tar an empty dir
- bsdtar -s %^./%% -c${TAR_OPT}f "$REPO_DB_FILE" ./
+ if ( shopt -s nullglob; files=(*); (( ${#files[*]} )) ); then
+ bsdtar -c${TAR_OPT}f "$filename" *
+ else
+ # we have no packages remaining? zip up some emptyness
+ warning "$(gettext "No packages remain, creating empty database.")"
+ bsdtar -c${TAR_OPT}f "$filename" -T /dev/null
+ fi
create_signature "$filename"
popd >/dev/null

--
1.7.6
 

Thread Tools




All times are GMT. The time now is 12:11 PM.

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