-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlatest.bash
90 lines (75 loc) · 2.03 KB
/
latest.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
msg_install --message "Will install latest modules now"
cm_defs="-P /directory/should/not/exist --module-path $(build_get --module-path)-apps"
# Source the file for obtaining correct env-variables
source $(build_get --source)
case $_mod_format in
$_mod_format_ENVMOD)
function rm_latest {
local latest_mod=$(build_get --module-path)-apps
rm -rf $latest_mod/$1
}
;;
$_mod_format_LMOD)
function rm_latest {
local latest_mod=$(build_get --module-path)-apps
rm -rf $latest_mod/$1.lua
}
;;
esac
function echo_modules {
# Retrieve all modules
local mods=""
while [[ $# -gt 0 ]]; do
mods="$(pack_get --mod-req-module $1) $1"
shift
done
# Remove duplicates
mods="$(rem_dup $mods)"
local echos=""
for mod in $mods ; do
local tmp=$(pack_get --module-name $mod)
local tmp=${tmp//\/$(get_c)/}
echos="$echos $tmp"
done
printf '%s' "Loading: $echos"
}
msg_install --message "Inelastica"
rm_latest Inelastica.latest
create_module $cm_defs \
-n Inelastica.latest \
-W "Inelastica: $(get_c)" \
-M Inelastica.latest \
-echo "$(echo_modules Inelastica-dev)" \
-RL Inelastica-dev
msg_install --message "siesta and its variants"
rm_latest siesta.latest
create_module $cm_defs \
-n siesta.latest \
-W "Siesta: $(get_c)" \
-M siesta.latest \
-echo "$(echo_modules siesta)" \
-RL siesta
rm_latest siesta-master.latest
create_module $cm_defs \
-n siesta-master.latest \
-W "Siesta: $(get_c)" \
-M siesta-master.latest \
-echo "$(echo_modules siesta-master)" \
-RL siesta-master
rm_latest siesta-bulk-bias.latest
create_module $cm_defs \
-n siesta-bulk-bias.latest \
-W "Siesta: $(get_c)" \
-M siesta-bulk-bias.latest \
-echo "$(echo_modules siesta-bulk-bias)" \
-RL siesta-bulk-bias
msg_install --message "lammps"
rm_latest lammps.latest
create_module $cm_defs \
-n lammps.latest \
-W "LAMMPS: $(get_c)" \
-M lammps.latest \
-echo "$(echo_modules lammps)" \
-RL lammps
unset echo_modules
unset rm_latest