From 43fd70ca9022aa075f7885b84d1ede3f59b3dc99 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 28 Feb 2013 06:12:04 +0000 Subject: [PATCH] New version, updated man page. A bug fix for an old time bug: with mdraid, -o (unmounted partitions) would show components of the md raid array as unmounted partitions. This is of course incorrect, and is now fixed. Small update of man page as well to note that -o will not show components of mdraid arrays. --- inxi | 35 +++++++++++++++++++++++++++-------- inxi.1 | 2 ++ inxi.changelog | 17 +++++++++++++++++ 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/inxi b/inxi index 80cd443..d2e7eb1 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/usr/bin/env bash ######################################################################## #### Script Name: inxi -#### Version: 1.8.40 +#### Version: 1.8.41 #### Date: February 27 2013 #### Patch Number: 00 ######################################################################## @@ -270,6 +270,7 @@ B_PCICONF='false' # kde qdbus B_QDBUS='false' B_PORTABLE='false' +B_RAID_SET='false' B_ROOT='false' B_RUN_COLOR_SELECTOR='false' # Running in a shell? Defaults to false, and is determined later. @@ -6769,7 +6770,7 @@ get_raid_data() get_raid_data_bsd fi fi - + B_RAID_SET='true' temp_array=${A_RAID_DATA[@]} log_function_data "A_RAID_DATA: $temp_array" # echo -e "A_RAID_DATA:\n${temp_array}" @@ -7534,14 +7535,19 @@ get_tty_number() get_unmounted_partition_data() { eval $LOGFS - local a_unmounted_working='' mounted_partitions='' separator='' unmounted_fs='' - local dev_working='' uuid_working='' label_working='' + local a_unmounted_working='' mounted_partitions='' separator='|' unmounted_fs='' + local dev_working='' uuid_working='' label_working='' a_raid_working='' raid_partitions='' if [[ $B_PARTITIONS_FILE == 'true' ]];then # set dev disk label/uuid data globals get_partition_dev_data 'label' get_partition_dev_data 'uuid' - + # load the raid data array here so we can exclude its partitions + if [[ $B_RAID_SET != 'true' ]];then + get_raid_data + fi + # sr0 type cd drives are showing up now as unmounted partitions + mounted_partitions="sr[0-9]|cdrom[0-9]*|dvd[0-9]*" # create list for slicing out the mounted partitions for (( i=0; i < ${#A_PARTITION_DATA[@]}; i++ )) do @@ -7550,11 +7556,22 @@ get_unmounted_partition_data() IFS="$ORIGINAL_IFS" if [[ -n ${a_unmounted_working[6]} ]];then mounted_partitions="$mounted_partitions$separator${a_unmounted_working[6]}" - separator='|' + fi + done + # now we need to exclude the mdraid partitions from the unmounted partition output as well + for (( i=0; i < ${#A_RAID_DATA[@]}; i++ )) + do + IFS="," + a_raid_working=( ${A_RAID_DATA[i]} ) + IFS="$ORIGINAL_IFS" + if [[ -n ${a_raid_working[3]} ]];then + raid_partitions=$( sed $SED_RX 's/(\([^\)]*\)|\[[^\]]*\])//g' <<< ${a_raid_working[3]}\ + | sed 's/[[:space:]]\+/|/g' ) + mounted_partitions="$mounted_partitions$separator$raid_partitions" fi done - A_UNMOUNTED_PARTITION_DATA=( $( grep -Ev '('$mounted_partitions')$' $FILE_PARTITIONS | gawk ' + A_UNMOUNTED_PARTITION_DATA=( $( grep -Ev '[[:space:]]('$mounted_partitions')$' $FILE_PARTITIONS | gawk ' BEGIN { IGNORECASE=1 } @@ -9377,7 +9394,9 @@ print_raid_data() if [[ $BSD_TYPE == 'bsd' ]];then dev_string='' fi - get_raid_data + if [[ $B_RAID_SET != 'true' ]];then + get_raid_data + fi for (( i=0; i < ${#A_RAID_DATA[@]}; i++ )) do diff --git a/inxi.1 b/inxi.1 index be61dfc..ed145d8 100755 --- a/inxi.1 +++ b/inxi.1 @@ -145,6 +145,8 @@ Shows file system type if you have file installed, if you are root OR if you hav added to /etc/sudoers (sudo v. 1.7 or newer): .B ALL = NOPASSWD: /usr/bin/file (sample) + +Does not show components (partitions that create the md raid array) of md-raid arrays. .TP .B -p Show full partition information (\fB-P\fR plus all other detected partitions). diff --git a/inxi.changelog b/inxi.changelog index 68db763..9ed1781 100755 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,20 @@ +===================================================================================== +Version: 1.8.41 +Patch Version: 00 +Script Date: February 27 2013 +----------------------------------- +Changes: +----------------------------------- +New version, updated man page. A bug fix for an old time bug: with mdraid, -o (unmounted +partitions) would show components of the md raid array as unmounted partitions. + +This is of course incorrect, and is now fixed. + +Small update of man page as well to note that -o will not show components of mdraid arrays. + +----------------------------------- +-- Harald Hope - Wed, 27 Feb 2013 22:09:32 -0800 + ===================================================================================== Version: 1.8.40 Patch Version: 00