From 138a2cc9ee154834e4df99dca2f9738ba4f1a97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chastanet?= Date: Sat, 28 Dec 2024 07:52:48 +0100 Subject: [PATCH] Maintenance bash-tools-framework 6.1.1 - Update github worflows cron scheduling - Update github worflows versions - bash-compiler uses DEFAULT_TEMPLATE_FOLDER - recompiled all binaries to use bash-tools-framework 6.1.1 - updated pre-commit versions --- .bash-compiler | 2 +- .cspell/softwares.txt | 2 ++ .github/dependabot.yml | 4 +++- .github/workflows/docsify-gh-pages.yml | 2 +- .github/workflows/lint-test.yml | 14 +++++++------- .github/workflows/precommit-autoupdate.yml | 4 ++-- .mega-linter-githubAction.yml | 2 +- .pre-commit-config-github.yaml | 16 +++++++++++++--- .pre-commit-config.yaml | 16 +++++++++++++--- bin/cli | 13 ++++++++++++- bin/dbImport | 13 ++++++++++++- bin/dbImportProfile | 13 ++++++++++++- bin/dbImportStream | 13 ++++++++++++- bin/dbQueryAllDatabases | 13 ++++++++++++- bin/dbScriptAllDatabases | 13 ++++++++++++- bin/doc | 13 ++++++++++++- bin/gitIsAncestorOf | 13 ++++++++++++- bin/gitIsBranch | 13 ++++++++++++- bin/gitRenameBranch | 13 ++++++++++++- bin/installRequirements | 13 ++++++++++++- bin/mysql2puml | 13 ++++++++++++- bin/postmanCli | 13 ++++++++++++- bin/upgradeGithubRelease | 13 ++++++++++++- bin/waitForIt | 13 ++++++++++++- bin/waitForMysql | 13 ++++++++++++- conf/dbScripts/extractData | 13 ++++++++++++- install | 13 ++++++++++++- 27 files changed, 259 insertions(+), 37 deletions(-) diff --git a/.bash-compiler b/.bash-compiler index 825ed727..8e514680 100644 --- a/.bash-compiler +++ b/.bash-compiler @@ -1,3 +1,3 @@ FRAMEWORK_ROOT_DIR=${ROOT_DIR}/vendor/bash-tools-framework BASH_TOOLS_ROOT_DIR=${ROOT_DIR} -TEMPLATES_ROOT_DIR=${HOME}/fchastanet/bash-compiler/examples/templates +TEMPLATES_ROOT_DIR=${DEFAULT_TEMPLATE_FOLDER} diff --git a/.cspell/softwares.txt b/.cspell/softwares.txt index 68d3bb93..de601671 100644 --- a/.cspell/softwares.txt +++ b/.cspell/softwares.txt @@ -130,6 +130,7 @@ pcmanfm phpmd phpstorm Phpstorm +pipx pixbuf plantuml Plantuml @@ -181,3 +182,4 @@ xsession Xsrv xvfb Xvfb +yapf diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9ef12bc8..9e670394 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,6 +6,8 @@ updates: directory: "/" schedule: # Check for updates to GitHub Actions every week - interval: "weekly" + interval: "monthly" day: "friday" + time: "22:00" + timezone: "Europe/Paris" open-pull-requests-limit: 1 diff --git a/.github/workflows/docsify-gh-pages.yml b/.github/workflows/docsify-gh-pages.yml index e82f4a50..b8dee14a 100644 --- a/.github/workflows/docsify-gh-pages.yml +++ b/.github/workflows/docsify-gh-pages.yml @@ -42,7 +42,7 @@ jobs: ./bin/doc --ci - name: Setup Pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index a06b11d4..981ccc65 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -49,7 +49,7 @@ jobs: # needed by megalinter pull-requests: write steps: - - uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6 + - uses: ouzi-dev/commit-status-updater@v2 with: name: build-bash-tools status: pending @@ -81,7 +81,7 @@ jobs: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - - uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6 + - uses: ouzi-dev/commit-status-updater@v2 with: name: pre-commit-megalinter status: pending @@ -171,7 +171,7 @@ jobs: env.COND_UPDATED_SOURCES == 'true' && env.COND_APPLY_FIXES_NEEDED == 'true' && !contains(github.event.head_commit.message, 'skip fix') - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: token: ${{ steps.generate-token.outputs.token }} committer: fchastanet @@ -191,7 +191,7 @@ jobs: echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" - - uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6 + - uses: ouzi-dev/commit-status-updater@v2 if: ${{ always() }} with: name: pre-commit-megalinter @@ -246,7 +246,7 @@ jobs: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - - uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6 + - uses: ouzi-dev/commit-status-updater@v2 with: name: unit-tests-${{matrix.vendor}}-${{matrix.bashTarVersion}} status: pending @@ -315,7 +315,7 @@ jobs: path: | logs/** - - uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6 + - uses: ouzi-dev/commit-status-updater@v2 with: name: unit-tests-${{matrix.vendor}}-${{matrix.bashTarVersion}} status: ${{ job.status }} @@ -334,7 +334,7 @@ jobs: # You can get the conclusion via env (env.WORKFLOW_CONCLUSION) - uses: AbsoLouie/workflow-conclusion-status@v1.0.2 - - uses: akatov/commit-status-updater@a9e988ec5454692ff7745a509452422a35172ad6 + - uses: ouzi-dev/commit-status-updater@v2 with: name: build-bash-tools # neutral, success, skipped, cancelled, timed_out, action_required, failure diff --git a/.github/workflows/precommit-autoupdate.yml b/.github/workflows/precommit-autoupdate.yml index bdc986d6..1113f535 100644 --- a/.github/workflows/precommit-autoupdate.yml +++ b/.github/workflows/precommit-autoupdate.yml @@ -5,7 +5,7 @@ on: # yamllint disable-line rule:truthy workflow_dispatch: schedule: # https://crontab.cronhub.io/ - - cron: "30 10 * * *" + - cron: "30 22 1-7 */3 FRI" jobs: auto-update: runs-on: ubuntu-22.04 @@ -37,7 +37,7 @@ jobs: private_key: ${{ secrets.APP_PRIVATE_KEY }} - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: token: ${{ steps.generate-token.outputs.token }} committer: fchastanet diff --git a/.mega-linter-githubAction.yml b/.mega-linter-githubAction.yml index e28dff17..55d1ab02 100644 --- a/.mega-linter-githubAction.yml +++ b/.mega-linter-githubAction.yml @@ -1,7 +1,7 @@ --- EXTENDS: - .mega-linter.yml -DISABLE: +DISABLE_LINTERS: - BASH_SHELLCHECK SHOW_ELAPSED_TIME: false VALIDATE_ALL_CODEBASE: true diff --git a/.pre-commit-config-github.yaml b/.pre-commit-config-github.yaml index 421ced7d..1493ab4f 100644 --- a/.pre-commit-config-github.yaml +++ b/.pre-commit-config-github.yaml @@ -9,6 +9,16 @@ default_stages: [pre-commit, manual] minimum_pre_commit_version: 3.5.0 fail_fast: false repos: + # enables pre-commit to install the hooks using pipx + - repo: https://github.com/pypa/pipx + rev: 1.7.1 + hooks: + - id: pipx + alias: yapf + name: yapf + args: ["yapf", "-i"] + types: ["python"] + - repo: local # this hook is not intended to be run on github # it just allows to generate the same pre-commit @@ -25,7 +35,7 @@ repos: - repo: https://github.com/executablebooks/mdformat # Do this before other tools "fixing" the line endings - rev: 0.7.19 + rev: 0.7.21 hooks: - id: mdformat name: Format Markdown @@ -161,7 +171,7 @@ repos: exclude: /testsData/ - repo: https://github.com/fchastanet/bash-tools-framework - rev: 6.0.0 + rev: 6.1.1 hooks: - id: fixShebangExecutionBit - id: awkLint @@ -210,6 +220,6 @@ repos: stages: [manual] # GITHUB - repo: https://github.com/fchastanet/bash-compiler - rev: v3.0.0 + rev: 3.1.2 hooks: - id: buildBashBinaries diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f308bbfb..463f8ef9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,16 @@ default_stages: [pre-commit, manual] minimum_pre_commit_version: 3.5.0 fail_fast: true repos: + # enables pre-commit to install the hooks using pipx + - repo: https://github.com/pypa/pipx + rev: 1.7.1 + hooks: + - id: pipx + alias: yapf + name: yapf + args: ["yapf", "-i"] + types: ["python"] + - repo: local # this hook is not intended to be run on github # it just allows to generate the same pre-commit @@ -20,7 +30,7 @@ repos: - repo: https://github.com/executablebooks/mdformat # Do this before other tools "fixing" the line endings - rev: 0.7.19 + rev: 0.7.21 hooks: - id: mdformat name: Format Markdown @@ -156,7 +166,7 @@ repos: exclude: /testsData/ - repo: https://github.com/fchastanet/bash-tools-framework - rev: 6.0.0 + rev: 6.1.1 hooks: - id: fixShebangExecutionBit - id: awkLint @@ -205,6 +215,6 @@ repos: stages: [] # GITHUB - repo: https://github.com/fchastanet/bash-compiler - rev: v3.0.0 + rev: 3.1.2 hooks: - id: buildBashBinaries diff --git a/bin/cli b/bin/cli index f329b68b..b0b49852 100755 --- a/bin/cli +++ b/bin/cli @@ -801,6 +801,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -809,7 +810,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/dbImport b/bin/dbImport index 48705d79..1807ba5b 100755 --- a/bin/dbImport +++ b/bin/dbImport @@ -1031,6 +1031,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -1039,7 +1040,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/dbImportProfile b/bin/dbImportProfile index 5a81bafc..a86b53b1 100755 --- a/bin/dbImportProfile +++ b/bin/dbImportProfile @@ -910,6 +910,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -918,7 +919,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/dbImportStream b/bin/dbImportStream index 4cd87707..29007f2c 100755 --- a/bin/dbImportStream +++ b/bin/dbImportStream @@ -938,6 +938,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -946,7 +947,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/dbQueryAllDatabases b/bin/dbQueryAllDatabases index 7cf6d504..de3b476b 100755 --- a/bin/dbQueryAllDatabases +++ b/bin/dbQueryAllDatabases @@ -988,6 +988,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -996,7 +997,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/dbScriptAllDatabases b/bin/dbScriptAllDatabases index 61572dab..cc13251e 100755 --- a/bin/dbScriptAllDatabases +++ b/bin/dbScriptAllDatabases @@ -890,6 +890,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -898,7 +899,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/doc b/bin/doc index 020cb164..f2edb486 100755 --- a/bin/doc +++ b/bin/doc @@ -728,6 +728,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -736,7 +737,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/gitIsAncestorOf b/bin/gitIsAncestorOf index 02879ac5..9673cdb2 100755 --- a/bin/gitIsAncestorOf +++ b/bin/gitIsAncestorOf @@ -571,6 +571,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -579,7 +580,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/gitIsBranch b/bin/gitIsBranch index 8572d4e5..caa4c10c 100755 --- a/bin/gitIsBranch +++ b/bin/gitIsBranch @@ -571,6 +571,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -579,7 +580,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/gitRenameBranch b/bin/gitRenameBranch index ea236017..e17340c7 100755 --- a/bin/gitRenameBranch +++ b/bin/gitRenameBranch @@ -571,6 +571,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -579,7 +580,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/installRequirements b/bin/installRequirements index 8f9ee853..6172f0a3 100755 --- a/bin/installRequirements +++ b/bin/installRequirements @@ -601,6 +601,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -609,7 +610,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/mysql2puml b/bin/mysql2puml index 1b89a0bf..96620a01 100755 --- a/bin/mysql2puml +++ b/bin/mysql2puml @@ -732,6 +732,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -740,7 +741,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/postmanCli b/bin/postmanCli index 3d6a6f88..26c04425 100755 --- a/bin/postmanCli +++ b/bin/postmanCli @@ -570,6 +570,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -578,7 +579,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/upgradeGithubRelease b/bin/upgradeGithubRelease index ad4433e1..11fc332d 100755 --- a/bin/upgradeGithubRelease +++ b/bin/upgradeGithubRelease @@ -709,6 +709,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -717,7 +718,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/waitForIt b/bin/waitForIt index e9d6e8e5..e262709d 100755 --- a/bin/waitForIt +++ b/bin/waitForIt @@ -578,6 +578,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -586,7 +587,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/bin/waitForMysql b/bin/waitForMysql index 95404813..37a7e4a5 100755 --- a/bin/waitForMysql +++ b/bin/waitForMysql @@ -561,6 +561,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -569,7 +570,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/conf/dbScripts/extractData b/conf/dbScripts/extractData index a461ca80..f802cbad 100755 --- a/conf/dbScripts/extractData +++ b/conf/dbScripts/extractData @@ -827,6 +827,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -835,7 +836,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034 diff --git a/install b/install index 359a2749..16933a6a 100755 --- a/install +++ b/install @@ -558,6 +558,7 @@ Log::computeDuration() { if ((${DISPLAY_DURATION:-0} == 1)); then local -i duration=0 local -i delta=0 + local durationStr deltaStr local -i currentLogDate currentLogDate="${EPOCHREALTIME/[^0-9]/}" if ((LOG_LAST_LOG_DATE_INIT == 1)); then @@ -566,7 +567,17 @@ Log::computeDuration() { else duration=$(((currentLogDate - FIRST_LOG_DATE) / 1000000)) delta=$(((currentLogDate - LOG_LAST_LOG_DATE) / 1000000)) - LOG_LAST_DURATION_STR="${duration}s/+${delta}s" + if ((duration > 59)); then + durationStr=$(date -ud "@${duration}" +'%H:%M:%S') + else + durationStr="${duration}s" + fi + if ((delta > 59)); then + deltaStr=$(date -ud "@${delta}" +'%H:%M:%S') + else + deltaStr="${delta}s" + fi + LOG_LAST_DURATION_STR="${durationStr}/+${deltaStr}" fi LOG_LAST_LOG_DATE="${currentLogDate}" # shellcheck disable=SC2034