* debian/control, usr/bin/byobu-select-profile: LP: #1166416

- hardcode a use of gawk (for hex calculations)
This commit is contained in:
Dustin Kirkland 2013-05-08 13:06:03 -05:00
commit 13cd75ab38
3 changed files with 9 additions and 2 deletions

2
debian/changelog vendored
View file

@ -4,6 +4,8 @@ byobu (5.40) unreleased; urgency=low
- use byobu's tmux-screen-keys.conf - use byobu's tmux-screen-keys.conf
* debian/postinst: LP: #1174537 * debian/postinst: LP: #1174537
- drop the env python changes in the postinst - drop the env python changes in the postinst
* debian/control, usr/bin/byobu-select-profile: LP: #1166416
- hardcode a use of gawk (for hex calculations)
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 07 May 2013 22:01:40 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Tue, 07 May 2013 22:01:40 -0500

3
debian/control vendored
View file

@ -17,7 +17,8 @@ Depends:
gettext-base, gettext-base,
python, python,
python-newt (>= 0.52.2-11), python-newt (>= 0.52.2-11),
tmux (>= 1.5) | screen tmux (>= 1.5) | screen,
gawk
Recommends: Recommends:
screen, screen,
tmux (>= 1.5), tmux (>= 1.5),

View file

@ -186,8 +186,12 @@ setcolor_screen() {
get_contrast() { get_contrast() {
# See section 2.2: http://www.w3.org/TR/AERT # See section 2.2: http://www.w3.org/TR/AERT
local awk="awk"
if $BYOBU_TEST gawk >/dev/null 2>&1; then
awk="gawk"
fi
local hex="$(echo "$1" | sed -e "s/\(..\)\(..\)\(..\)/\1 \2 \3/")" local hex="$(echo "$1" | sed -e "s/\(..\)\(..\)\(..\)/\1 \2 \3/")"
local bright=$(echo $hex | awk --non-decimal-data '{printf "%0.0f",(("0x"$1)*299+("0x"$2)*587+("0x"$3)*114)/1000}') local bright=$(echo $hex | $awk --non-decimal-data '{printf "%0.0f",(("0x"$1)*299+("0x"$2)*587+("0x"$3)*114)/1000}')
if [ $bright -ge 130 ]; then if [ $bright -ge 130 ]; then
_RET="black" _RET="black"
else else