From 1f06a5a6f5eaa59712f14d6fa041d351502abee6 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Wed, 24 Sep 2014 20:21:28 +0000 Subject: [PATCH] New version, new tarball. This fixes broken slackpkg handling in -r, and, using the same fix, fixes a single scenario with apt, where there is only sources.list, no .d/*.list files. I was assuming that the file name would print out in the output of single file grep, but that only happens with multiple files. --- inxi | 32 +++++++++++++++++++++++++++++--- inxi.changelog | 15 +++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index b9be81d..e2449d0 100755 --- a/inxi +++ b/inxi @@ -3,7 +3,7 @@ # openbsd ftp does http ######################################################################## #### Script Name: inxi -#### Version: 2.2.10 +#### Version: 2.2.11 #### Date: 2014-09-24 #### Patch Number: 00 ######################################################################## @@ -9272,7 +9272,20 @@ get_repo_data() # apt - debian, buntus, also sometimes some yum/rpm repos may create apt repos here as well if [[ -f $apt_file || -d $apt_file.d ]];then - REPO_DATA="$( grep -Esv '(^[[:space:]]*$|^[[:space:]]*#)' $apt_file $apt_file.d/*.list | sed $SED_RX 's/^(.*)/apt sources:\1/' )" + 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" + fi + done fi # yum - fedora, redhat, centos, etc. Note that rpmforge also may create apt sources # in /etc/apt/sources.list.d/. Therefore rather than trying to assume what package manager is @@ -9399,7 +9412,20 @@ $repo_data_working" REPO_DATA="$( echo -e $repo_data_working2 )" # pisi - pardus elif [[ -f $slackpkg_file ]];then - REPO_DATA="$( grep -Esv '(^[[:space:]]*$|^[[:space:]]*#)' $slackpkg_file | sed $SED_RX 's/^(.*)/slackpkg sources:\1/' )" + # note, only one file, but loop it in case more are added in future + for repo_file in $slackpkg_file + do + repo_data_working="$( gawk -v repoFile="$repo_file" ' + !/^[[: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" + fi + done elif [[ -d $pisi_dir && -n $( type -p pisi ) ]];then REPO_DATA="$( pisi list-repo )" log_function_data "pisi-list-repo: $REPO_DATA" diff --git a/inxi.changelog b/inxi.changelog index 97d7dfe..6692087 100755 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,18 @@ +===================================================================================== +Version: 2.2.11 +Patch Version: 00 +Script Date: 2014-09-24 +----------------------------------- +Changes: +----------------------------------- +New version, new tarball. This fixes broken slackpkg handling in -r, and, using the same fix, +fixes a single scenario with apt, where there is only sources.list, no .d/*.list files. +I was assuming that the file name would print out in the output of single file grep, +but that only happens with multiple files. + +----------------------------------- +-- Harald Hope - Wed, 24 Sep 2014 13:18:41 -0700 + ===================================================================================== Version: 2.2.10 Patch Version: 00