diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-04-01 23:04:29 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-04-01 23:04:29 +0200 |
commit | 2c246d55893998d60461671767c5f9c05f70c6b7 (patch) | |
tree | 04e20f69c813c67534d8a3bd9cd0d4cad84a3544 /testsuite/lib | |
parent | dd1636396623adacdb9e6502adabd9195ae7ef33 (diff) | |
parent | 952ce18c9672046c052fc77d5da8f98e8ae75735 (diff) | |
download | systemtap-steved-2c246d55893998d60461671767c5f9c05f70c6b7.tar.gz systemtap-steved-2c246d55893998d60461671767c5f9c05f70c6b7.tar.xz systemtap-steved-2c246d55893998d60461671767c5f9c05f70c6b7.zip |
Merge branch 'master' into pr6866
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 { |