bug fix for pardus pisi line output, added file missing detection for arch repos

This commit is contained in:
inxi-svn 2010-02-01 18:02:37 +00:00
parent e4f8bacf31
commit e7e2a381a9

38
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.3.7 #### version: 1.3.8
#### Date: February 1 2010 #### Date: February 1 2010
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -3249,8 +3249,14 @@ $repo_data_working"
# putting it back into the <data>:<url> format print repos expects to see # putting it back into the <data>:<url> format print repos expects to see
while read repo_line while read repo_line
do do
# dump empty lines... repo_line=$( gawk '
repo_line=$( sed 's|^[[:space:]]$||g' <<< $repo_line ) {
# need to dump leading/trailing spaces and change [,] to (, ) for irc output
sub(/^[[:space:]]+|[[:space:]]+$/,"",$0)
gsub(/\[/,"(",$0)
gsub(/\]/,")",$0)
print $0
}' <<< $repo_line )
if [[ -n $( grep '://' <<< $repo_line ) ]];then if [[ -n $( grep '://' <<< $repo_line ) ]];then
repo_data_working="$repo_data_working:$repo_line\n" repo_data_working="$repo_data_working:$repo_line\n"
else else
@ -3278,17 +3284,21 @@ $repo_data_working"
repo_data_working="$repo_data_working $pacman_conf" repo_data_working="$repo_data_working $pacman_conf"
for repo_file in $repo_data_working for repo_file in $repo_data_working
do do
# inserting a new line after each found / processed match if [[ -f $repo_file ]];then
repo_data_working2="$repo_data_working2$( gawk -v repoFile=$repo_file ' # inserting a new line after each found / processed match
BEGIN { repo_data_working2="$repo_data_working2$( gawk -v repoFile=$repo_file '
FS="=" BEGIN {
IGNORECASE=1 FS="="
} IGNORECASE=1
/^[[:space:]]*Server/ { }
sub(/^[[:space:]]+|[[:space:]]+$/,"",$2) /^[[:space:]]*Server/ {
print repoFile ":" $2 "\\n" sub(/^[[:space:]]+|[[:space:]]+$/,"",$2)
} print repoFile ":" $2 "\\n"
' $repo_file )" }
' $repo_file )"
else
echo "Error: file listed in $pacman_conf does not exist - $repo_file"
fi
done done
# execute line breaks # execute line breaks
REPO_DATA="$( echo -e $repo_data_working2 )" REPO_DATA="$( echo -e $repo_data_working2 )"