Accepting request 174959 from Base:System

- make sure that -R or --RAW-CONTROL-CHARS is set in LESS
  environment variable

- add support for colordiff in lessopen.sh (forwarded request 174863 from sleep_walker)

OBS-URL: https://build.opensuse.org/request/show/174959
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/less?expand=0&rev=39
This commit is contained in:
Stephan Kulow 2013-05-13 13:07:19 +00:00 committed by Git OBS Bridge
commit 61e72385b0
2 changed files with 40 additions and 0 deletions

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Mon May 6 20:20:03 UTC 2013 - sleep_walker@suse.cz
- make sure that -R or --RAW-CONTROL-CHARS is set in LESS
environment variable
-------------------------------------------------------------------
Mon May 6 13:23:33 UTC 2013 - sleep_walker@suse.cz
- add support for colordiff in lessopen.sh
-------------------------------------------------------------------
Wed Mar 20 16:31:12 UTC 2013 - idonmez@suse.com

View File

@ -105,6 +105,35 @@ test -n "$CMD" && $CMD "$SRC" >"$TMPF_pre" 2>/dev/null
# assuming ls is always available
ls -lh "$TMPF_pre" >"$TMPF" 2>/dev/null
;;
*diff\ output*)
# I haven't found way, to set less -R from this script
# so check, if '-R' or '--RAW-CONTROL-CHARS' is set in environment
R_NOT_SET=true
for i in $LESS; do
if [ "${i:0:1}" = "-" ]; then
if [ "${i:1:1}" = "-" ]; then
if [ "$i" = --RAW-CONTROL-CHARS ]; then
R_NOT_SET=false
break
else
continue
fi
else
for j in `seq 1 $((${#i} - 1 ))`; do
if [ "${i:j:1}" = R ]; then
R_NOT_SET=false
break
fi
done
fi
fi
done
# if we have -R and colordiff, we can continue
if [ $R_NOT_SET = false ] && \
[ -x "`which colordiff 2>/dev/null`" ]; then
colordiff < "$TMPF_pre" | cat > "$TMPF" 2>/dev/null
else TMPF="$TMPF_pre"; fi
;;
*)
if [ "$LESS_ADVANCED_PREPROCESSOR" = "yes" ]; then
case ${type#"$TMPF_pre": } in