code tweak for yum

This commit is contained in:
inxi-svn 2009-10-13 21:35:37 +00:00
parent 7332f3b6de
commit d3bc0d6fcb

6
inxi
View file

@ -3097,14 +3097,14 @@ get_partition_data_advanced()
get_repo_data()
{
local repo_file='' repo_data_working=''
local apt_file='/etc/apt/sources.list' yum_repo_dir='/etc/yum.repos.d/'
local apt_file='/etc/apt/sources.list' yum_repo_dir='/etc/yum.repos.d/' yum_conf='/etc/yum.conf'
if [[ -f $apt_file || -d $apt_file.d ]];then
REPO_DATA="$( grep -Esv '(^[[:space:]]*$|^[[:space:]]*#)' $apt_file $apt_file.d/*.list )"
REPO_FILE_ID='apt sources'
elif [[ -d $yum_repo_dir ]];then
elif [[ -d $yum_repo_dir || -f $yum_conf ]];then
# older redhats put their yum data in /etc/yum.conf
for repo_file in $( ls $yum_repo_dir*.repo /etc/yum.conf 2>/dev/null )
for repo_file in $( ls $yum_repo_dir*.repo $yum_conf 2>/dev/null )
do
repo_data_working="$( gawk -v repoFile=$repo_file '
# construct the string for the print function to work with, file name: data