1
1
# shellcheck shell=bash disable=SC2154,SC2148
2
- print_header ()
3
- {
2
+ print_header () {
3
+ pushd " ${__dir} " > /dev/null
4
+ local gccver mpichver cmakever flexver bisonver m4ver
5
+ gccver=" $( " ${__file} " -V gcc) "
6
+ mpichver=" $( " ${__file} " -V mpich) "
7
+ cmakever=" $( " ${__file} " -V cmake) "
8
+ flexver=" $( " ${__file} " -V flex) "
9
+ bisonver=" $( " ${__file} " -V bison) "
10
+ m4ver=" $( " ${__file} " -V m4) "
11
+ popd > /dev/null
4
12
clear
5
13
echo " "
6
- echo " *** By default, building OpenCoarrays requires CMake 3.4.0 or later, ***"
7
- echo " *** MPICH 3.2 , and GCC Fortran (gfortran) 6.1.0 or later. To see ***"
14
+ echo " *** By default, building OpenCoarrays requires CMake ${cmakever} or later, ***"
15
+ echo " *** MPICH ${mpichver} , and GCC Fortran (gfortran) ${gccver} or later. To see ***"
8
16
echo " *** options for forcing the use of older or alternative packages, execute ***"
9
17
echo " *** this script with the -h flag. This script will recursively traverse ***"
10
18
echo " *** the following dependency tree, asking permission to download, build, ***"
11
19
echo " *** and install any packages that are required for building another ***"
12
20
echo " *** package and are neither in your PATH nor in ***"
13
21
echo " *** opencoarrays/prerequisites/installations: ***"
14
22
echo " "
15
- # Move to a directory tree whose structure mirrors the dependency tree
16
- pushd " $opencoarrays_src_dir /doc/dependency_tree/" > /dev/null
17
- if type tree & > /dev/null; then
18
- # dynamically compute and print the tree, suppressing the final line
19
- tree opencoarrays | sed ' $d'
20
- else
21
- # print the most recently saved output of the above 'tree' command
22
- sed ' $d' < opencoarrays-tree.txt
23
- fi
24
- popd > /dev/null
23
+ # Generate the following text using the `tree` command w/ dummy directory structure
24
+ cat << -EOF
25
+ opencoarrays
26
+ ├── cmake-${cmakever}
27
+ └── mpich-${mpichver}
28
+ └── gcc-${gccver}
29
+ ├── flex-${flexver}
30
+ │ └── bison-${bisonver}
31
+ │ └── m4-${m4ver}
32
+ ├── gmp
33
+ ├── mpc
34
+ └── mpfr
35
+
36
+ EOF
25
37
echo " "
26
38
printf " %s will be installed in %s\n" " ${arg_p} " " ${install_path} "
27
39
echo " "
@@ -30,9 +42,9 @@ print_header()
30
42
else
31
43
printf " Ready to rock and roll? (Y/n)"
32
44
read -r install_now
33
- echo -e " $ install_now\n "
34
- if [[ " $install_now " == " n" || " $install_now " == " no" ]]; then
35
- emergency " $this_script : Aborting. [exit 85]\n "
45
+ printf ' %s\n ' " ${ install_now} "
46
+ if [[ " ${ install_now} " == " n" || " ${ install_now} " == " no" ]]; then
47
+ emergency " ${ this_script} : Aborting. [exit 85]"
36
48
fi
37
49
fi
38
50
}
0 commit comments