diff --git a/inxi b/inxi index c2798d8..e6c2e67 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.3.5 +#### version: 1.3.6 #### Date: January 31 2010 ######################################################################## #### SPECIAL THANKS @@ -3162,10 +3162,10 @@ get_partition_data_advanced() get_repo_data() { 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 pacman_conf='/etc/pacman.conf' pacman_repo_dir='/etc/pacman.d/' pisi_dir='/etc/pisi/' - + 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' @@ -3259,13 +3259,22 @@ $repo_data_working" REPO_DATA="$( echo -e $repo_data_working )" # 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 -# elif [[ -f $pacman_file || -d $pacman_repo_dir ]];then -# REPO_FILE_ID='arch repos' + elif [[ -f $pacman_conf ]];then + 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 eval $LOGFE } - get_runlevel_data() { eval $LOGFS