Skip to content

Commit

Permalink
fix astyle version check
Browse files Browse the repository at this point in the history
(cherry picked from commit dee284f)
  • Loading branch information
jef-n committed Apr 24, 2018
1 parent 120d5b1 commit 41b6ae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/astyle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit 41b6ae6

@domi4484
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.