Avoid some unnecessary stat calls and commands in lesspipe.sh

Patch by Ville Skyttä (#741440)
This commit is contained in:
Vojtech Vitek (V-Teq) 2011-11-22 18:17:36 +01:00
parent e2a2557c39
commit 0758dba0e6
2 changed files with 9 additions and 5 deletions

View File

@ -68,6 +68,8 @@ ls -la $RPM_BUILD_ROOT/etc/profile.d
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%changelog %changelog
- Avoid some unnecessary stat calls and commands in lesspipe.sh,
patch by Ville Skyttä (#741440)
- Use `groff' instead of `man -s' for rendering manpages to prevent - Use `groff' instead of `man -s' for rendering manpages to prevent
options incompatibility between man and man-db packages (#718498) options incompatibility between man and man-db packages (#718498)
- Add groff to Requires - Add groff to Requires

View File

@ -59,15 +59,17 @@ case "$1" in
exit 1 exit 1
fi ;; fi ;;
*) *)
if [ -x /usr/bin/file -a -x /usr/bin/iconv -a -x /usr/bin/cut ]; then if [ -x /usr/bin/file ] && [ -x /usr/bin/iconv ] && [ -x /usr/bin/cut ]; then
case `file -b "$1"` in case `file -b "$1"` in
*UTF-16*) conv='UTF-16' ;; *UTF-16*) conv='UTF-16' ;;
*UTF-32*) conv='UTF-32' ;; *UTF-32*) conv='UTF-32' ;;
esac esac
env=`echo $LANG | cut -d. -f2` if [ -n "$conv" ]; then
if [ -n "$conv" -a -n "$env" -a "$conv" != "$env" ]; then env=`echo $LANG | cut -d. -f2`
iconv -f $conv -t $env "$1" if [ -n "$env" -a "$conv" != "$env" ]; then
exit $? iconv -f $conv -t $env "$1"
exit $?
fi
fi fi
fi fi
exit 1 exit 1