svn ci error, change version, line wrapping for hard disk output, bug fixes in print out sections.

This commit is contained in:
inxi-svn 2009-08-07 00:04:04 +00:00
parent 69b0694e91
commit d57cbf4b1e

55
inxi
View file

@ -1,8 +1,13 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
<<<<<<< .mine
#### version: 1.1.12
#### Date: August 6 2009
=======
#### version: 1.1.12 #### version: 1.1.12
#### Date: August 4 2009 #### Date: August 4 2009
>>>>>>> .r685
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -3931,8 +3936,8 @@ print_gfx_data()
print_hard_disk_data() print_hard_disk_data()
{ {
eval $LOGFS eval $LOGFS
local hdd_data='' hdd_data_2='' a_hdd_working='' hdd_temp_data='' local hdd_data='' hdd_data_2='' a_hdd_working='' hdd_temp_data='' hdd_string=''
local dev_data='' size_data='' hdd_model='' hdd_model_2='' hdd_model_3='' usb_data='' local dev_data='' size_data='' hdd_model='' usb_data='' hdd_name=''
# load A_HDD_DATA # load A_HDD_DATA
get_hdd_data_basic get_hdd_data_basic
@ -3962,6 +3967,7 @@ print_hard_disk_data()
fi fi
dev_data="/dev/${a_hdd_working[0]} " dev_data="/dev/${a_hdd_working[0]} "
size_data=" ${a_hdd_working[1]}" size_data=" ${a_hdd_working[1]}"
hdd_name="${a_hdd_working[2]}"
fi fi
if [[ $B_EXTRA_DATA == 'true' && -n $dev_data ]];then if [[ $B_EXTRA_DATA == 'true' && -n $dev_data ]];then
@ -3969,31 +3975,42 @@ print_hard_disk_data()
# error handling is done in get data function # error handling is done in get data function
if [[ -n $hdd_temp_data ]];then if [[ -n $hdd_temp_data ]];then
hdd_temp_data=" ${hdd_temp_data}C" hdd_temp_data=" ${hdd_temp_data}C"
else
hdd_temp_data=''
fi fi
fi fi
# wrap to avoid long lines
if [[ $i -gt 1 && $B_SHOW_DISK == 'true' ]] || [[ $i -gt 3 ]];then if [[ $B_SHOW_DISK == 'true' ]];then
hdd_model_2="${hdd_model_2}${hdd_model_2+${C1}$(($i+1)):${C2}} $usb_data$dev_data${a_hdd_working[2]}$size_data$hdd_temp_data " hdd_string="$usb_data$dev_data$hdd_name$size_data$hdd_temp_data"
else hdd_model="${hdd_model}${C1}$(($i+1)):${C2} $hdd_string "
hdd_model="${hdd_model}${hdd_model+ ${C1}$(($i+1)):${C2}} $usb_data$dev_data${a_hdd_working[2]}$size_data$hdd_temp_data" # printing line one, then every other line, and after, if leftovers, print that line.
case $i in
0)
hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2} ${C1}Total Size:${C2} ${hdd_capacity} (${hdd_used}) ${hdd_model}" )
print_screen_output "$hdd_data"
hdd_model=''
;;
*)
# using modulus here, if divisible by 2, print line, otherwise skip
if [[ $(( $i % 2 )) -eq 0 ]];then
hdd_data=$( create_print_line " " "${hdd_model}${CN}" )
print_screen_output "$hdd_data"
hdd_model=''
fi
;;
esac
fi fi
done done
if [[ -z $hdd_model ]];then # then print any leftover items
hdd_model=' None Detected' if [[ -n $hdd_model ]];then
fi hdd_data=$( create_print_line " " "${hdd_model}${CN}" )
if [[ -n $hdd_model_2 ]];then print_screen_output "$hdd_data"
hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2} ${C1}Total Size:${C2} ${hdd_capacity} (${hdd_used})${hdd_model}" )
hdd_data_2=$( create_print_line " " "${hdd_model_2}${CN}" )
else
hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2} ${C1}Total Size:${C2} ${hdd_capacity} (${hdd_used})${hdd_model}${CN}" )
fi fi
else else
hdd_data=$( create_print_line "Disks:" "${C1}HDD Total Size:${C2} ${hdd_capacity} (${hdd_used})${CN}" ) hdd_data=$( create_print_line "Disks:" "${C1}HDD Total Size:${C2} ${hdd_capacity} (${hdd_used})${CN}" )
print_screen_output "$hdd_data"
fi fi
print_screen_output "$hdd_data"
if [[ -n $hdd_model_2 ]];then
print_screen_output "$hdd_data_2"
fi
eval $LOGFE eval $LOGFE
} }