Skip to content

Commit 2dde3d0

Browse files
committed
[cmake,test] Get rid of lsb_release:
It is available less and less often, and we do not actually benefit a lot from printing the distro (stress) or we can get the same info from /etc/os-release (cmake).
1 parent b3bd014 commit 2dde3d0

14 files changed

+9
-54
lines changed

cmake/modules/RootCPack.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,15 @@ elseif(WIN32)
107107
set(OS_NAME_VERSION win32)
108108
endif()
109109
else()
110-
execute_process(COMMAND lsb_release -is OUTPUT_VARIABLE osid OUTPUT_STRIP_TRAILING_WHITESPACE)
111-
execute_process(COMMAND lsb_release -rs OUTPUT_VARIABLE osvers OUTPUT_STRIP_TRAILING_WHITESPACE)
110+
if(EXISTS "/etc/os-release")
111+
file(STRINGS /etc/os-release osid REGEX "^NAME=")
112+
string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" osid "${osid}")
113+
file(STRINGS /etc/os-release osvers REGEX "^VERSION_ID=")
114+
string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" osvers "${osvers}")
115+
else()
116+
execute_process(COMMAND lsb_release -is OUTPUT_VARIABLE osid OUTPUT_STRIP_TRAILING_WHITESPACE)
117+
execute_process(COMMAND lsb_release -rs OUTPUT_VARIABLE osvers OUTPUT_STRIP_TRAILING_WHITESPACE)
118+
endif()
112119
if(osid MATCHES Ubuntu)
113120
string(REGEX REPLACE "([0-9]+)[.].*" "\\1" osvers "${osvers}")
114121
set(OS_NAME_VERSION Linux-ubuntu${osvers}-${arch})

math/mathcore/test/stressGoFTest.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ struct GoFTStress {
5656
TString sp = gSystem->GetFromPipe("uname -a");
5757
sp.Resize(60);
5858
printf("* SYS: %s\n",sp.Data());
59-
if (strstr(gSystem->GetBuildNode(),"Linux")) {
60-
sp = gSystem->GetFromPipe("lsb_release -d -s");
61-
printf("* SYS: %s\n",sp.Data());
62-
}
6359
if (strstr(gSystem->GetBuildNode(),"Darwin")) {
6460
sp = gSystem->GetFromPipe("sw_vers -productVersion");
6561
sp += " Mac OS X ";

test/bench.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,6 @@ int main(int argc, char **argv)
295295
TString sp = gSystem->GetFromPipe("uname -a");
296296
sp.Resize(60);
297297
printf("* SYS: %s\n",sp.Data());
298-
if (strstr(gSystem->GetBuildNode(),"Linux")) {
299-
sp = gSystem->GetFromPipe("lsb_release -d -s");
300-
printf("* SYS: %s\n",sp.Data());
301-
}
302298
if (strstr(gSystem->GetBuildNode(),"Darwin")) {
303299
sp = gSystem->GetFromPipe("sw_vers -productVersion");
304300
sp += " Mac OS X ";

test/stress.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@ void stress(Int_t nevent, Int_t style = 1,
200200
TString sp = gSystem->GetFromPipe("uname -a");
201201
sp.Resize(60);
202202
printf("* SYS: %s\n",sp.Data());
203-
if (strstr(gSystem->GetBuildNode(),"Linux")) {
204-
sp = gSystem->GetFromPipe("lsb_release -d -s");
205-
printf("* SYS: %s\n",sp.Data());
206-
}
207203
if (strstr(gSystem->GetBuildNode(),"Darwin")) {
208204
sp = gSystem->GetFromPipe("sw_vers -productVersion");
209205
sp += " Mac OS X ";

test/stressFit.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,10 +646,6 @@ Int_t stressFit(const char *type, const char *algo, Int_t N)
646646
TString sp = gSystem->GetFromPipe("uname -a");
647647
sp.Resize(60);
648648
printf("* SYS: %s\n",sp.Data());
649-
if (strstr(gSystem->GetBuildNode(),"Linux")) {
650-
sp = gSystem->GetFromPipe("lsb_release -d -s");
651-
printf("* SYS: %s\n",sp.Data());
652-
}
653649
if (strstr(gSystem->GetBuildNode(),"Darwin")) {
654650
sp = gSystem->GetFromPipe("sw_vers -productVersion");
655651
sp += " Mac OS X ";

test/stressGUI.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,6 @@ void stressGUI()
307307
TString sp = gSystem->GetFromPipe("uname -a");
308308
sp.Resize(60);
309309
printf("* SYS: %s\n",sp.Data());
310-
if (strstr(gSystem->GetBuildNode(),"Linux")) {
311-
sp = gSystem->GetFromPipe("lsb_release -d -s");
312-
printf("* SYS: %s\n",sp.Data());
313-
}
314310
if (strstr(gSystem->GetBuildNode(),"Darwin")) {
315311
sp = gSystem->GetFromPipe("sw_vers -productVersion");
316312
sp += " Mac OS X ";

test/stressGeometry.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,6 @@ void stressGeometry(const char *exp="*", Bool_t generate_ref=kFALSE, Bool_t vecg
295295
TString sp = gSystem->GetFromPipe("uname -a");
296296
sp.Resize(60);
297297
printf("* SYS: %s\n",sp.Data());
298-
if (strstr(gSystem->GetBuildNode(),"Linux")) {
299-
sp = gSystem->GetFromPipe("lsb_release -d -s");
300-
printf("* SYS: %s\n",sp.Data());
301-
}
302298
if (strstr(gSystem->GetBuildNode(),"Darwin")) {
303299
sp = gSystem->GetFromPipe("sw_vers -productVersion");
304300
sp += " Mac OS X ";

test/stressGraphics.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,6 @@ void stressGraphics(Int_t verbose = 0)
419419
TString sp = gSystem->GetFromPipe("uname -a");
420420
sp.Resize(60);
421421
printf("* SYS: %s\n",sp.Data());
422-
if (strstr(gSystem->GetBuildNode(),"Linux")) {
423-
sp = gSystem->GetFromPipe("lsb_release -d -s");
424-
printf("* SYS: %s\n",sp.Data());
425-
}
426422
if (strstr(gSystem->GetBuildNode(),"Darwin")) {
427423
sp = gSystem->GetFromPipe("sw_vers -productVersion");
428424
sp += " Mac OS X ";

test/stressHepix.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ int main(int argc, char **argv)
143143
TString sp = gSystem->GetFromPipe("uname -a");
144144
sp.Resize(60);
145145
printf("* SYS: %s\n",sp.Data());
146-
if (strstr(gSystem->GetBuildNode(),"Linux")) {
147-
sp = gSystem->GetFromPipe("lsb_release -d -s");
148-
printf("* SYS: %s\n",sp.Data());
149-
}
150146
if (strstr(gSystem->GetBuildNode(),"Darwin")) {
151147
sp = gSystem->GetFromPipe("sw_vers -productVersion");
152148
sp += " Mac OS X ";

test/stressHistFactory.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ Int_t stressHistFactory(const char* refFile, Bool_t writeRef, Int_t verbose, Boo
139139
if (UNIX) {
140140
TString sp = gSystem->GetFromPipe("uname -a");
141141
cout << "* SYS: " << sp << endl;
142-
if (strstr(gSystem->GetBuildNode(), "Linux")) {
143-
sp = gSystem->GetFromPipe("lsb_release -d -s");
144-
cout << "* SYS: " << sp << endl;
145-
}
146142
if (strstr(gSystem->GetBuildNode(), "Darwin")) {
147143
sp = gSystem->GetFromPipe("sw_vers -productVersion");
148144
sp += " Mac OS X ";

0 commit comments

Comments
 (0)