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