modulecmd: bugfix in testing tty

This commit is contained in:
2024-04-17 14:54:51 +02:00
parent abb7ab1298
commit dab07c8a07
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -4,19 +4,19 @@
### modulecmd
* arguments to CMake and autotools can now be defined in the
YAML configuration file. (issue #249, #253)
* Required patches can now be defined in the YAML configuration
file (issue #249)
* BUGFIX: parsing the version number and setting the variables
V_MAJOR, V_MINOR, V_PATCHLVL was broken in cases where the
version number consist of less then three numbers and plus a
suffix. (issue #248)
* BUGFIX: don't abbreviate out of search if not running in a
terminal. (issue #250)
terminal. (issues #250,#255)
### build-system
* Option '--clean-install' added. If this option is set, the
module is removed before building, if the module already
exist. (issue #247)
* Required patches can now be defined in the YAML configuration
file (issue #249)
* Check added whether all required group dependencies are
specified and also not more than required. (issue #251)
* The number of directory components to be removed while
+4 -4
View File
@@ -1271,7 +1271,7 @@ subcommand_avail() {
# get number of columns of terminal, set to a default if not running
# in a terminal.
local -i cols=80
[[ -t 1 -a -t 2 ]] && cols=$(tput cols)
[[ -t 1 && -t 2 ]] && cols=$(tput cols)
#......................................................................
output_header() {
@@ -2118,7 +2118,7 @@ subcommand_list() {
colsize+=2
local -i cols=80
[[ -t 1 -a -t 2 ]] && cols=$(${tput} cols)
[[ -t 1 && -t 2 ]] && cols=$(${tput} cols)
local -i column=0
printf "Currently Loaded Modules:\n" 1>&2
for s in "${strs[@]}"; do
@@ -2300,7 +2300,7 @@ subcommand_search() {
local groups=()
local with_modules='//'
local -i cols=80
[[ -t 1 -a -t 2 ]] && cols=$(${tput} cols) # get number of columns of terminal
[[ -t 1 && -t 2 ]] && cols=$(${tput} cols) # get number of columns of terminal
local -i max_len_modulename=0
local src_prefix=()
local opt_print_header='yes'
@@ -2348,7 +2348,7 @@ subcommand_search() {
print_line_default() {
write_line() {
local str="$1"
if [[ -t 1 -1 -t 2 ]] && (( ${#str} >= cols )); then
if [[ -t 1 && -t 2 ]] && (( ${#str} >= cols )); then
str="${str:0:$((cols-1))}>"
fi
std::info "${str}"