Skip to content

Commit 171487e

Browse files
committed
Remove reliance on tree
- Get default versions automatically using `./install.sh -V $pkg` - Don't use `tree` - Delete doc tree structure - Fixes #402
1 parent 232d234 commit 171487e

File tree

8 files changed

+29
-106
lines changed

8 files changed

+29
-106
lines changed

doc/dependency_tree/gitkeep.sh

Lines changed: 0 additions & 73 deletions
This file was deleted.

doc/dependency_tree/opencoarrays-tree.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

doc/dependency_tree/opencoarrays/cmake-3.4.0/.gitkeep

Whitespace-only changes.

doc/dependency_tree/opencoarrays/mpich-3.2/gcc-6.1.0/flex-2.6.0/bison-3.0.4/m4-1.4.17/.gitkeep

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/dependency_tree/opencoarrays/mpich-3.2/gcc-6.1.0/gmp/.gitkeep

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/dependency_tree/opencoarrays/mpich-3.2/gcc-6.1.0/mpc/.gitkeep

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/dependency_tree/opencoarrays/mpich-3.2/gcc-6.1.0/mpfr/.gitkeep

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,39 @@
11
# 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
412
clear
513
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 ***"
816
echo "*** options for forcing the use of older or alternative packages, execute ***"
917
echo "*** this script with the -h flag. This script will recursively traverse ***"
1018
echo "*** the following dependency tree, asking permission to download, build, ***"
1119
echo "*** and install any packages that are required for building another ***"
1220
echo "*** package and are neither in your PATH nor in ***"
1321
echo "*** opencoarrays/prerequisites/installations: ***"
1422
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
2537
echo ""
2638
printf "%s will be installed in %s\n" "${arg_p}" "${install_path}"
2739
echo ""
@@ -30,9 +42,9 @@ print_header()
3042
else
3143
printf "Ready to rock and roll? (Y/n)"
3244
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]"
3648
fi
3749
fi
3850
}

0 commit comments

Comments
 (0)