From 33dfc1367286c92f90a1a484bcd3ba58d02f556e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 16:13:32 +0200 Subject: [PATCH 1/9] spcd_dl --- spcd.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/spcd.sh b/spcd.sh index f7aec42..ac7cf4c 100644 --- a/spcd.sh +++ b/spcd.sh @@ -514,10 +514,12 @@ ${SPCD_PYTHON_VENV}/lib/${SPCD_PYTHON_COMMAND}/site-packages" spcd_split spcd_echo "SPCD_PYTHON_PACKAGES" "SPCD_PYTHON_VENV_PACKAGES" # variables + # certificate authorities [ -n "${SPCD_CA_1}" ] && SPCD_CA=true - # + # downloads + SPCD_DL="$(mktemp --directory)" spcd_split - spcd_echo "SPCD_CA" + spcd_echo "SPCD_CA" "SPCD_DL" } spcd_list_working_directory() { @@ -711,9 +713,7 @@ index-url = ${SPCD_URL_PYTHON} spcd_install_python_modules() { spcd_step "Install Python modules" - spcd_ipm__root="$(mktemp --directory)" || exit spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}" - echo "→ ${spcd_ipm__root}" for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do spcd_ipm__url="$(spcd_get_git_url "${spcd_ipm__repository}")" spcd_ipm__name="$(basename "${spcd_ipm__url}")" @@ -723,9 +723,9 @@ ${spcd_ipm__url} ↓" git clone \ "${spcd_ipm__url}" \ - "${spcd_ipm__root}/${spcd_ipm__name}" || + "${SPCD_DL}/${spcd_ipm__name}" || exit - spcd_ipm__path="${spcd_ipm__root}/${spcd_ipm__name}/${spcd_ipm__name}" + spcd_ipm__path="${SPCD_DL}/${spcd_ipm__name}/${spcd_ipm__name}" echo "\ ${spcd_ipm__path} ↓ @@ -733,10 +733,10 @@ ${spcd_ipm__target}" cp --recursive "${spcd_ipm__path}" "${spcd_ipm__target}" || exit # check matching of file and variable - spcd_ipm__script="${spcd_ipm__root}/${spcd_ipm__name}/spcd.sh" + spcd_ipm__script="${SPCD_DL}/${spcd_ipm__name}/spcd.sh" if [ -f "${spcd_ipm__script}" ]; then spcd_split - spcd_ipm__check="${spcd_ipm__root}/check.${SPCD_CMD_SUM}" + spcd_ipm__check="${SPCD_DL}/check.${SPCD_CMD_SUM}" "${SPCD_CMD_SUM}" "${spcd_ipm__script}" >"${spcd_ipm__check}" printf "%s" "${SPCD}" >"${spcd_ipm__script}" ls -l "${spcd_ipm__script}" @@ -747,8 +747,6 @@ ${spcd_ipm__target}" done spcd_split spcd_ls "${spcd_ipm__target}" - spcd_split - spcd_rm "${spcd_ipm__root}" } spcd_install_packages() { From 9c2c83460347ffe69cd77dd41edba1f080d51959 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 17:00:06 +0200 Subject: [PATCH 2/9] spcd_git_url --- spcd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spcd.sh b/spcd.sh index ac7cf4c..ac1e6f4 100644 --- a/spcd.sh +++ b/spcd.sh @@ -715,7 +715,7 @@ spcd_install_python_modules() { spcd_step "Install Python modules" spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}" for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do - spcd_ipm__url="$(spcd_get_git_url "${spcd_ipm__repository}")" + spcd_ipm__url="$(spcd_git_url "${spcd_ipm__repository}")" spcd_ipm__name="$(basename "${spcd_ipm__url}")" spcd_split echo "\ @@ -880,7 +880,7 @@ spcd_error_os() { exit "${SPCD_ERROR_OS}" } -spcd_get_git_url() { +spcd_git_url() { if [ -n "${1}" ]; then case "${1}" in http*) echo "${1}" ;; From 433f5a98fbbc62b910eff3a00a474aeb0399624c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 17:01:05 +0200 Subject: [PATCH 3/9] =?UTF-8?q?readme/=E2=86=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 96ea799..df16de3 100644 --- a/readme.md +++ b/readme.md @@ -211,10 +211,6 @@ Handle project workflows in a unified way: ## When -### First - -* try git repo url variable first for shunit - ### Shell * fit banner to text @@ -258,6 +254,7 @@ Handle project workflows in a unified way: * set workflow templates * actions * includes +* try git repo url variable first for shunit * write unit tests ### Later From db2276ea4a0e6fd634bbe725e3220a2c5569dbab Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 17:02:03 +0200 Subject: [PATCH 4/9] readme/task --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index df16de3..6955d82 100644 --- a/readme.md +++ b/readme.md @@ -260,4 +260,5 @@ Handle project workflows in a unified way: ### Later * automate versions fetching +* generate graphs * turn readme into documentation From 582900d46b4f0236e250395531c0ffb7c43b80ff Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 17:03:22 +0200 Subject: [PATCH 5/9] readme/task --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 6955d82..96562cb 100644 --- a/readme.md +++ b/readme.md @@ -213,6 +213,7 @@ Handle project workflows in a unified way: ### Shell +* comment * fit banner to text * review repositories handling for systems * opensuse From 488f8513d315d15ecc79b70a9eda0b89bdc359ec Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 17:26:28 +0200 Subject: [PATCH 6/9] spcd_git_clone --- readme.md | 1 - spcd.sh | 28 ++++++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/readme.md b/readme.md index 96562cb..7d6e3c9 100644 --- a/readme.md +++ b/readme.md @@ -219,7 +219,6 @@ Handle project workflows in a unified way: * opensuse * codecs repository * disable & enable https -* write function to clone git repositories * write unit tests ### Shell → Python diff --git a/spcd.sh b/spcd.sh index ac1e6f4..331dea6 100644 --- a/spcd.sh +++ b/spcd.sh @@ -715,17 +715,10 @@ spcd_install_python_modules() { spcd_step "Install Python modules" spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}" for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do - spcd_ipm__url="$(spcd_git_url "${spcd_ipm__repository}")" - spcd_ipm__name="$(basename "${spcd_ipm__url}")" spcd_split - echo "\ -${spcd_ipm__url} -↓" - git clone \ - "${spcd_ipm__url}" \ - "${SPCD_DL}/${spcd_ipm__name}" || - exit - spcd_ipm__path="${SPCD_DL}/${spcd_ipm__name}/${spcd_ipm__name}" + spcd_ipm__path="$(spcd_git_clone "${spcd_ipm__repository}")" + spcd_ipm__name="$(basename "${spcd_ipm__path}")" + spcd_ipm__path="${spcd_ipm__path}/${spcd_ipm__name}" echo "\ ${spcd_ipm__path} ↓ @@ -880,6 +873,21 @@ spcd_error_os() { exit "${SPCD_ERROR_OS}" } +spcd_git_clone() { + if [ -n "${1}" ]; then + spcd_gc__name="$(basename "${1}")" + spcd_gc__path="${SPCD_DL}/${spcd_gc__name}" + spcd_gc__url="$(spcd_git_url "${1}")" + echo "\ +${spcd_gc__url} +↓" + git clone \ + "${spcd_gc__url}" \ + "${spcd_gc__path}" + echo "${spcd_gc__path}" + fi +} + spcd_git_url() { if [ -n "${1}" ]; then case "${1}" in From 688fd59dd9a3677eb06a83d50bdad98a04eb1c57 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 17:28:34 +0200 Subject: [PATCH 7/9] readme/diffs --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 7d6e3c9..08f857f 100644 --- a/readme.md +++ b/readme.md @@ -260,5 +260,6 @@ Handle project workflows in a unified way: ### Later * automate versions fetching +* document behavior differences * generate graphs * turn readme into documentation From 44ae59fed866505249fe6dc5281ae377cc975c62 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 18:07:41 +0200 Subject: [PATCH 8/9] spcd_pip_install --- spcd.sh | 55 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/spcd.sh b/spcd.sh index 331dea6..59ceab2 100644 --- a/spcd.sh +++ b/spcd.sh @@ -714,30 +714,24 @@ index-url = ${SPCD_URL_PYTHON} spcd_install_python_modules() { spcd_step "Install Python modules" spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}" - for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do + spcd_ls "${spcd_ipm__target}" + spcd_split + spcd_ipm__path="$(spcd_pip_install "${SPCD_GIT_MAIN}")" + # check matching of file and variable + spcd_ipm__script="${spcd_ipm__path}/main.sh" + if [ -f "${spcd_ipm__script}" ]; then spcd_split - spcd_ipm__path="$(spcd_git_clone "${spcd_ipm__repository}")" - spcd_ipm__name="$(basename "${spcd_ipm__path}")" - spcd_ipm__path="${spcd_ipm__path}/${spcd_ipm__name}" - echo "\ -${spcd_ipm__path} -↓ -${spcd_ipm__target}" - cp --recursive "${spcd_ipm__path}" "${spcd_ipm__target}" || - exit - # check matching of file and variable - spcd_ipm__script="${SPCD_DL}/${spcd_ipm__name}/spcd.sh" - if [ -f "${spcd_ipm__script}" ]; then - spcd_split - spcd_ipm__check="${SPCD_DL}/check.${SPCD_CMD_SUM}" - "${SPCD_CMD_SUM}" "${spcd_ipm__script}" >"${spcd_ipm__check}" - printf "%s" "${SPCD}" >"${spcd_ipm__script}" - ls -l "${spcd_ipm__script}" - dos2unix "${spcd_ipm__script}" - ls -l "${spcd_ipm__script}" - "${SPCD_CMD_SUM}" -c "${spcd_ipm__check}" || spcd_error_ci "SPCD" - fi - done + ls -l "${spcd_ipm__script}" + spcd_ipm__check="${spcd_ipm__script}.${SPCD_CMD_SUM}" + "${SPCD_CMD_SUM}" "${spcd_ipm__script}" >"${spcd_ipm__check}" + printf "%s" "${SPCD}" >"${spcd_ipm__script}" + ls -l "${spcd_ipm__script}" + dos2unix "${spcd_ipm__script}" + ls -l "${spcd_ipm__script}" + "${SPCD_CMD_SUM}" -c "${spcd_ipm__check}" || spcd_error_ci "SPCD" + fi + spcd_split + spcd_pip_install "${SPCD_GIT_ROOT}" spcd_split spcd_ls "${spcd_ipm__target}" } @@ -954,6 +948,21 @@ spcd_openssl() { fi } +spcd_pip_install() { + if [ -n "${1}" ]; then + spcd_pi__name="$(basename "${1}")" + spcd_pi__path="$(spcd_git_clone "${1}")" + spcd_pi__path="${spcd_pi__path}/${spcd_pi__name}" + spcd_pi__target="${SPCD_PYTHON_VENV_PACKAGES}" + echo "\ +${spcd_pi__path} +↓ +${spcd_pi__target}" + cp --recursive "${spcd_pi__path}" "${spcd_pi__target}" + echo "${spcd_pi__target}/${spcd_pi__name}" + fi +} + spcd_rm() { spcd_rm__path="${1}" if [ -e "${spcd_rm__path}" ]; then From 7d074f45881e58489b1d44c47281ab16efac9760 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 18:08:29 +0200 Subject: [PATCH 9/9] spcd/main.sh --- spcd.sh => spcd/main.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spcd.sh => spcd/main.sh (100%) diff --git a/spcd.sh b/spcd/main.sh similarity index 100% rename from spcd.sh rename to spcd/main.sh