Skip to content

Commit b5d44a5

Browse files
Tweak as per CI results
1 parent 94aa6bb commit b5d44a5

File tree

3 files changed

+50
-35
lines changed

3 files changed

+50
-35
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,16 @@ jobs:
9393
run: ./kerl delete build "$_KERL_VSN"
9494
- name: Test build+install chosen version
9595
run: |
96-
if ! KERL_DEBUG=true ./kerl build-install ${_KERL_PREFIX_GIT} \
97-
${_KERL_PREFIX_GIT_TARGET} \
98-
"${_KERL_VSN}" \
99-
"${_KERL_VSN}"; then
100-
## Print build log if it fails
101-
cat ~/.kerl/builds/*/*.log
102-
exit 1
103-
fi
96+
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
97+
if ! KERL_DEBUG=true ./kerl build-install ${_KERL_PREFIX_GIT} \
98+
${_KERL_PREFIX_GIT_TARGET} \
99+
"${_KERL_VSN}" \
100+
"${_KERL_VSN}" \
101+
"$PWD/build-install"; then
102+
## Print build log if it fails
103+
cat ~/.kerl/builds/*/*.log
104+
exit 1
105+
fi
104106
- name: Check installation status (build+install)
105107
run: ./kerl status
106108
- name: Validate installation (build+install)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ Activation will backup your $PATH, prepend it with the installation's bin/
131131
directory. Thus it's only valid for the current shell session, and until you
132132
activate another installation or call `kerl_deactivate`.
133133

134-
**Note**: alternatively you can use `kerl build-install` as a shortcut for
134+
**Note**: alternatively you can use `kerl build-install` as a shortcut for
135135
the two previous actions to be played in sequence.
136136

137137
$ kerl build-install
138138
usage: ./kerl build-install <release> [build_name] [directory]
139139

140140
$ kerl build-install git
141-
usage: ./kerl build-install git <git_url> <git_version> [build_name] [directory]
141+
usage: ./kerl build-install git <git_url> <git_version> <build_name> [directory]
142142

143143
You're now ready to work with your 19.2 installation:
144144

kerl

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,25 +1167,26 @@ _do_build() {
11671167
}
11681168

11691169
do_build_install() {
1170-
if [ "$1" = "git" ]; then
1171-
build_name="$4"
1172-
else
1173-
build_name="$2"
1174-
fi
1170+
release_or_git=$1
1171+
git_url=$2
1172+
git_version=$3
1173+
build_name=$4
1174+
directory=$5
11751175

11761176
if is_valid_installation "$build_name"; then
11771177
l=e stderr "There's already an installation named $build_name. Skipping build step..."
11781178
exit 1
11791179
fi
11801180

1181-
if [ "$1" = "git" ]; then
1182-
git_url="$2"
1183-
git_version="$3"
1184-
directory="$5"
1181+
# This is also done on do_install, but saves the build time in case of error
1182+
if ! is_valid_install_path "$directory"; then
1183+
exit 1
1184+
fi
1185+
1186+
if [ "$release_or_git" = "git" ]; then
11851187
$0 build git "$git_url" "$git_version" "$build_name"
11861188
else
1187-
release=$1
1188-
directory="$3"
1189+
release="$release_or_git"
11891190
$0 build "$release" "$build_name"
11901191
fi
11911192

@@ -2393,30 +2394,42 @@ case "$1" in
23932394
fi
23942395
;;
23952396
build-install)
2396-
# naming contains _or_ because do_build_install either accepts $1 as "git" or otherwise
2397+
# naming contains _or_ because do_build_install either accepts $2 as "git" or otherwise
2398+
release_or_git="$2"
23972399
build_name_or_git_url="$3"
2400+
directory_or_git_version="$4"
23982401
build_name="$5"
2399-
if [ "$2" = "git" ]; then
2400-
if [ $# -eq 4 ]; then
2401-
build_name="$4"
2402-
elif [ $# -ne 5 ]; then
2403-
l=e stderr "usage: $0 $1 $2 <git_url> <git_version> [build_name] [directory]"
2402+
directory="$6"
2403+
2404+
if [ "$release_or_git" = "git" ]; then
2405+
if [ $# -ne 5 ] && [ $# -ne 6 ]; then
2406+
l=e stderr "usage: $0 $1 git <git_url> <git_version> <build_name> [directory]"
24042407
exit 1
24052408
fi
2409+
git_url="$build_name_or_git_url"
2410+
git_version="$directory_or_git_version"
24062411
else
2407-
if [ $# -eq 2 ]; then
2408-
build_name_or_git_url="$2"
2409-
elif [ $# -ne 3 ]; then
2412+
if [ $# -ne 2 ] && [ $# -ne 3 ] && [ $# -ne 4 ]; then
24102413
l=e stderr "usage: $0 $1 <release> [build_name] [directory]"
24112414
exit 1
24122415
fi
2416+
release="$release_or_git"
2417+
build_name="$build_name_or_git_url"
2418+
git_url="_unused_"
2419+
directory="$directory_or_git_version"
2420+
git_version="_unused_"
2421+
if [ $# -eq 2 ]; then
2422+
build_name="$release"
2423+
fi
24132424
fi
2414-
if [ -z "$KERL_DEFAULT_INSTALL_DIR" ]; then
2415-
directory="$PWD"
2416-
else
2417-
directory="$KERL_DEFAULT_INSTALL_DIR/$2"
2425+
if [ -z "$directory" ]; then
2426+
if [ -z "$KERL_DEFAULT_INSTALL_DIR" ]; then
2427+
directory="$PWD"
2428+
else
2429+
directory="$KERL_DEFAULT_INSTALL_DIR/$build_name"
2430+
fi
24182431
fi
2419-
do_build_install "$2" "$build_name_or_git_url" "$4" "$build_name" "$directory"
2432+
do_build_install "$release_or_git" "$git_url" "$git_version" "$build_name" "$directory"
24202433
;;
24212434
install)
24222435
if [ $# -lt 2 ]; then

0 commit comments

Comments
 (0)