Skip to content

Commit 434f504

Browse files
authored
Merge pull request #784 from pmienk/master
Regenerate with build/install updates.
2 parents 20ab06d + 13686ca commit 434f504

5 files changed

Lines changed: 204 additions & 40 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -181,22 +181,22 @@ jobs:
181181
working-directory: ${{ github.workspace }}
182182
run: |
183183
if [[ -e "libbitcoin-system/obj/Testing/Temporary/LastTest.log" ]]; then
184-
cp "libbitcoin-system/obj/Testing/Temporary/LastTest.log" libbitcoin-system-LastTest.errors"
184+
cp "libbitcoin-system/obj/Testing/Temporary/LastTest.log" libbitcoin-system-LastTest.errors
185185
fi
186186
if [[ -e "libbitcoin-system/obj/test-suite.log" ]]; then
187-
cp "libbitcoin-system/obj/test-suite.log" libbitcoin-system-test-suite.errors"
187+
cp "libbitcoin-system/obj/test-suite.log" libbitcoin-system-test-suite.errors
188188
fi
189189
if [[ -e "libbitcoin-system/obj/test.log" ]]; then
190-
cp "libbitcoin-system/obj/test.log" libbitcoin-system-test.errors"
190+
cp "libbitcoin-system/obj/test.log" libbitcoin-system-test.errors
191191
fi
192192
if [[ -e "libbitcoin-database/obj/Testing/Temporary/LastTest.log" ]]; then
193-
cp "libbitcoin-database/obj/Testing/Temporary/LastTest.log" libbitcoin-database-LastTest.errors"
193+
cp "libbitcoin-database/obj/Testing/Temporary/LastTest.log" libbitcoin-database-LastTest.errors
194194
fi
195195
if [[ -e "libbitcoin-database/obj/test-suite.log" ]]; then
196-
cp "libbitcoin-database/obj/test-suite.log" libbitcoin-database-test-suite.errors"
196+
cp "libbitcoin-database/obj/test-suite.log" libbitcoin-database-test-suite.errors
197197
fi
198198
if [[ -e "libbitcoin-database/obj/test.log" ]]; then
199-
cp "libbitcoin-database/obj/test.log" libbitcoin-database-test.errors"
199+
cp "libbitcoin-database/obj/test.log" libbitcoin-database-test.errors
200200
fi
201201
202202
- name: Test artifact upload
@@ -378,22 +378,22 @@ jobs:
378378
working-directory: ${{ github.workspace }}
379379
run: |
380380
if [[ -e "libbitcoin-system/obj/Testing/Temporary/LastTest.log" ]]; then
381-
cp "libbitcoin-system/obj/Testing/Temporary/LastTest.log" libbitcoin-system-LastTest.errors"
381+
cp "libbitcoin-system/obj/Testing/Temporary/LastTest.log" libbitcoin-system-LastTest.errors
382382
fi
383383
if [[ -e "libbitcoin-system/obj/test-suite.log" ]]; then
384-
cp "libbitcoin-system/obj/test-suite.log" libbitcoin-system-test-suite.errors"
384+
cp "libbitcoin-system/obj/test-suite.log" libbitcoin-system-test-suite.errors
385385
fi
386386
if [[ -e "libbitcoin-system/obj/test.log" ]]; then
387-
cp "libbitcoin-system/obj/test.log" libbitcoin-system-test.errors"
387+
cp "libbitcoin-system/obj/test.log" libbitcoin-system-test.errors
388388
fi
389389
if [[ -e "libbitcoin-database/obj/Testing/Temporary/LastTest.log" ]]; then
390-
cp "libbitcoin-database/obj/Testing/Temporary/LastTest.log" libbitcoin-database-LastTest.errors"
390+
cp "libbitcoin-database/obj/Testing/Temporary/LastTest.log" libbitcoin-database-LastTest.errors
391391
fi
392392
if [[ -e "libbitcoin-database/obj/test-suite.log" ]]; then
393-
cp "libbitcoin-database/obj/test-suite.log" libbitcoin-database-test-suite.errors"
393+
cp "libbitcoin-database/obj/test-suite.log" libbitcoin-database-test-suite.errors
394394
fi
395395
if [[ -e "libbitcoin-database/obj/test.log" ]]; then
396-
cp "libbitcoin-database/obj/test.log" libbitcoin-database-test.errors"
396+
cp "libbitcoin-database/obj/test.log" libbitcoin-database-test.errors
397397
fi
398398
399399
- name: Test artifact upload
@@ -534,22 +534,22 @@ jobs:
534534
working-directory: ${{ github.workspace }}
535535
run: |
536536
if [[ -e "libbitcoin-system/obj/Testing/Temporary/LastTest.log" ]]; then
537-
cp "libbitcoin-system/obj/Testing/Temporary/LastTest.log" libbitcoin-system-LastTest.errors"
537+
cp "libbitcoin-system/obj/Testing/Temporary/LastTest.log" libbitcoin-system-LastTest.errors
538538
fi
539539
if [[ -e "libbitcoin-system/obj/test-suite.log" ]]; then
540-
cp "libbitcoin-system/obj/test-suite.log" libbitcoin-system-test-suite.errors"
540+
cp "libbitcoin-system/obj/test-suite.log" libbitcoin-system-test-suite.errors
541541
fi
542542
if [[ -e "libbitcoin-system/obj/test.log" ]]; then
543-
cp "libbitcoin-system/obj/test.log" libbitcoin-system-test.errors"
543+
cp "libbitcoin-system/obj/test.log" libbitcoin-system-test.errors
544544
fi
545545
if [[ -e "libbitcoin-database/obj/Testing/Temporary/LastTest.log" ]]; then
546-
cp "libbitcoin-database/obj/Testing/Temporary/LastTest.log" libbitcoin-database-LastTest.errors"
546+
cp "libbitcoin-database/obj/Testing/Temporary/LastTest.log" libbitcoin-database-LastTest.errors
547547
fi
548548
if [[ -e "libbitcoin-database/obj/test-suite.log" ]]; then
549-
cp "libbitcoin-database/obj/test-suite.log" libbitcoin-database-test-suite.errors"
549+
cp "libbitcoin-database/obj/test-suite.log" libbitcoin-database-test-suite.errors
550550
fi
551551
if [[ -e "libbitcoin-database/obj/test.log" ]]; then
552-
cp "libbitcoin-database/obj/test.log" libbitcoin-database-test.errors"
552+
cp "libbitcoin-database/obj/test.log" libbitcoin-database-test.errors
553553
fi
554554
555555
- name: Test artifact upload

builds/cmake/install-cmake.sh

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
# --build-use-local-src Use existing sources in relevant paths.
3939
# --prefix=<path> Installation destination.
4040
# Default: /usr/local
41+
# --noninteractive Disable any prompt using default.
4142
# --verbose Display verbose script output.
4243
# --help, -h Display usage, overriding script execution.
4344
#
@@ -99,6 +100,7 @@ main()
99100
(--build-parallel=*) PARALLEL="${OPTION#*=}";;
100101
(--build-use-local-src) BUILD_USE_LOCAL_SRC="yes";;
101102
(--prefix=*) PREFIX="${OPTION#*=}";;
103+
(--noninteractive) NONINTERACTIVE="yes";;
102104
(--verbose) DISPLAY_VERBOSE="yes";;
103105
(--help|-h) DISPLAY_HELP="yes";;
104106
(-DCMAKE_PREFIX_PATH=*) CMAKE_PREFIX_PATH="${OPTION#*=}";;
@@ -123,6 +125,7 @@ main()
123125
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--build-parallel=*/}")
124126
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--build-use-local-src/}")
125127
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--prefix=*/}")
128+
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--noninteractive/}")
126129
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--verbose/}")
127130
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--help/}")
128131
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/-h/}")
@@ -491,8 +494,19 @@ source_archive()
491494
fi
492495

493496
if [ -d "${PROJECT}" ]; then
494-
msg_warn "Encountered existing '${PROJECT}' directory, removing..."
495-
remove_directory_force "${PROJECT}"
497+
msg_warn "Encountered existing '${PROJECT}' directory..."
498+
if [[ "${NONINTERACTIVE}" == "yes" ]]; then
499+
CONFIRM="N"
500+
else
501+
read -p "Replace '${PROJECT}' directory with intended contents? [y/N] " CONFIRM
502+
fi
503+
504+
if [[ "${CONFIRM,,}" == "y" ]]; then
505+
remove_directory_force "${PROJECT}"
506+
else
507+
msg_error "Aborted installation."
508+
exit 0
509+
fi
496510
fi
497511

498512
msg "Retrieving ${PROJECT}..."
@@ -520,6 +534,18 @@ source_archive()
520534
msg_success "Completed download and extraction successfully."
521535
}
522536

537+
github_repository_status()
538+
{
539+
local REPOSITORY="$1"
540+
541+
push_directory "${REPOSITORY}"
542+
local DISCOVERED_COMMIT=$(git rev-parse HEAD)
543+
local DISCOVERED_URL=$(git config --get remote.origin.url)
544+
pop_directory # REPOSITORY
545+
msg_warn " commit : ${DISCOVERED_COMMIT}"
546+
msg_warn " url : ${DISCOVERED_URL}"
547+
}
548+
523549
source_github()
524550
{
525551
local OWNER="$1"
@@ -541,21 +567,33 @@ source_github()
541567
if [ -d "${REPOSITORY}" ] &&
542568
[[ "${BUILD_USE_LOCAL_SRC}" == "yes" ]]; then
543569
msg_warn "Reusing existing '${REPOSITORY}'..."
570+
github_repository_status "${REPOSITORY}"
544571
pop_directory # BUILD_SRC_DIR
545572
return 0
546573
fi
547574

548575
if [ -d "${REPOSITORY}" ]; then
549-
msg_warn "Encountered existing '${REPOSITORY}' directory, removing..."
550-
remove_directory_force "${REPOSITORY}"
576+
msg_warn "Encountered existing '${REPOSITORY}' directory..."
577+
if [[ "${NONINTERACTIVE}" == "yes" ]]; then
578+
CONFIRM="N"
579+
else
580+
read -p "Replace '${REPOSITORY}' directory with intended contents? [y/N] " CONFIRM
581+
fi
582+
583+
if [[ "${CONFIRM,,}" == "y" ]]; then
584+
remove_directory_force "${REPOSITORY}"
585+
else
586+
msg_error "Aborted installation."
587+
exit 0
588+
fi
551589
fi
552590

553591
msg "Cloning ${OWNER}/${REPOSITORY}/${TAG}..."
554592

555593
${GIT_CLONE} ${CLONE_OPTIONS} --branch "${TAG}" "https://github.com/${OWNER}/${REPOSITORY}"
556594

557-
# pop BUILD_SRC_DIR
558-
pop_directory
595+
github_repository_status "${REPOSITORY}"
596+
pop_directory # pop BUILD_SRC_DIR
559597
}
560598

561599
install_make()
@@ -896,6 +934,7 @@ help()
896934
msg "--build-use-local-src Use existing sources in relevant paths."
897935
msg "--prefix=<path> Installation destination."
898936
msg " Default: /usr/local"
937+
msg "--noninteractive Disable any prompt using default."
899938
msg "--verbose Display verbose script output."
900939
msg "--help, -h Display usage, overriding script execution."
901940
msg ""

builds/cmake/install-presets.sh

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# --build-parallel=<int> Number of jobs to run simultaneously.
2929
# Default: supported platforms use nproc/sysctl
3030
# --build-use-local-src Use existing sources in relevant paths.
31+
# --noninteractive Disable any prompt using default.
3132
# --verbose Display verbose script output.
3233
# --help, -h Display usage, overriding script execution.
3334
#
@@ -85,6 +86,7 @@ main()
8586
(--build-skip-tests) BUILD_SKIP_TESTS="yes";;
8687
(--build-parallel=*) PARALLEL="${OPTION#*=}";;
8788
(--build-use-local-src) BUILD_USE_LOCAL_SRC="yes";;
89+
(--noninteractive) NONINTERACTIVE="yes";;
8890
(--verbose) DISPLAY_VERBOSE="yes";;
8991
(--help|-h) DISPLAY_HELP="yes";;
9092
(-DCMAKE_PREFIX_PATH=*) CMAKE_PREFIX_PATH="${OPTION#*=}";;
@@ -105,6 +107,7 @@ main()
105107
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--build-skip-tests/}")
106108
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--build-parallel=*/}")
107109
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--build-use-local-src/}")
110+
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--noninteractive/}")
108111
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--verbose/}")
109112
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--help/}")
110113
CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/-h/}")
@@ -507,8 +510,19 @@ source_archive()
507510
fi
508511

509512
if [ -d "${PROJECT}" ]; then
510-
msg_warn "Encountered existing '${PROJECT}' directory, removing..."
511-
remove_directory_force "${PROJECT}"
513+
msg_warn "Encountered existing '${PROJECT}' directory..."
514+
if [[ "${NONINTERACTIVE}" == "yes" ]]; then
515+
CONFIRM="N"
516+
else
517+
read -p "Replace '${PROJECT}' directory with intended contents? [y/N] " CONFIRM
518+
fi
519+
520+
if [[ "${CONFIRM,,}" == "y" ]]; then
521+
remove_directory_force "${PROJECT}"
522+
else
523+
msg_error "Aborted installation."
524+
exit 0
525+
fi
512526
fi
513527

514528
msg "Retrieving ${PROJECT}..."
@@ -536,6 +550,18 @@ source_archive()
536550
msg_success "Completed download and extraction successfully."
537551
}
538552

553+
github_repository_status()
554+
{
555+
local REPOSITORY="$1"
556+
557+
push_directory "${REPOSITORY}"
558+
local DISCOVERED_COMMIT=$(git rev-parse HEAD)
559+
local DISCOVERED_URL=$(git config --get remote.origin.url)
560+
pop_directory # REPOSITORY
561+
msg_warn " commit : ${DISCOVERED_COMMIT}"
562+
msg_warn " url : ${DISCOVERED_URL}"
563+
}
564+
539565
source_github()
540566
{
541567
local OWNER="$1"
@@ -557,21 +583,33 @@ source_github()
557583
if [ -d "${REPOSITORY}" ] &&
558584
[[ "${BUILD_USE_LOCAL_SRC}" == "yes" ]]; then
559585
msg_warn "Reusing existing '${REPOSITORY}'..."
586+
github_repository_status "${REPOSITORY}"
560587
pop_directory # BUILD_SRC_DIR
561588
return 0
562589
fi
563590

564591
if [ -d "${REPOSITORY}" ]; then
565-
msg_warn "Encountered existing '${REPOSITORY}' directory, removing..."
566-
remove_directory_force "${REPOSITORY}"
592+
msg_warn "Encountered existing '${REPOSITORY}' directory..."
593+
if [[ "${NONINTERACTIVE}" == "yes" ]]; then
594+
CONFIRM="N"
595+
else
596+
read -p "Replace '${REPOSITORY}' directory with intended contents? [y/N] " CONFIRM
597+
fi
598+
599+
if [[ "${CONFIRM,,}" == "y" ]]; then
600+
remove_directory_force "${REPOSITORY}"
601+
else
602+
msg_error "Aborted installation."
603+
exit 0
604+
fi
567605
fi
568606

569607
msg "Cloning ${OWNER}/${REPOSITORY}/${TAG}..."
570608

571609
${GIT_CLONE} ${CLONE_OPTIONS} --branch "${TAG}" "https://github.com/${OWNER}/${REPOSITORY}"
572610

573-
# pop BUILD_SRC_DIR
574-
pop_directory
611+
github_repository_status "${REPOSITORY}"
612+
pop_directory # pop BUILD_SRC_DIR
575613
}
576614

577615
install_make()
@@ -953,6 +991,7 @@ help()
953991
msg "--build-parallel=<int> Number of jobs to run simultaneously."
954992
msg " Default: supported platforms use nproc/sysctl"
955993
msg "--build-use-local-src Use existing sources in relevant paths."
994+
msg "--noninteractive Disable any prompt using default."
956995
msg "--verbose Display verbose script output."
957996
msg "--help, -h Display usage, overriding script execution."
958997
msg ""

0 commit comments

Comments
 (0)