From aaaff711aa704463c2788dfb02bb16fa3afe1d11 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 5 Feb 2009 01:12:27 +0000 Subject: [PATCH] final draft, should be good to go now --- inxi | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/inxi b/inxi index 1c19ab6..2485151 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.9.10-b1-t6 +#### version: 0.10.0-b1-t6 #### Date: 4 February 2009 ######################################################################## #### SPECIAL THANKS @@ -2400,18 +2400,24 @@ get_partition_data_advanced() } # handle Arch /dev/root for / id -# partition="root" if ( partition == "root" ) { + # if this works, great, otherwise, just set this to null values partTemp="'$( readlink /dev/root 2>/dev/null )'" -# partTemp="/dev/disk/by-uuid/7b67bf1e-626d-43d2-9885-1d1bbae26809" - if ( partTemp ~ /^[hs]d[a-z][0-9]+$/ ) { - partition=partTemp + if ( partTemp != "" ) { + if ( partTemp ~ /^[hs]d[a-z][0-9]+$/ ) { + partition=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, partTemp ) + } + else if ( partTemp ~ /by-uuid\/[a-z0-9]+-[a-z0-9]+-[a-z0-9]+/ ) { + uuid=gensub( /^(\/dev\/disk\/by-uuid\/)(.+)$/, "\\2", 1, partTemp ) + } + else if ( partTemp ~ /by-label/ ) { + label=gensub( /^(\/dev\/disk\/by-label\/)(.+)$/, "\\2", 1, partTemp ) + } } - else if ( partTemp ~ /by-uuid\/[a-z0-9]+-[a-z0-9]+-[a-z0-9]+/ ) { - uuid=gensub( /^(\/dev\/disk\/by-uuid\/)(.+)$/, "\\2", 1, partTemp ) - } - else if ( partTemp ~ /by-label/ ) { - label=gensub( /^(\/dev\/disk\/by-label\/)(.+)$/, "\\2", 1, partTemp ) + else { + partition = "" + label = "" + uuid = "" } } print partition "," label "," uuid