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: avoid using ls to check for presence of files

Signed-off-by: Dave Reisner <d@falconindy.com>
---
scripts/repo-add.sh.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 029e17d..e75055f 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -593,7 +593,7 @@ if (( success )); then
filename=${REPO_DB_FILE##*/}

pushd "$tmpdir" >/dev/null
- if [[ -n $(ls) ]]; then
+ if ( shopt -s nullglob; files=(*); (( ${#files[*]} )) ); then
bsdtar -c${TAR_OPT}f "$filename" *
else
# we have no packages remaining? zip up some emptyness
--
1.7.5.4
 

Thread Tools




All times are GMT. The time now is 01:29 AM.

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