From a2a4a0c6876caf9e52ec6632f803ae40f24d7222 Mon Sep 17 00:00:00 2001 From: Henrik Bengtsson Date: Tue, 16 Jan 2024 08:05:40 -0800 Subject: [PATCH 1/4] README: tweak [ci skip] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ca8ec32..988b45e 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,11 @@ The **[port4me]** tool: * requires no configuration -* is implemented in Bash, Python, and R - * can be reproduced perfectly on all operating systems and in all common programming languages +* Available for Bash, Python, and R + ## Introduction From 1cf3c80f299145060f482d237bb0d15ad44fe6a5 Mon Sep 17 00:00:00 2001 From: Henrik Bengtsson Date: Tue, 16 Jan 2024 10:31:18 -0800 Subject: [PATCH 2/4] Bash: port4me --help now infers the version from the port4me.bash script; this way the version number only has be updated there --- bash/port4me | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bash/port4me b/bash/port4me index dc2abe8..986b0bf 100755 --- a/bash/port4me +++ b/bash/port4me @@ -43,7 +43,7 @@ #' Requirements: #' * Bash (>= 4) #' -#' Version: 0.7.0 +#' Version: {{ version }} #' Copyright: Henrik Bengtsson (2022-2024) #' License: MIT @@ -61,14 +61,16 @@ source "${incl}/port4me.bash" # CLI utility functions # ------------------------------------------------------------------------- function _p4me_version { - grep -E "^#'[ ]*Version:[ ]*" "$0" | sed "s/#'[ ]*Version:[ ]*//g" + local version + version=$(grep -E "^#'[ ]*Version:[ ]*" "${incl}/port4me.bash" | sed "s/#'[ ]*Version:[ ]*//g") + echo "${version}" } function _p4me_help { local what res what=$1 - res=$(grep "^#'" "$0" | cut -b 4-) + res=$(grep "^#'" "$0" | cut -b 4- | sed -E "s/[{][{] version [}][}]/$(_p4me_version)/") if [[ $what == "full" ]]; then res=$(echo "$res" | sed '/^---/d') From 01d7af2ac631159cabe06090277209d81c10d019 Mon Sep 17 00:00:00 2001 From: Henrik Bengtsson Date: Tue, 16 Jan 2024 10:35:16 -0800 Subject: [PATCH 3/4] Bash: BUG FIX: _p4m_lcg_port() would try to output debug messages to file descriptor 3 (not 2 as in stderr). This was a left over from debugging via Bats. It would also only look at ${PORT4ME_DEBUG}, when it should have been ${PORT4ME_DEBUG:-false} --- bash/NEWS.md | 7 +++++++ bash/incl/port4me.bash | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bash/NEWS.md b/bash/NEWS.md index ebb9536..07ef956 100644 --- a/bash/NEWS.md +++ b/bash/NEWS.md @@ -1,3 +1,10 @@ +# Version (development version) + +## Bug Fixes + + * ... + + # Version 0.7.0 [2024-01-15] ## Significant Changes diff --git a/bash/incl/port4me.bash b/bash/incl/port4me.bash index f0b7513..f0d46db 100644 --- a/bash/incl/port4me.bash +++ b/bash/incl/port4me.bash @@ -38,7 +38,7 @@ #' Requirements: #' * Bash (>= 4) #' -#' Version: 0.7.0 +#' Version: 0.7.0-9001 #' Copyright: Henrik Bengtsson (2022-2024) #' License: MIT #' Source code: https://github.com/HenrikBengtsson/port4me @@ -293,11 +293,11 @@ _p4m_lcg_port() { has_subset=true fi - if ${PORT4ME_DEBUG}; then + if ${PORT4ME_DEBUG:-false}; then { echo "(min,max): ($min,$max)" echo "subset: [n=${#subset[@]}]" - } >&3 + } fi ## Sample values in [0,m-2] (sic!), but reject until in [min,max], From 7f1bcb1527108296561a0c3acb016ff66a1e669e Mon Sep 17 00:00:00 2001 From: Henrik Bengtsson Date: Tue, 16 Jan 2024 10:47:34 -0800 Subject: [PATCH 4/4] BUG FIX: 'port4me' for Bash could generate error `port4me.bash: line 275: 3: Bad file descriptor`. This was due to left-over debugging code. --- Makefile | 4 ++-- README.md | 4 ++-- bash/NEWS.md | 5 +++-- bash/incl/port4me.bash | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2ddf717..30ad039 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SHELL=bash -VERSION=0.7.0 -OLD_VERSION=0.6.0 +VERSION=0.7.1 +OLD_VERSION=0.7.0 check: check-cli (cd bash; make check) diff --git a/README.md b/README.md index 988b45e..0d92805 100644 --- a/README.md +++ b/README.md @@ -321,7 +321,7 @@ error (stderr), which can be seen in the terminal. For example, To install the Bash version of **portme**, do: ```sh -VERSION=0.7.0 +VERSION=0.7.1 curl -L -O https://github.com/HenrikBengtsson/port4me/archive/refs/tags/"${VERSION}.tar.gz" tar -x -f "${VERSION}.tar.gz" export PREFIX=/path/to/port4me/ ## must be an absolute path to a folder @@ -333,7 +333,7 @@ Then run it as: ```sh $ export PATH=/path/to/port4me/bin:$PATH $ port4me --version -0.7.0 +0.7.1 ``` ### R package diff --git a/bash/NEWS.md b/bash/NEWS.md index 07ef956..07e1e61 100644 --- a/bash/NEWS.md +++ b/bash/NEWS.md @@ -1,8 +1,9 @@ -# Version (development version) +# Version 0.7.1 [2024-01-16] ## Bug Fixes - * ... + * `port4me` could generate error `port4me.bash: line 275: 3: Bad file + descriptor`. This was due to left-over debugging code. # Version 0.7.0 [2024-01-15] diff --git a/bash/incl/port4me.bash b/bash/incl/port4me.bash index f0d46db..a90e165 100644 --- a/bash/incl/port4me.bash +++ b/bash/incl/port4me.bash @@ -38,7 +38,7 @@ #' Requirements: #' * Bash (>= 4) #' -#' Version: 0.7.0-9001 +#' Version: 0.7.1 #' Copyright: Henrik Bengtsson (2022-2024) #' License: MIT #' Source code: https://github.com/HenrikBengtsson/port4me