New version, new tarball. For some weird reason rpm query didn't work with gawk all

on one line, moved to separate lines. Who knows why? This only impacts rpm distros.
This commit is contained in:
inxi-svn 2014-09-25 07:54:37 +00:00
parent 98de82a431
commit d6ff64d653
2 changed files with 44 additions and 22 deletions

53
inxi
View file

@ -3,7 +3,7 @@
# openbsd ftp does http
########################################################################
#### Script Name: inxi
#### Version: 2.2.11
#### Version: 2.2.12
#### Date: 2014-09-24
#### Patch Number: 00
########################################################################
@ -4819,15 +4819,24 @@ get_de_gtk_data()
# Name : libgtk-3-0
# Version : 3.12.2
elif type -p rpm &>/dev/null;then
toolkit=$( rpm -qi libgtk-3-0 2>/dev/null | gawk -F ':' '/^[[:space:]]*Version/
{ gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2); print $2 }' )
toolkit=$( rpm -qi libgtk-3-0 2>/dev/null | gawk -F ':' '
/^[[:space:]]*Version/ {
gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2)
print $2
}' )
if [[ -z $toolkit ]];then
toolkit=$( rpm -qi libgtk-4-0 2>/dev/null | gawk -F ':' '/^[[:space:]]*Version/
{gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2);print $2}' )
toolkit=$( rpm -qi libgtk-4-0 2>/dev/null | gawk -F ':' '
/^[[:space:]]*Version/ {
gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2)
print $2
}' )
fi
if [[ -z $toolkit ]];then
toolkit=$( rpm -qi libgtk-2-0 2>/dev/null | gawk -F ':' '/^[[:space:]]*Version/
{gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2);print $2}' )
toolkit=$( rpm -qi libgtk-2-0 2>/dev/null | gawk -F ':' '
/^[[:space:]]*Version/ {
gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2)
print $2
}' )
fi
fi
fi
@ -9279,7 +9288,7 @@ get_repo_data()
do
repo_data_working="$( gawk -v repoFile="$repo_file" '
!/^[[:space:]]*$|^[[:space:]]*#/ {
print "apt sources:" repoFile ":" $0
print "apt sources^" repoFile "^" $0
}' $repo_file )"
if [[ -n $repo_data_working ]];then
if [[ -z $REPO_DATA ]];then
@ -9302,11 +9311,11 @@ get_repo_data()
# older redhats put their yum data in /etc/yum.conf
repo_files=$( ls $yum_repo_dir*.repo $yum_conf 2>/dev/null )
repo_name='yum'
log_function_data "yum repo filess: $repo_files"
log_function_data "yum repo files: $repo_files"
elif [[ -d $zypp_repo_dir ]];then
repo_files=$( ls $zypp_repo_dir*.repo 2>/dev/null )
repo_name='zypp'
log_function_data "zypp repo filess: $repo_files"
log_function_data "zypp repo files: $repo_files"
fi
log_function_data 'cat' "$repo_files"
if [[ -n $repo_files ]];then
@ -9315,7 +9324,7 @@ get_repo_data()
repo_data_working="$( gawk -v repoFile=$repo_file '
# construct the string for the print function to work with, file name: data
function print_line( fileName, repoId, repoUrl ){
print "'$repo_name' sources:" fileName ":" repoId repoUrl
print "'$repo_name' sources^" fileName "^" repoId repoUrl
}
BEGIN {
FS="\n"
@ -9406,7 +9415,7 @@ $repo_data_working"
}
/^[[:space:]]*Server/ {
sub(/^[[:space:]]+|[[:space:]]+$/,"",$2)
print "pacman repo servers:" repoFile ":" $2 "\\n"
print "pacman repo servers^" repoFile "^" $2 "\\n"
}
' $repo_file )"
else
@ -9423,7 +9432,7 @@ $repo_data_working"
do
repo_data_working="$( gawk -v repoFile="$repo_file" '
!/^[[:space:]]*$|^[[:space:]]*#/ {
print "slackpkg sources:" repoFile ":" $0
print "slackpkg sources^" repoFile "^" $0
}' $repo_file )"
if [[ -n $repo_data_working ]];then
if [[ -z $REPO_DATA ]];then
@ -9458,9 +9467,9 @@ $repo_data_working"
print $0
}' <<< $repo_line )
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
repo_data_working="${repo_data_working}pisi repo:$repo_line"
repo_data_working="${repo_data_working}pisi repo^$repo_line"
fi
done <<< "$REPO_DATA"
# echo and execute the line breaks inserted
@ -9497,7 +9506,7 @@ $repo_data_working"
repo_data_working2=$( grep -Eo '([^[:space:]]+://|[[:space:]]/).*' <<< $repo_line )
# then get the repo name string by slicing out the url string
repo_name=$( sed "s|[[:space:]]*$repo_data_working2||" <<< $repo_line )
repo_data_working="${repo_data_working}urpmq repo:$repo_name:$repo_data_working2\n"
repo_data_working="${repo_data_working}urpmq repo^$repo_name^$repo_data_working2\n"
fi
done <<< "$REPO_DATA"
# echo and execute the line breaks inserted
@ -9509,7 +9518,7 @@ $repo_data_working"
IGNORECASE=1
}
/^SERVERNAME/ {
print "BSD ports servers:" repoFile ":" $2
print "BSD ports servers^" repoFile "^" $2
}
' $freebsd_conf )"
fi
@ -9542,7 +9551,7 @@ $repo_data_working"
}
if ( $1 == "enabled" ) {
if ( $2 == "yes" ) {
print "BSD ports server:" repoFile ":" repoName " " repoUrl
print "BSD ports server^" repoFile "^" repoName " " repoUrl
}
}
}
@ -9563,7 +9572,7 @@ $repo_data_working"
IGNORECASE=1
}
/^installpath/ {
print "BSD ports servers:" repoFile ":" $2
print "BSD ports servers^" repoFile "^" $2
}
' $openbsd_conf )"
fi
@ -13333,9 +13342,9 @@ print_repo_data()
while read repo_line
do
(( repo_count++ ))
repo_type=$( cut -d ':' -f 1 <<< $repo_line )
file_name=$( cut -d ':' -f 2 <<< $repo_line )
file_content=$( cut -d ':' -f 3-7 <<< $repo_line )
repo_type=$( cut -d '^' -f 1 <<< $repo_line )
file_name=$( cut -d '^' -f 2 <<< $repo_line )
file_content=$( cut -d '^' -f 3-7 <<< $repo_line )
# this will dump unwanted white space line starters. Some irc channels
# use bots that show page title for urls, so need to break the url by adding
# a white space.

View file

@ -1,3 +1,16 @@
=====================================================================================
Version: 2.2.12
Patch Version: 00
Script Date: 2014-09-24
-----------------------------------
Changes:
-----------------------------------
New version, new tarball. For some weird reason rpm query didn't work with gawk all
on one line, moved to separate lines. Who knows why? This only impacts rpm distros.
-----------------------------------
-- Harald Hope - Thu, 25 Sep 2014 00:19:06 -0700
=====================================================================================
Version: 2.2.11
Patch Version: 00