From 4f29a8e73a558b905fa1700db201d3a300903996 Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Thu, 19 Jan 2023 11:40:54 +0200 Subject: [PATCH 01/12] Fixes install_or_tools.sh Signed-off-by: Alexey Roytman --- hack/tools/install_or_tools.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index edb96151e..78c61202e 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -6,6 +6,8 @@ cd "${0%/*}" source ./common.sh +BUILD_FILE=lib/build +VERSION_FILE=lib/version case ${os} in linux) @@ -23,7 +25,7 @@ case ${os} in esac header_text "Checking for bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" -[[ -f bin/fzn-or-tools ]] && [[ -f lib/libfz.so ]] && exit 0 +[[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 header_text "Installing bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" mkdir -p ./bin @@ -37,3 +39,5 @@ tar -zxvf ./${download_file} -C $tmp mv $tmp/*/bin/fzn-ortools ./bin/fzn-or-tools mv $tmp/*/lib*/lib*.${dyn_lib_ext}* ./lib chmod +x ./bin/fzn-or-tools +echo ${OR_TOOLS_BUILD} > lib/build +echo ${OR_TOOLS_VERSION} > lib/version From 7d4082fa0a50194f5a8972b3c8ed2ebbd1d63602 Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Thu, 19 Jan 2023 15:12:42 +0200 Subject: [PATCH 02/12] Update hack/tools/install_or_tools.sh OK Co-authored-by: Ziv Nevo <79099626+zivnevo@users.noreply.github.com> --- hack/tools/install_or_tools.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index 78c61202e..41d8abc79 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -6,8 +6,8 @@ cd "${0%/*}" source ./common.sh -BUILD_FILE=lib/build -VERSION_FILE=lib/version +BUILD_FILE=lib/fzn-or-tools-build +VERSION_FILE=lib/fzn-or-tools-version case ${os} in linux) From e18be0f5d753334c2398e423fb9715c5377ce408 Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Thu, 19 Jan 2023 15:13:29 +0200 Subject: [PATCH 03/12] Update hack/tools/install_or_tools.sh of course. Co-authored-by: Ziv Nevo <79099626+zivnevo@users.noreply.github.com> --- hack/tools/install_or_tools.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index 41d8abc79..b8437322d 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -39,5 +39,5 @@ tar -zxvf ./${download_file} -C $tmp mv $tmp/*/bin/fzn-ortools ./bin/fzn-or-tools mv $tmp/*/lib*/lib*.${dyn_lib_ext}* ./lib chmod +x ./bin/fzn-or-tools -echo ${OR_TOOLS_BUILD} > lib/build -echo ${OR_TOOLS_VERSION} > lib/version +echo ${OR_TOOLS_BUILD} > ${BUILD_FILE} +echo ${OR_TOOLS_VERSION} > ${VERSION_FILE} From 0ea4084ae52e74780acf43cf310bf354df1fb473 Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Thu, 19 Jan 2023 19:34:18 +0200 Subject: [PATCH 04/12] move fzn-or-tools build and version files from lib --- hack/tools/install_or_tools.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index b8437322d..916b4bad5 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -6,8 +6,8 @@ cd "${0%/*}" source ./common.sh -BUILD_FILE=lib/fzn-or-tools-build -VERSION_FILE=lib/fzn-or-tools-version +BUILD_FILE=fzn-or-tools-build +VERSION_FILE=fzn-or-tools-version case ${os} in linux) From f358dcb3eacedc07baeead72741cf064e883813b Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Thu, 19 Jan 2023 23:44:39 +0200 Subject: [PATCH 05/12] test --- hack/tools/install_or_tools.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index 916b4bad5..fa819d604 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -25,7 +25,7 @@ case ${os} in esac header_text "Checking for bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" -[[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 +# [[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 header_text "Installing bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" mkdir -p ./bin @@ -39,5 +39,5 @@ tar -zxvf ./${download_file} -C $tmp mv $tmp/*/bin/fzn-ortools ./bin/fzn-or-tools mv $tmp/*/lib*/lib*.${dyn_lib_ext}* ./lib chmod +x ./bin/fzn-or-tools -echo ${OR_TOOLS_BUILD} > ${BUILD_FILE} -echo ${OR_TOOLS_VERSION} > ${VERSION_FILE} +# echo ${OR_TOOLS_BUILD} > ${BUILD_FILE} +# echo ${OR_TOOLS_VERSION} > ${VERSION_FILE} From 5c84a253fbb41a4cf7a5fb0f2266f113cab7d9bd Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Fri, 20 Jan 2023 00:25:09 +0200 Subject: [PATCH 06/12] test2 --- hack/tools/install_or_tools.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index fa819d604..a6ab9f8b9 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -39,5 +39,5 @@ tar -zxvf ./${download_file} -C $tmp mv $tmp/*/bin/fzn-ortools ./bin/fzn-or-tools mv $tmp/*/lib*/lib*.${dyn_lib_ext}* ./lib chmod +x ./bin/fzn-or-tools -# echo ${OR_TOOLS_BUILD} > ${BUILD_FILE} -# echo ${OR_TOOLS_VERSION} > ${VERSION_FILE} +echo ${OR_TOOLS_BUILD} > ${BUILD_FILE} +echo ${OR_TOOLS_VERSION} > ${VERSION_FILE} From e0551d5960d140ead5131c16e8febf67909dfeb2 Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Fri, 20 Jan 2023 08:10:28 +0200 Subject: [PATCH 07/12] test3 --- hack/tools/install_or_tools.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index a6ab9f8b9..be6ae8b3b 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -25,6 +25,8 @@ case ${os} in esac header_text "Checking for bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" +[[ -f bin/fzn-or-tools ]] && exit 0 + # [[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 header_text "Installing bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" From b6b1feb9e5366e1b35ecbd4cb11867bec1243e78 Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Sun, 22 Jan 2023 09:54:46 +0200 Subject: [PATCH 08/12] add print OS and Arch --- hack/tools/install_or_tools.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index be6ae8b3b..a6b8b13c1 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -25,11 +25,9 @@ case ${os} in esac header_text "Checking for bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" -[[ -f bin/fzn-or-tools ]] && exit 0 - # [[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 -header_text "Installing bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" +header_text "Installing bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD} for ${arch}_${target_os}" mkdir -p ./bin mkdir -p ./lib From 8391535b00a4366722eb0d7f8dd74c8838704aeb Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Sun, 22 Jan 2023 10:41:01 +0200 Subject: [PATCH 09/12] return the binary existence check --- hack/tools/install_or_tools.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index a6b8b13c1..006e90b41 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -25,6 +25,7 @@ case ${os} in esac header_text "Checking for bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" +[[ -f bin/fzn-or-tools ]] && exit 0 # [[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 header_text "Installing bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD} for ${arch}_${target_os}" From 12df6b1436effdad74a047bb2f302c637ed76b82 Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Sun, 22 Jan 2023 11:17:52 +0200 Subject: [PATCH 10/12] add prints --- hack/tools/install_or_tools.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index 006e90b41..738c12870 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -24,9 +24,13 @@ case ${os} in ;; esac -header_text "Checking for bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}" -[[ -f bin/fzn-or-tools ]] && exit 0 -# [[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 +header_text "Checking for bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD} for for ${arch}_${target_os}" +echo "${BUILD_FILE}" +cat "${BUILD_FILE}" +echo "${VERSION_FILE}" +cat "${VERSION_FILE}" + +[[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 header_text "Installing bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD} for ${arch}_${target_os}" mkdir -p ./bin From 87799bf2423ced131ed3d42a83cfcac0f027d058 Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Sun, 22 Jan 2023 12:05:27 +0200 Subject: [PATCH 11/12] prevent errors from cat --- hack/tools/install_or_tools.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index 738c12870..d1f7c2eb9 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -6,8 +6,8 @@ cd "${0%/*}" source ./common.sh -BUILD_FILE=fzn-or-tools-build -VERSION_FILE=fzn-or-tools-version +BUILD_FILE=lib/fzn-or-tools-build +VERSION_FILE=lib/fzn-or-tools-version case ${os} in linux) @@ -26,9 +26,9 @@ esac header_text "Checking for bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD} for for ${arch}_${target_os}" echo "${BUILD_FILE}" -cat "${BUILD_FILE}" +cat "${BUILD_FILE}" || true echo "${VERSION_FILE}" -cat "${VERSION_FILE}" +cat "${VERSION_FILE}" || true [[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 From 309b6b5c781b84c556c015ddbccc54410ea88338 Mon Sep 17 00:00:00 2001 From: Alexey Roytman Date: Sun, 22 Jan 2023 12:58:08 +0200 Subject: [PATCH 12/12] add check OS and arch test --- hack/tools/install_or_tools.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/hack/tools/install_or_tools.sh b/hack/tools/install_or_tools.sh index d1f7c2eb9..90b8189af 100755 --- a/hack/tools/install_or_tools.sh +++ b/hack/tools/install_or_tools.sh @@ -2,11 +2,9 @@ # Copyright 2020 IBM Corp. # SPDX-License-Identifier: Apache-2.0 - cd "${0%/*}" source ./common.sh -BUILD_FILE=lib/fzn-or-tools-build VERSION_FILE=lib/fzn-or-tools-version case ${os} in @@ -24,15 +22,12 @@ case ${os} in ;; esac -header_text "Checking for bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD} for for ${arch}_${target_os}" -echo "${BUILD_FILE}" -cat "${BUILD_FILE}" || true -echo "${VERSION_FILE}" -cat "${VERSION_FILE}" || true +DEPLOY="${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}_for_${arch}_${target_os}" -[[ -f bin/fzn-or-tools ]] && [[ -f "${BUILD_FILE}" ]] && [[ `cat "${BUILD_FILE}"` == "${OR_TOOLS_BUILD}" ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${OR_TOOLS_VERSION}" ]] && exit 0 +header_text "Checking for bin/fzn-or-tools ${DEPLOY}" +[[ -f bin/fzn-or-tools ]] && [[ -f "${VERSION_FILE}" ]] && [[ `cat "${VERSION_FILE}"` == "${DEPLOY}" ]] && exit 0 +header_text "Installing bin/fzn-or-tools ${DEPLOY}" -header_text "Installing bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD} for ${arch}_${target_os}" mkdir -p ./bin mkdir -p ./lib @@ -44,5 +39,4 @@ tar -zxvf ./${download_file} -C $tmp mv $tmp/*/bin/fzn-ortools ./bin/fzn-or-tools mv $tmp/*/lib*/lib*.${dyn_lib_ext}* ./lib chmod +x ./bin/fzn-or-tools -echo ${OR_TOOLS_BUILD} > ${BUILD_FILE} -echo ${OR_TOOLS_VERSION} > ${VERSION_FILE} +echo ${DEPLOY} > ${VERSION_FILE}