mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
more refactoring, cleanup
This commit is contained in:
parent
27de71c99f
commit
186f1ced0b
21
inxi
21
inxi
|
@ -270,6 +270,8 @@ sanitize_characters()
|
|||
# Determine if any of the absolutely necessary tools are absent
|
||||
check_script_depends()
|
||||
{
|
||||
local app_name=''
|
||||
|
||||
if [ ! -d /proc/ ]
|
||||
then
|
||||
error_handler 6
|
||||
|
@ -277,16 +279,16 @@ check_script_depends()
|
|||
|
||||
if ((X))
|
||||
then
|
||||
for I in xrandr xdpyinfo glxinfo
|
||||
for app_name in xrandr xdpyinfo glxinfo
|
||||
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
|
||||
fi
|
||||
|
||||
app_name=''
|
||||
# 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
|
||||
type -p $I >/dev/null || error_handler 5 "$I"
|
||||
type -p $app_name >/dev/null || error_handler 5 "$app_name"
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -609,8 +611,8 @@ set_calculated_variables()
|
|||
X=1
|
||||
fi
|
||||
|
||||
# Fallback paths put into $EXTRA_PATH; This might, among others, help on gentoo.
|
||||
# Now, create a difference of $PATH and $EXTRA_PATH and add that to $PATH:
|
||||
# Fallback paths put into $extra_paths; This might, among others, help on gentoo.
|
||||
# Now, create a difference of $PATH and $extra_paths and add that to $PATH:
|
||||
IFS=":"
|
||||
for path in $extra_paths
|
||||
do
|
||||
|
@ -679,7 +681,10 @@ get_distro_data()
|
|||
else
|
||||
# Debian pure should fall through here
|
||||
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
|
||||
((${#DISTRO} > 80 && ! CRAP)) && DISTRO="${RED}/etc/${DISTRO_FILE} corrupted, use --crap to override${NORMAL}"
|
||||
: ${DISTRO:=Unknown distro o_O}
|
||||
|
|
Loading…
Reference in a new issue