Skip to content
Permalink
Browse files
fix astyle version check
(cherry picked from commit dee284f)
  • Loading branch information
jef-n committed Apr 24, 2018
1 parent 120d5b1 commit 41b6ae6d5866f4b4a2e3e918d8c47fdfe20b7721
Showing with 1 addition and 1 deletion.
  1. +1 −1 scripts/astyle.sh
@@ -22,7 +22,7 @@ fi

min_version="3"
astyle_version_check() {
[ `printf "$($1 --version | cut -d ' ' -f4)\n$min_version" | sort -${SV} | head -n1` = "$min_version" ]
[ `printf "$($1 --version 2>&1 | cut -d ' ' -f4)\n$min_version" | sort -${SV} | head -n1` = "$min_version" ]
}

for ASTYLE in ${QGISSTYLE} $(dirname $0)/qgisstyle $(dirname $0)/RelWithDebInfo/qgisstyle astyle

1 comment on commit 41b6ae6

@domi4484

This comment has been minimized.

Copy link
Contributor

@domi4484 domi4484 commented on 41b6ae6 Feb 3, 2021

Hallo @jef-n, on my system astyle is complaining that he can't set the correct locale and always print some lines to stderr. Nothing important but because the sterr get redirected to stdout the version check does not work correctly in my case.
Why is this redirect needed?
If the redirect is still needed I would add something like "| tail -n 1 |" to keep only last line which actually contains the version. But I am not sure if it could broke something?
[ $(printf "$($1 --version 2>&1 | tail -n 1 | cut -d ' ' -f4)\\n$min_version" | sort -${SV} | head -n1) = "$min_version" ]

Please sign in to comment.