Skip to content

Commit

Permalink
BUG FIX: Prepending ports, e.g. port4me --prepend=<ports>, did not …
Browse files Browse the repository at this point in the history
…work since version 0.4.0. Any ports specified where ignored.
  • Loading branch information
HenrikBengtsson committed Jun 21, 2023
1 parent 1734be6 commit e8d9024
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion bash/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Version (development version)

* ...
## Bug Fixes

* Prepending ports, e.g. `port4me --prepend=<ports>`, did not
work since version 0.4.0. Any ports specified where ignored.


# Version 0.5.1 [2023-03-23]
Expand Down
12 changes: 8 additions & 4 deletions bash/incl/port4me.bash
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' PORT4ME_LIST=5 port4me
#' PORT4ME_TEST=4321 port4me
#'
#' Version: 0.5.0-9001
#' Version: 0.5.1-9002
#' Copyright: Henrik Bengtsson (2022-2023)
#' License: ISC
#' Source code: https://github.com/HenrikBengtsson/port4me
Expand Down Expand Up @@ -248,6 +248,13 @@ port4me() {
prepend=("${prepend[@]:1}") ## drop first element
else
_p4m_lcg > /dev/null

## Skip?
if (( LCG_SEED < 1024 || LCG_SEED > 65535 )); then
${PORT4ME_DEBUG:-false} && >&2 printf "Skip to next, because LCG_SEED is out of range: %d\n" "$LCG_SEED"
continue
fi

port=${LCG_SEED:?}
${PORT4ME_DEBUG:-false} && >&2 printf "Port drawn: %d\n" "$port"
fi
Expand All @@ -266,9 +273,6 @@ port4me() {
${PORT4ME_DEBUG:-false} && >&2 printf "Port not included: %d\n" "$port"
continue
fi
elif (( LCG_SEED < 1024 || LCG_SEED > 65535 )); then
${PORT4ME_DEBUG:-false} && >&2 printf "Port skipped, because LCG_SEED is out of range: %d\n" "$LCG_SEED"
continue
fi

tries=$(( tries + 1 ))
Expand Down
2 changes: 1 addition & 1 deletion bash/port4me
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#'
#' port4me --test=8087
#'
#' Version: 0.5.1-9000
#' Version: 0.5.1-9002
#' Copyright: Henrik Bengtsson (2022-2023)
#' License: ISC

Expand Down

0 comments on commit e8d9024

Please sign in to comment.