diff options
Diffstat (limited to 'testsuite/lib')
-rw-r--r-- | testsuite/lib/systemtap.exp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index c80ad171..554e88ed 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -148,13 +148,18 @@ proc get_system_info {} { set Snapshot [exec /bin/cat $env(SRCDIR)/../SNAPSHOT] } else { regexp {version [^)]*} [exec stap -V 2>@ stdout] version - set Snapshot $version + set Snapshot $version } set Distro "Linux" - if [file exists /etc/fedora-release] {set Distro [exec /bin/cat /etc/fedora-release]} - if [file exists /etc/redhat-release] {set Distro [exec /bin/cat /etc/redhat-release]} - if [file exists /etc/suse-release] {set Distro [exec /bin/cat /etc/suse-release]} - if [file exists /etc/debian_version] {set Distro [exec /bin/cat /etc/debian_version]} + if [file exists /usr/bin/lsb_release] { + # this produces one line of this format: + # Distribution:\tSTRING + set Distro [lrange [exec /usr/bin/lsb_release -d] 1 end] + } else { + foreach f {/etc/fedora-release /etc/enterprise-release /etc/redhat-release /etc/suse-release /etc/debian_version} { + if [file exists $f] then {set Distro [exec /bin/cat $f]; break } + } + } } if {! [setup_systemtap_environment]} then { |