Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b975e77327 | ||
|
|
e1a1dbd82f | ||
|
|
9ad7b671ce |
5 changed files with 84 additions and 18 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
# skip everything for non-interactive shells
|
||||||
|
if (! $?prompt) exit
|
||||||
|
|
||||||
# color-ls initialization
|
# color-ls initialization
|
||||||
if ( $?USER_LS_COLORS ) then
|
if ( $?USER_LS_COLORS ) then
|
||||||
if ( "$USER_LS_COLORS" != "" ) then
|
if ( "$USER_LS_COLORS" != "" ) then
|
||||||
|
|
@ -10,7 +13,6 @@ endif
|
||||||
alias ll 'ls -l'
|
alias ll 'ls -l'
|
||||||
alias l. 'ls -d .*'
|
alias l. 'ls -d .*'
|
||||||
set COLORS=/etc/DIR_COLORS
|
set COLORS=/etc/DIR_COLORS
|
||||||
set TMP="`mktemp .colorlsXXX --tmpdir=/tmp`"
|
|
||||||
|
|
||||||
if ($?TERM) then
|
if ($?TERM) then
|
||||||
if ( -e "/etc/DIR_COLORS.256color" ) then
|
if ( -e "/etc/DIR_COLORS.256color" ) then
|
||||||
|
|
@ -32,10 +34,14 @@ set INCLUDE="`cat "$COLORS" | grep '^INCLUDE' | cut -d ' ' -f2-`"
|
||||||
|
|
||||||
if ( ! -e "$COLORS" ) exit
|
if ( ! -e "$COLORS" ) exit
|
||||||
|
|
||||||
if ( "$INCLUDE" != '' ) cat "$INCLUDE" > $TMP
|
set _tmp="`mktemp .colorlsXXX --tmpdir=/tmp`"
|
||||||
cat "$COLORS" | grep -v '^INCLUDE' >> $TMP
|
|
||||||
|
|
||||||
eval "`dircolors -c $TMP`"
|
if ( "$INCLUDE" != '' ) cat "$INCLUDE" >> $_tmp
|
||||||
|
grep -v '^INCLUDE' "$COLORS" >> $_tmp
|
||||||
|
|
||||||
|
eval "`dircolors -c $_tmp`"
|
||||||
|
|
||||||
|
rm -f $_tmp
|
||||||
|
|
||||||
if ( "$LS_COLORS" == '' ) exit
|
if ( "$LS_COLORS" == '' ) exit
|
||||||
set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS`
|
set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS`
|
||||||
|
|
@ -44,7 +50,9 @@ if ( "$color_none" != '' ) then
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
unset color_none
|
unset color_none
|
||||||
rm -f $TMP
|
unset _tmp
|
||||||
|
unset INCLUDE
|
||||||
|
unset COLORS
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
alias ll 'ls -l --color=auto'
|
alias ll 'ls -l --color=auto'
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,16 @@
|
||||||
# color-ls initialization
|
# color-ls initialization
|
||||||
|
|
||||||
|
# Skip all for noninteractive shells.
|
||||||
|
[ -z "$PS1" ] && return
|
||||||
|
|
||||||
#when USER_LS_COLORS defined do not override user LS_COLORS, but use them.
|
#when USER_LS_COLORS defined do not override user LS_COLORS, but use them.
|
||||||
if [ -z "$USER_LS_COLORS" ]; then
|
if [ -z "$USER_LS_COLORS" ]; then
|
||||||
|
|
||||||
alias ll='ls -l' 2>/dev/null
|
alias ll='ls -l' 2>/dev/null
|
||||||
alias l.='ls -d .*' 2>/dev/null
|
alias l.='ls -d .*' 2>/dev/null
|
||||||
|
|
||||||
|
|
||||||
# Skip the rest for noninteractive shells.
|
|
||||||
[ -z "$PS1" ] && return
|
|
||||||
|
|
||||||
INCLUDE=
|
INCLUDE=
|
||||||
COLORS=
|
COLORS=
|
||||||
TMP="`mktemp .colorlsXXX --tmpdir=/tmp`"
|
|
||||||
|
|
||||||
for colors in "$HOME/.dir_colors.$TERM" "$HOME/.dircolors.$TERM" \
|
for colors in "$HOME/.dir_colors.$TERM" "$HOME/.dircolors.$TERM" \
|
||||||
"$HOME/.dir_colors" "$HOME/.dircolors"; do
|
"$HOME/.dir_colors" "$HOME/.dircolors"; do
|
||||||
|
|
@ -34,15 +32,21 @@ if [ -z "$USER_LS_COLORS" ]; then
|
||||||
# Existence of $COLORS already checked above.
|
# Existence of $COLORS already checked above.
|
||||||
[ -n "$COLORS" ] || return
|
[ -n "$COLORS" ] || return
|
||||||
|
|
||||||
[ -e "$INCLUDE" ] && cat "$INCLUDE" > $TMP
|
TMP="`mktemp .colorlsXXX --tmpdir=/tmp`"
|
||||||
cat "$COLORS" | grep -v '^INCLUDE' >> $TMP
|
|
||||||
|
[ -e "$INCLUDE" ] && cat "$INCLUDE" >> $TMP
|
||||||
|
grep -v '^INCLUDE' "$COLORS" >> $TMP
|
||||||
|
|
||||||
eval "`dircolors --sh $TMP 2>/dev/null`"
|
eval "`dircolors --sh $TMP 2>/dev/null`"
|
||||||
|
|
||||||
|
rm -f $TMP
|
||||||
|
|
||||||
[ -z "$LS_COLORS" ] && return
|
[ -z "$LS_COLORS" ] && return
|
||||||
grep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return
|
grep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return
|
||||||
rm -f $TMP
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unset TMP COLORS INCLUDE
|
||||||
|
|
||||||
alias ll='ls -l --color=auto' 2>/dev/null
|
alias ll='ls -l --color=auto' 2>/dev/null
|
||||||
alias l.='ls -d .* --color=auto' 2>/dev/null
|
alias l.='ls -d .* --color=auto' 2>/dev/null
|
||||||
alias ls='ls --color=auto' 2>/dev/null
|
alias ls='ls --color=auto' 2>/dev/null
|
||||||
|
|
|
||||||
29
coreutils-cp-nopreserve-invalidargs.patch
Normal file
29
coreutils-cp-nopreserve-invalidargs.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
From 124ab798e65b6c95a8486f6f6af9bdf69b11e1bf Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <ovasik@redhat.com>
|
||||||
|
Date: Fri, 11 Oct 2013 14:44:53 +0200
|
||||||
|
Subject: [PATCH] cp: correct error message for invalid arguments of '--no-preserve'
|
||||||
|
|
||||||
|
* src/cp.c (decode_preserve_arg) :
|
||||||
|
Correct error message for invalid arguments of '--no-preserve'.
|
||||||
|
Reported by M.Vadkerti in rhbz #1018206
|
||||||
|
---
|
||||||
|
src/cp.c | 3 ++-
|
||||||
|
1 files changed, 2 insertions(+), 1 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/cp.c b/src/cp.c
|
||||||
|
index e235b32..7bc8630 100644
|
||||||
|
--- a/src/cp.c
|
||||||
|
+++ b/src/cp.c
|
||||||
|
@@ -854,7 +854,8 @@ decode_preserve_arg (char const *arg, struct cp_options *x, bool on_off)
|
||||||
|
*comma++ = 0;
|
||||||
|
|
||||||
|
/* process S. */
|
||||||
|
- val = XARGMATCH ("--preserve", s, preserve_args, preserve_vals);
|
||||||
|
+ val = XARGMATCH (on_off ? "--preserve" : "--no-preserve",
|
||||||
|
+ s, preserve_args, preserve_vals);
|
||||||
|
switch (val)
|
||||||
|
{
|
||||||
|
case PRESERVE_MODE:
|
||||||
|
--
|
||||||
|
1.7.1
|
||||||
|
|
||||||
|
|
@ -205,7 +205,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c
|
||||||
+static void
|
+static void
|
||||||
+cut_characters_or_cut_bytes_no_split (FILE *stream)
|
+cut_characters_or_cut_bytes_no_split (FILE *stream)
|
||||||
+{
|
+{
|
||||||
+ int idx; /* number of bytes or characters in the line so far. */
|
+ size_t idx; /* number of bytes or characters in the line so far. */
|
||||||
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
|
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
|
||||||
+ char *bufpos; /* Next read position of BUF. */
|
+ char *bufpos; /* Next read position of BUF. */
|
||||||
+ size_t buflen; /* The length of the byte sequence in buf. */
|
+ size_t buflen; /* The length of the byte sequence in buf. */
|
||||||
|
|
@ -276,7 +276,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c
|
||||||
+cut_fields_mb (FILE *stream)
|
+cut_fields_mb (FILE *stream)
|
||||||
+{
|
+{
|
||||||
+ int c;
|
+ int c;
|
||||||
+ unsigned int field_idx;
|
+ size_t field_idx;
|
||||||
+ int found_any_selected_field;
|
+ int found_any_selected_field;
|
||||||
+ int buffer_first_field;
|
+ int buffer_first_field;
|
||||||
+ int empty_input;
|
+ int empty_input;
|
||||||
|
|
@ -2263,7 +2263,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
|
||||||
{
|
{
|
||||||
width = TAB_WIDTH (chars_per_c, input_position);
|
width = TAB_WIDTH (chars_per_c, input_position);
|
||||||
|
|
||||||
@@ -2724,6 +2930,154 @@ char_to_clump (char c)
|
@@ -2724,6 +2930,164 @@ char_to_clump (char c)
|
||||||
return chars;
|
return chars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2410,7 +2410,17 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
|
||||||
+ mbc_pos -= mblength;
|
+ mbc_pos -= mblength;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ input_position += width;
|
+ /* Too many backspaces must put us in position 0 -- never negative. */
|
||||||
|
+ if (width < 0 && input_position == 0)
|
||||||
|
+ {
|
||||||
|
+ chars = 0;
|
||||||
|
+ input_position = 0;
|
||||||
|
+ }
|
||||||
|
+ else if (width < 0 && input_position <= -width)
|
||||||
|
+ input_position = 0;
|
||||||
|
+ else
|
||||||
|
+ input_position += width;
|
||||||
|
+
|
||||||
+ return chars;
|
+ return chars;
|
||||||
+}
|
+}
|
||||||
+#endif
|
+#endif
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
Summary: A set of basic GNU tools commonly used in shell scripts
|
Summary: A set of basic GNU tools commonly used in shell scripts
|
||||||
Name: coreutils
|
Name: coreutils
|
||||||
Version: 8.21
|
Version: 8.21
|
||||||
Release: 11%{?dist}
|
Release: 13%{?dist}
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Url: http://www.gnu.org/software/coreutils/
|
Url: http://www.gnu.org/software/coreutils/
|
||||||
|
|
@ -15,6 +15,7 @@ Source106: coreutils-colorls.csh
|
||||||
# From upstream
|
# From upstream
|
||||||
Patch1: coreutils-8.21-install-strip.patch
|
Patch1: coreutils-8.21-install-strip.patch
|
||||||
Patch2: coreutils-aarch64-longlong.patch
|
Patch2: coreutils-aarch64-longlong.patch
|
||||||
|
Patch3: coreutils-cp-nopreserve-invalidargs.patch
|
||||||
|
|
||||||
# Our patches
|
# Our patches
|
||||||
#general patch to workaround koji build system issues
|
#general patch to workaround koji build system issues
|
||||||
|
|
@ -129,6 +130,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
|
||||||
# From upstream
|
# From upstream
|
||||||
%patch1 -p1 -b .strip
|
%patch1 -p1 -b .strip
|
||||||
%patch2 -p1 -b .aarch64
|
%patch2 -p1 -b .aarch64
|
||||||
|
%patch3 -p1 -b .nopres
|
||||||
|
|
||||||
# Our patches
|
# Our patches
|
||||||
%patch100 -p1 -b .configure
|
%patch100 -p1 -b .configure
|
||||||
|
|
@ -375,6 +377,19 @@ fi
|
||||||
%{_sbindir}/chroot
|
%{_sbindir}/chroot
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jan 20 2014 Ondrej Vasik <ovasik@redhat.com> 8.21-12
|
||||||
|
- fix possible colorls.csh script errors for tcsh with
|
||||||
|
noclobber set and entered include file (#1027279)
|
||||||
|
- cp: correct error message for invalid arguments
|
||||||
|
of '--no-preserve' (#1018206)
|
||||||
|
- pr -e, with a mix of backspaces and TABs, could corrupt the heap
|
||||||
|
in multibyte locales (analyzed by J.Koncicky)
|
||||||
|
- optimization of colorls scripts by Ville Skytta (#961012)
|
||||||
|
- cut - Fix the variables in multibyte path to work on 64 bit
|
||||||
|
|
||||||
|
* Wed Aug 14 2013 Ondrej Oprala <ooprala@redhat.com 8.21-12
|
||||||
|
- fix cases when colorls scripts' TMP wasn't deleted (#988152)
|
||||||
|
|
||||||
* Fri Apr 05 2013 Ondrej Oprala <ooprala@redhat.com 8.21-11
|
* Fri Apr 05 2013 Ondrej Oprala <ooprala@redhat.com 8.21-11
|
||||||
- Fix tmp file location in colorls scripts (#948008)
|
- Fix tmp file location in colorls scripts (#948008)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue