mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 17:07:49 +00:00
code tweak for yum
This commit is contained in:
parent
7332f3b6de
commit
d3bc0d6fcb
6
inxi
6
inxi
|
@ -3097,14 +3097,14 @@ get_partition_data_advanced()
|
||||||
get_repo_data()
|
get_repo_data()
|
||||||
{
|
{
|
||||||
local repo_file='' repo_data_working=''
|
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
|
if [[ -f $apt_file || -d $apt_file.d ]];then
|
||||||
REPO_DATA="$( grep -Esv '(^[[:space:]]*$|^[[:space:]]*#)' $apt_file $apt_file.d/*.list )"
|
REPO_DATA="$( grep -Esv '(^[[:space:]]*$|^[[:space:]]*#)' $apt_file $apt_file.d/*.list )"
|
||||||
REPO_FILE_ID='apt sources'
|
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
|
# 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
|
do
|
||||||
repo_data_working="$( gawk -v repoFile=$repo_file '
|
repo_data_working="$( gawk -v repoFile=$repo_file '
|
||||||
# construct the string for the print function to work with, file name: data
|
# construct the string for the print function to work with, file name: data
|
||||||
|
|
Loading…
Reference in a new issue