mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
after getting user data, added pardus pisi repo listing support for the -r repo list option.
This method will probably work for arch too I'd guess if pacman lists repos in the same way
This commit is contained in:
parent
53bbf03cea
commit
e253aa3028
31
inxi
31
inxi
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.3.4
|
#### version: 1.3.5
|
||||||
#### Date: January 29 2010
|
#### Date: January 31 2010
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -3164,7 +3164,7 @@ get_repo_data()
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
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/' 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/'
|
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 )"
|
||||||
|
@ -3239,14 +3239,33 @@ $repo_data_working"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
REPO_FILE_ID='yum repos'
|
REPO_FILE_ID='yum repos'
|
||||||
|
elif [[ -d $pisi_dir && -n $( type -p pisi ) ]];then
|
||||||
|
REPO_DATA="$( pisi list-repo )"
|
||||||
|
REPO_FILE_ID='pisi repo'
|
||||||
|
# now we need to create the structure: repo info: repo path
|
||||||
|
# we do that by looping through the lines of the output and then
|
||||||
|
# putting it back into the <data>:<url> format print repos expects to see
|
||||||
|
while read line
|
||||||
|
do
|
||||||
|
# dump empty lines...
|
||||||
|
line=$( sed 's|^[[:space:]]$||g' <<< $line )
|
||||||
|
if [[ -n $( grep '://' <<< $line ) ]];then
|
||||||
|
repo_data_working="$repo_data_working:$line\n"
|
||||||
|
else
|
||||||
|
repo_data_working="$repo_data_working$line"
|
||||||
|
fi
|
||||||
|
done <<< "$REPO_DATA"
|
||||||
|
# echo and execute the line breaks inserted
|
||||||
|
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_file || -d $pacman_repo_dir ]];then
|
||||||
# REPO_FILE_ID='yum repos'
|
# REPO_FILE_ID='arch repos'
|
||||||
fi
|
fi
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
get_runlevel_data()
|
get_runlevel_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
|
@ -4609,7 +4628,11 @@ print_repo_data()
|
||||||
fi
|
fi
|
||||||
# check file name, if different, update the holder for print out
|
# check file name, if different, update the holder for print out
|
||||||
if [[ $file_name != $file_name_holder ]];then
|
if [[ $file_name != $file_name_holder ]];then
|
||||||
|
if [[ $REPO_FILE_ID != 'pisi repo' ]];then
|
||||||
repo_full="${C1}Active $REPO_FILE_ID in file:${C2} $file_name"
|
repo_full="${C1}Active $REPO_FILE_ID in file:${C2} $file_name"
|
||||||
|
else
|
||||||
|
repo_full="${C1}$REPO_FILE_ID:${C2} $file_name"
|
||||||
|
fi
|
||||||
file_name_holder=$file_name
|
file_name_holder=$file_name
|
||||||
b_print_next_line='true'
|
b_print_next_line='true'
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue