Skip to content

Commit 7e0e4e1

Browse files
committed
Add system info and ALIBUILD_WORK_DIR in the setup script
1 parent 05d2e0d commit 7e0e4e1

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

docs/troubleshooting/summarise_o2p_setup.sh

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
# Summarise O2Physics setup
44

5+
# System info
6+
7+
systemName=""
8+
user=""
9+
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
10+
systemName="$(lsb_release -ds)"
11+
user="$(whoami)"
12+
elif [[ "$OSTYPE" == "darwin"* ]]; then
13+
systemName="$(sw_vers -productName) $(sw_vers -productVersion)"
14+
user="$(whoami)"
15+
else
16+
echo "Unrecognised OS type: \"${OSTYPE}\""
17+
fi
18+
echo "OS: ${systemName}"
19+
echo "User: ${user}"
20+
21+
# aliBuild info
22+
523
if [[ -n "$(which aliBuild)" ]]; then
624
echo "aliBuild location: $(which aliBuild)"
725
# echo "all aliBuild locations: $(whereis aliBuild)"
@@ -10,19 +28,29 @@ else
1028
echo "aliBuild not found."
1129
fi
1230

31+
if [[ -n "$ALIBUILD_WORK_DIR" ]]; then
32+
echo "ALIBUILD_WORK_DIR=\"${ALIBUILD_WORK_DIR}\""
33+
else
34+
echo "ALIBUILD_WORK_DIR is not set."
35+
fi
36+
37+
# Repository info
38+
1339
for repo in alidist O2 O2Physics; do
1440
[[ -d "${repo}" ]] || { echo "Directory ${repo} not found in the current directory."; continue; }
1541
echo "Last commit of ${repo}: $(cd "${repo}" && git log -n 1 --pretty="format:%ci %h")"
1642
done
1743

44+
# Package build info
45+
1846
cmdStat=""
1947
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
2048
cmdStat="stat -c %y"
2149
elif [[ "$OSTYPE" == "darwin"* ]]; then
2250
cmdStat="stat -f %Sm"
2351
fi
2452

25-
if [[ -n "$cmdStat" ]]; then
53+
if [[ -n "$cmdStat" && -n "$ALIBUILD_WORK_DIR" ]]; then
2654
for pkg in O2 O2Physics; do
2755
log="$ALIBUILD_WORK_DIR/BUILD/${pkg}-latest/log"
2856
[[ -f "${log}" ]] || { echo "Log file ${log} not found."; continue; }

0 commit comments

Comments
 (0)