From 0c8f2108ddeeea89da5e8f1be0e43f0c6901dce8 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Wed, 24 Sep 2014 20:29:42 +0000 Subject: [PATCH] code cleanup, new tarball, added test to add repo line --- inxi | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/inxi b/inxi index e2449d0..a36ba98 100755 --- a/inxi +++ b/inxi @@ -9274,16 +9274,17 @@ get_repo_data() if [[ -f $apt_file || -d $apt_file.d ]];then for repo_file in $apt_file $( ls $apt_file.d/*.list 2>/dev/null) do - repo_data_working="$( gawk -v repoFile="$repo_file" ' !/^[[:space:]]*$|^[[:space:]]*#/ { print "apt sources:" repoFile ":" $0 }' $repo_file )" - if [[ -z $REPO_DATA ]];then - REPO_DATA="$repo_data_working" - else - REPO_DATA="$REPO_DATA - $repo_data_working" + if [[ -n $repo_data_working ]];then + if [[ -z $REPO_DATA ]];then + REPO_DATA="$repo_data_working" + else + REPO_DATA="$REPO_DATA + $repo_data_working" + fi fi done fi @@ -9419,11 +9420,13 @@ $repo_data_working" !/^[[:space:]]*$|^[[:space:]]*#/ { print "slackpkg sources:" repoFile ":" $0 }' $repo_file )" - if [[ -z $REPO_DATA ]];then - REPO_DATA="$repo_data_working" - else - REPO_DATA="$REPO_DATA - $repo_data_working" + if [[ -n $repo_data_working ]];then + if [[ -z $REPO_DATA ]];then + REPO_DATA="$repo_data_working" + else + REPO_DATA="$REPO_DATA + $repo_data_working" + fi fi done elif [[ -d $pisi_dir && -n $( type -p pisi ) ]];then