33
33
# POSSIBILITY OF SUCH DAMAGE.
34
34
35
35
# Interpret the first argument as the package executable name
36
- package=$1
36
+ package=" $1 "
37
37
# Interpret the second argument as the minimimum acceptable package version number
38
- minimum_version=$2
38
+ minimum_version=" $2 "
39
39
# Interpret the third argument as indicating the desired verbosity
40
40
verbose=$3
41
41
42
- this_script=` basename $0 `
42
+ this_script=$( basename " $0 " )
43
43
44
44
usage ()
45
45
{
@@ -58,31 +58,31 @@ usage()
58
58
echo " "
59
59
echo " $this_script cmake 3.4.0"
60
60
echo " $this_script flex 2.6.0 --verbose"
61
- echo " $this_script flex ` ./build flex --default --query-version ` "
61
+ echo " $this_script flex $( ./build.sh -V flex ) "
62
62
echo " $this_script --help"
63
63
echo " $this_script --list"
64
64
echo " "
65
65
echo " [exit 10]"
66
66
exit 10
67
- }
67
+ }
68
68
69
69
# Print usage information and exit if script is invoked without arguments or with --help or -h as the first argument
70
70
if [ $# == 0 ]; then
71
71
usage | less
72
- exit 20
72
+ exit 20
73
73
74
74
elif [[ $1 == ' --help' || $1 == ' -h' ]]; then
75
75
usage | less
76
- exit 30
76
+ exit 30
77
77
78
78
elif [[ $1 == ' --list' || $1 == ' -l' ]]; then
79
79
echo " $this_script currently verifies minimum version numbers for the following OpenCoarrays prerequisites:"
80
80
echo " cmake, flex, bison, m4"
81
- exit 40
81
+ exit 40
82
82
83
83
elif [[ $1 == ' -v' || $1 == ' -V' || $1 == ' --version' ]]; then
84
84
# Print script copyright if invoked with -v, -V, or --version argument
85
- cmake_project_line=` grep project ../CMakeLists.txt | grep VERSION`
85
+ cmake_project_line=$( grep project ../CMakeLists.txt | grep VERSION)
86
86
text_after_version_keyword=" ${cmake_project_line##* VERSION} "
87
87
text_before_language_keyword=" ${text_after_version_keyword%% LANGUAGES* } "
88
88
opencoarrays_version=$text_before_language_keyword
@@ -99,9 +99,9 @@ elif [[ $1 == '-v' || $1 == '-V' || $1 == '--version' ]]; then
99
99
echo " "
100
100
fi
101
101
102
- package_version_header=` $1 --version | head -1`
102
+ package_version_header=$( $package --version | head -1)
103
103
if [[ " $verbose " == " --verbose" ]]; then
104
- echo $package_version_header
104
+ echo " $package_version_header "
105
105
fi
106
106
107
107
# Extract the text after the final space:
0 commit comments