mirror of
https://github.com/smxi/inxi.git
synced 2025-09-01 01:59:09 +00:00
more refactoring, cleanup
This commit is contained in:
parent
27de71c99f
commit
186f1ced0b
1 changed files with 13 additions and 8 deletions
21
inxi
21
inxi
|
@ -270,6 +270,8 @@ sanitize_characters()
|
||||||
# Determine if any of the absolutely necessary tools are absent
|
# Determine if any of the absolutely necessary tools are absent
|
||||||
check_script_depends()
|
check_script_depends()
|
||||||
{
|
{
|
||||||
|
local app_name=''
|
||||||
|
|
||||||
if [ ! -d /proc/ ]
|
if [ ! -d /proc/ ]
|
||||||
then
|
then
|
||||||
error_handler 6
|
error_handler 6
|
||||||
|
@ -277,16 +279,16 @@ check_script_depends()
|
||||||
|
|
||||||
if ((X))
|
if ((X))
|
||||||
then
|
then
|
||||||
for I in xrandr xdpyinfo glxinfo
|
for app_name in xrandr xdpyinfo glxinfo
|
||||||
do
|
do
|
||||||
type -p $I >/dev/null || { script_debugger "inxi: Resuming in non X mode: $I not found in path"; X=0; break; }
|
type -p $app_name >/dev/null || { script_debugger "inxi: Resuming in non X mode: $app_name not found in path"; X=0; break; }
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
app_name=''
|
||||||
# bc removed from deps for now
|
# bc removed from deps for now
|
||||||
for I in df free gawk grep hostname lspci ps readlink runlevel tr uname uptime wc
|
for app_name in df free gawk grep hostname lspci ps readlink runlevel tr uname uptime wc
|
||||||
do
|
do
|
||||||
type -p $I >/dev/null || error_handler 5 "$I"
|
type -p $app_name >/dev/null || error_handler 5 "$app_name"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -609,8 +611,8 @@ set_calculated_variables()
|
||||||
X=1
|
X=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fallback paths put into $EXTRA_PATH; This might, among others, help on gentoo.
|
# Fallback paths put into $extra_paths; This might, among others, help on gentoo.
|
||||||
# Now, create a difference of $PATH and $EXTRA_PATH and add that to $PATH:
|
# Now, create a difference of $PATH and $extra_paths and add that to $PATH:
|
||||||
IFS=":"
|
IFS=":"
|
||||||
for path in $extra_paths
|
for path in $extra_paths
|
||||||
do
|
do
|
||||||
|
@ -679,7 +681,10 @@ get_distro_data()
|
||||||
else
|
else
|
||||||
# Debian pure should fall through here
|
# Debian pure should fall through here
|
||||||
DISTRO_FILE="issue"
|
DISTRO_FILE="issue"
|
||||||
DISTRO=$( gawk 'BEGIN { RS="" } { gsub(/\\[a-z]/,""); gsub(/ [ ]+/," "); gsub(/^ +| +$/,""); print }' "/etc/${DISTRO_FILE}" )
|
DISTRO=$( gawk 'BEGIN { RS="" } { gsub(/\\[a-z]/,"");
|
||||||
|
gsub(/ [ ]+/," ");
|
||||||
|
gsub(/^ +| +$/,"");
|
||||||
|
print }' "/etc/${DISTRO_FILE}" )
|
||||||
fi
|
fi
|
||||||
((${#DISTRO} > 80 && ! CRAP)) && DISTRO="${RED}/etc/${DISTRO_FILE} corrupted, use --crap to override${NORMAL}"
|
((${#DISTRO} > 80 && ! CRAP)) && DISTRO="${RED}/etc/${DISTRO_FILE} corrupted, use --crap to override${NORMAL}"
|
||||||
: ${DISTRO:=Unknown distro o_O}
|
: ${DISTRO:=Unknown distro o_O}
|
||||||
|
|
Loading…
Add table
Reference in a new issue