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.
This commit is contained in:
inxi-svn 2014-09-24 20:21:28 +00:00
parent 3b9fd904bc
commit 1f06a5a6f5
2 changed files with 44 additions and 3 deletions

32
inxi
View file

@ -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"

View file

@ -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