added several colored terms,file extension types, some optimalization, fix

of long options in certain commands, do not drop user-modified shell
    scripts - see changelog for related bugzillas
This commit is contained in:
Ondrej Vasik 2008-02-19 12:34:54 +00:00
commit 7a8df7fa92
6 changed files with 221 additions and 46 deletions

View file

@ -0,0 +1,27 @@
diff -urp coreutils-6.9-orig/src/echo.c coreutils-6.9/src/echo.c
--- coreutils-6.9-orig/src/echo.c
+++ coreutils-6.9/src/echo.c
@@ -163,6 +163,10 @@ main (int argc, char **argv)
{
case 'e': case 'E': case 'n':
break;
+ case '-':
+ /* end of short options(allows to print -n,-e or -E) */
+ argc--;
+ argv++;
default:
goto just_echo;
}
diff -urp coreutils-6.9-orig/lib/long-options.c coreutils-6.9/lib/long-options.c
--- coreutils-6.9-orig/lib/long-options.c
+++ coreutils-6.9/lib/long-options.c
@@ -57,8 +57,7 @@ parse_long_options (int argc,
/* Don't print an error message for unrecognized options. */
opterr = 0;
- if (argc == 2
- && (c = getopt_long (argc, argv, "+", long_options, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "+", long_options, NULL)) != -1)
{
switch (c)
{

View file

@ -15,8 +15,9 @@ COLOR tty
OPTIONS -F -T 0
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM console
TERM Eterm
TERM ansi
TERM color-xterm
TERM con132x25
TERM con132x30
TERM con132x43
@ -28,20 +29,34 @@ TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM xterm
TERM rxvt
TERM xterm-color
TERM color-xterm
TERM vt100
TERM console
TERM cygwin
TERM dtterm
TERM color_xterm
TERM ansi
TERM screen
TERM screen.linux
TERM kon
TERM kterm
TERM eterm-color
TERM gnome
TERM konsole
TERM kterm
TERM linux
TERM linux-c
TERM mach-color
TERM mlterm
TERM putty
TERM rxvt
TERM rxvt-cygwin
TERM rxvt-cygwin-native
TERM rxvt-unicode
TERM screen
TERM screen-256color
TERM screen-bce
TERM screen-w
TERM screen.linux
TERM vt100
TERM xterm
TERM xterm-16color
TERM xterm-256color
TERM xterm-88color
TERM xterm-color
TERM xterm-debian
# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)
EIGHTBIT 1
@ -78,24 +93,71 @@ EXEC 01;32
.bat 01;32
.sh 01;32
.csh 01;32
.tar 01;31 # archives or compressed (bright red)
# archives or compressed (bright red)
.tar 01;31
.tgz 01;31
.svgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.lzma 01;31
.zip 01;31
.z 01;31
.Z 01;31
.dz 01;31
.gz 01;31
.bz2 01;31
.tbz2 01;31
.bz 01;31
.tz 01;31
.deb 01;31
.rpm 01;31
.jar 01;31
.rar 01;31
.ace 01;31
.zoo 01;31
.cpio 01;31
.jpg 01;35 # image formats
.7z 01;31
.rz 01;31
# image formats (magenta)
.jpg 01;35
.jpeg 01;35
.gif 01;35
.bmp 01;35
.pbm 01;35
.pgm 01;35
.ppm 01;35
.tga 01;35
.xbm 01;35
.xpm 01;35
.png 01;35
.tif 01;35
.tiff 01;35
.png 01;35
.mng 01;35
.pcx 01;35
.mov 01;35
.mpg 01;35
.mpeg 01;35
.m2v 01;35
.mkv 01;35
.ogm 01;35
.mp4 01;35
.m4v 01;35
.mp4v 01;35
.vob 01;35
.qt 01;35
.nuv 01;35
.wmv 01;35
.asf 01;35
.rm 01;35
.rmvb 01;35
.flc 01;35
.avi 01;35
.fli 01;35
.gl 01;35
.dl 01;35
.xcf 01;35
.xwd 01;35
.yuv 01;35
.svg 01;35

View file

@ -29,7 +29,11 @@ TERM con80x50
TERM con80x60
TERM cons25
TERM xterm
TERM xterm-16color
TERM xterm-88color
TERM xterm-256color
TERM rxvt
TERM rxvt-unicode
TERM xterm-color
TERM color-xterm
TERM vt100
@ -71,24 +75,70 @@ EXEC 00;32
.bat 00;32
.sh 00;32
.csh 00;32
.tar 00;31 # archives or compressed (red)
# archives or compressed (red)
.tar 00;31
.tgz 00;31
.svgz 00;31
.arj 00;31
.taz 00;31
.lzh 00;31
.lzma 00;31
.zip 00;31
.z 00;31
.Z 00;31
.dz 00;31
.gz 00;31
.bz2 00;31
.tbz2 00;31
.bz 00;31
.tz 00;31
.deb 00;31
.rpm 00;31
.jar 00;31
.rar 00;31
.ace 00;31
.zoo 00;31
.cpio 00;31
.jpg 00;35 # image formats
.7z 00;31
.rz 00;31
# image formats
.jpg 00;35
.jpeg 00;35
.gif 00;35
.bmp 00;35
.pbm 00;35
.pgm 00;35
.ppm 00;35
.tga 00;35
.xbm 00;35
.xpm 00;35
.png 00;35
.tif 00;35
.tiff 00;35
.png 00;35
.mng 00;35
.pcx 00;35
.mov 00;35
.mpg 00;35
.mpeg 00;35
.m2v 00;35
.mkv 00;35
.ogm 00;35
.mp4 00;35
.m4v 00;35
.mp4v 00;35
.vob 00;35
.qt 00;35
.nuv 00;35
.wmv 00;35
.asf 00;35
.rm 00;35
.rmvb 00;35
.flc 00;35
.avi 00;35
.fli 00;35
.gl 00;35
.dl 00;35
.xcf 00;35
.xwd 00;35
.yuv 00;35
.svg 00;35

View file

@ -1,4 +1,11 @@
# color-ls initialization
if ( $?LS_COLORS ) then
if ( $LS_COLORS != "" ) then
#do not override user specified LS_COLORS and use them
goto finish
endif
endif
alias ll 'ls -l'
alias l. 'ls -d .*'
@ -7,11 +14,9 @@ if ($?TERM) then
if ( -e "/etc/DIR_COLORS.$TERM" ) set COLORS="/etc/DIR_COLORS.$TERM"
endif
if ( -f ~/.dircolors ) set COLORS=~/.dircolors
if ($?TERM) then
if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
endif
if ( -f ~/.dir_colors ) set COLORS=~/.dir_colors
if ($?TERM) then
if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
if ( -f ~/.dir_colors."$TERM" ) set COLORS=~/.dir_colors."$TERM"
endif
@ -19,14 +24,16 @@ if ( ! -e "$COLORS" ) exit
eval `dircolors -c $COLORS`
if ( "$LS_COLORS" == '' ) then
exit
endif
if ( "$LS_COLORS" == '' ) exit
set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS`
if ( "$color_none" == '' ) then
alias ll 'ls -l --color=tty'
alias l. 'ls -d .* --color=tty'
alias ls 'ls --color=tty'
if ( "$color_none" != '' ) then
unset color_none
exit
endif
unset color_none
finish:
alias ll 'ls -l --color=auto'
alias l. 'ls -d .* --color=auto'
alias ls 'ls --color=auto'

View file

@ -1,21 +1,36 @@
# color-ls initialization
alias ll='ls -l' 2>/dev/null
alias l.='ls -d .*' 2>/dev/null
#do not override user LS_COLORS, but use them.
if [ -z "$LS_COLORS" ]; then
alias ll='ls -l' 2>/dev/null
alias l.='ls -d .*' 2>/dev/null
COLORS=/etc/DIR_COLORS
[ -e "/etc/DIR_COLORS.$TERM" ] && COLORS="/etc/DIR_COLORS.$TERM"
[ -e "$HOME/.dircolors" ] && COLORS="$HOME/.dircolors"
[ -e "$HOME/.dircolors.$TERM" ] && COLORS="$HOME/.dircolors.$TERM"
[ -e "$HOME/.dir_colors" ] && COLORS="$HOME/.dir_colors"
[ -e "$HOME/.dir_colors.$TERM" ] && COLORS="$HOME/.dir_colors.$TERM"
[ -e "$COLORS" ] || return
eval `dircolors --sh "$COLORS"`
[ -z "$LS_COLORS" ] && return
# Skip the rest for noninteractive shells.
[ -z "$PS1" ] && return
if ! egrep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null ; then
alias ll='ls -l --color=tty' 2>/dev/null
alias l.='ls -d .* --color=tty' 2>/dev/null
alias ls='ls --color=tty' 2>/dev/null
COLORS=
for colors in "$HOME/.dir_colors.$TERM" "$HOME/.dircolors.$TERM" \
"$HOME/.dir_colors" "$HOME/.dircolors"; do
[ -e "$colors" ] && COLORS="$colors" && break
done
if [ -z "$COLORS" ]; then
for colors in "/etc/DIR_COLORS.$TERM" "/etc/DIR_COLORS" ; do
[ -e "$colors" ] && COLORS="$colors" && break
done
fi
# Existence of $COLORS already checked above.
[ -n "$COLORS" ] || return
eval `dircolors --sh "$COLORS" 2>/dev/null`
[ -z "$LS_COLORS" ] && return
egrep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return
fi
alias ll='ls -l --color=auto' 2>/dev/null
alias l.='ls -d .* --color=auto' 2>/dev/null
alias ls='ls --color=auto' 2>/dev/null

View file

@ -1,7 +1,7 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 6.9
Release: 12%{?dist}
Release: 13%{?dist}
License: GPLv2+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -25,6 +25,7 @@ Patch4: coreutils-6.9-du-ls-upstream.patch
# Our patches
Patch100: coreutils-chgrp.patch
Patch101: coreutils-getdateYYYYMMDD.patch
Patch102: coreutils-6.9-longoptions.patch
# sh-utils
Patch703: sh-utils-2.0.11-dateman.patch
@ -97,6 +98,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
# Our patches
%patch100 -p1 -b .chgrp
%patch101 -p1 -b .getdate
%patch102 -p1 -b .longopts
# sh-utils
%patch703 -p1 -b .dateman
@ -246,7 +248,7 @@ fi
%defattr(-,root,root,-)
%dir %{_datadir}/locale/*/LC_TIME
%config(noreplace) %{_sysconfdir}/DIR_COLORS*
%{_sysconfdir}/profile.d/*
%config(noreplace) %{_sysconfdir}/profile.d/*
%{?!nopam:%config(noreplace) %{_sysconfdir}/pam.d/su}
%{?!nopam:%config(noreplace) %{_sysconfdir}/pam.d/su-l}
%{?!nopam:%config(noreplace) %{_sysconfdir}/pam.d/runuser}
@ -291,6 +293,18 @@ fi
/sbin/runuser
%changelog
* Tue Feb 19 2008 Ondrej Vasik <ovasik@redhat.com> - 6.9-13
- added several missing colored TERMS(#239266)
- added several missing image/compressed file extensions
- some optimalizations of colorls.sh
(#430813, #430827, #430823, #430189, #433190)
- fix unability of echo to display certain strings(
added -- separator, #431005) , do not require only one
long_opt for certain commands like sleep, yes - but
use first usable (#431005)
- keep old csh/sh usermodified colorls shell scripts
(#432154)
* Wed Dec 05 2007 Ondrej Vasik <ovasik@redhat.com> - 6.9-12
- fix displaying of security context in stat(#411181)