From d51de9267c8d0b766cc21c7791339c2b03906f4a Mon Sep 17 00:00:00 2001 From: slakmagik Date: Thu, 2 Dec 2010 00:49:34 +0000 Subject: [PATCH] addressed issue 50 (-o does nothing) Applied patch by Mauro which modified get_source_names() to only attempt to ls SRCNAME if SRCNAME is not empty so that it doesn't list the entire cache directory and break get_obsolete_sources(). This was triggered by django, whose DOWNLOAD was given as "http://www.djangoproject.com/download/1.2.3/tarball/" Signed-off-by: slakmagik --- src/usr/sbin/sbopkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 4343c8e..c1ef8b4 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -2752,7 +2752,7 @@ get_source_names() { # after, rather than grepping. And the conditionals ensure that we # only return PLACEHOLDER when we don't have any other results and # PLACEHOLDER is actually called for and set. - if ! ls -A $SRCDIR | grep "^${SRCNAME##*/}"; then + if [[ -z $SRCNAME ]] || ! ls -A $SRCDIR | grep "^${SRCNAME##*/}"; then if [[ $PLACEHOLDER ]]; then echo $PLACEHOLDER fi