mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
testsuite: adapt 'uname release' test for Ubuntu
This commit is contained in:
@@ -87,9 +87,18 @@ if { ![file executable $domainname] } {
|
||||
if { [info exists uname] } {
|
||||
set u_sysname [exec $uname -s]
|
||||
set u_nodename [exec $uname -n]
|
||||
set u_release [exec $uname -r]
|
||||
set u_version [exec $uname -v]
|
||||
set u_machine [exec $uname -m]
|
||||
|
||||
# on ubuntu get the CODENAME of the Distribution
|
||||
if {[file isfile /etc/lsb-release]} {
|
||||
set fd [open "/etc/lsb-release" "r"]
|
||||
set a [read $fd]
|
||||
regexp -nocase {DISTRIB_CODENAME=(\S+)(.*)}\
|
||||
$a matched u_release end
|
||||
} else {
|
||||
set u_release [exec $uname -r]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -129,3 +138,9 @@ if { [info exist uname] } {
|
||||
if { [info exist domainname] } {
|
||||
unset domainname
|
||||
}
|
||||
if { [info exist fd] } {
|
||||
unset fd
|
||||
}
|
||||
if { [info exist a] } {
|
||||
unset a
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user