added arch support for -r option

This commit is contained in:
inxi-svn 2010-02-01 05:51:09 +00:00
parent e253aa3028
commit 5264341430

21
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.3.5 #### version: 1.3.6
#### Date: January 31 2010 #### Date: January 31 2010
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -3162,10 +3162,10 @@ get_partition_data_advanced()
get_repo_data() get_repo_data()
{ {
eval $LOGFS eval $LOGFS
local repo_file='' repo_data_working='' local repo_file='' repo_data_working='' repo_data_working2=''
local apt_file='/etc/apt/sources.list' yum_repo_dir='/etc/yum.repos.d/' yum_conf='/etc/yum.conf' local apt_file='/etc/apt/sources.list' yum_repo_dir='/etc/yum.repos.d/' yum_conf='/etc/yum.conf'
local pacman_conf='/etc/pacman.conf' pacman_repo_dir='/etc/pacman.d/' pisi_dir='/etc/pisi/' local pacman_conf='/etc/pacman.conf' pacman_repo_dir='/etc/pacman.d/' pisi_dir='/etc/pisi/'
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'
@ -3259,13 +3259,22 @@ $repo_data_working"
REPO_DATA="$( echo -e $repo_data_working )" REPO_DATA="$( echo -e $repo_data_working )"
# note that pacman/arch mirrorlist file has all the mirrors on it, so it # note that pacman/arch mirrorlist file has all the mirrors on it, so it
# won't work for this feature, the output would be largely meaningless, and far too long # won't work for this feature, the output would be largely meaningless, and far too long
# elif [[ -f $pacman_file || -d $pacman_repo_dir ]];then elif [[ -f $pacman_conf ]];then
# REPO_FILE_ID='arch repos' REPO_FILE_ID='arch repos'
# get list of mirror include files, trim white space off ends
repo_data_working="$( grep -Ei '^Include' $pacman_conf | grep -vi 'IncludePath' | cut -d '=' -f 2 | sed 's|^[[:space:]]$||g' )"
repo_data_working=$( sort -bu <<< "$repo_data_working" | uniq )
repo_data_working="$repo_data_working $pacman_conf"
for repo_file in $repo_data_working
do
# inserting a new line after each found / processed match
repo_data_working2="$repo_data_working2$( grep -i '^Server' $repo_file | cut -d '=' -f 2 | sed 's|^[[:space:]]$||g' | sed -r 's|(.*)|'$repo_file':\1\\n|' )"
done
REPO_DATA="$( echo -e $repo_data_working2 )"
fi fi
eval $LOGFE eval $LOGFE
} }
get_runlevel_data() get_runlevel_data()
{ {
eval $LOGFS eval $LOGFS