create core package

This commit is contained in:
aydemir
2015-02-24 11:18:35 +02:00
parent 0e4b743b82
commit 70b25d0f95
1098 changed files with 169545 additions and 0 deletions
@@ -0,0 +1,77 @@
From d0294ff3b90430750a631556277c75f1a555dd44 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 3 Apr 2014 09:48:22 -0700
Subject: [PATCH] cp: don't reserve a device number
* src/copy.c (copy_internal): Replace dev_t arg DEVICE with struct
stat pointer arg PARENT. All callers changed. This removes an
unwarranted assumption that dev_t values of 0 cannot occur in file
systems. See: http://bugs.gnu.org/17179
---
src/copy.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/copy.c b/src/copy.c
index 781cc1e..d471a77 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -117,7 +117,7 @@ struct dir_list
#define DEST_INFO_INITIAL_CAPACITY 61
static bool copy_internal (char const *src_name, char const *dst_name,
- bool new_dst, dev_t device,
+ bool new_dst, struct stat const *parent,
struct dir_list *ancestors,
const struct cp_options *x,
bool command_line_arg,
@@ -621,7 +621,7 @@ copy_dir (char const *src_name_in, char const *dst_name_in, bool new_dst,
char *dst_name = file_name_concat (dst_name_in, namep, NULL);
bool first_dir_created = *first_dir_created_per_command_line_arg;
- ok &= copy_internal (src_name, dst_name, new_dst, src_sb->st_dev,
+ ok &= copy_internal (src_name, dst_name, new_dst, src_sb,
ancestors, &non_command_line_options, false,
&first_dir_created,
&local_copy_into_self, NULL);
@@ -1725,9 +1725,8 @@ should_dereference (const struct cp_options *x, bool command_line_arg)
/* Copy the file SRC_NAME to the file DST_NAME. The files may be of
any type. NEW_DST should be true if the file DST_NAME cannot
exist because its parent directory was just created; NEW_DST should
- be false if DST_NAME might already exist. DEVICE is the device
- number of the parent directory, or 0 if the parent of this file is
- not known. ANCESTORS points to a linked, null terminated list of
+ be false if DST_NAME might already exist. A nonnull PARENT describes the
+ parent directory. ANCESTORS points to a linked, null terminated list of
devices and inodes of parent directories of SRC_NAME. COMMAND_LINE_ARG
is true iff SRC_NAME was specified on the command line.
FIRST_DIR_CREATED_PER_COMMAND_LINE_ARG is both input and output.
@@ -1737,7 +1736,7 @@ should_dereference (const struct cp_options *x, bool command_line_arg)
static bool
copy_internal (char const *src_name, char const *dst_name,
bool new_dst,
- dev_t device,
+ struct stat const *parent,
struct dir_list *ancestors,
const struct cp_options *x,
bool command_line_arg,
@@ -2434,7 +2433,7 @@ copy_internal (char const *src_name, char const *dst_name,
}
/* Decide whether to copy the contents of the directory. */
- if (x->one_file_system && device != 0 && device != src_sb.st_dev)
+ if (x->one_file_system && parent && parent->st_dev != src_sb.st_dev)
{
/* Here, we are crossing a file system boundary and cp's -x option
is in effect: so don't copy the contents of this directory. */
@@ -2827,7 +2826,7 @@ copy (char const *src_name, char const *dst_name,
top_level_dst_name = dst_name;
bool first_dir_created_per_command_line_arg = false;
- return copy_internal (src_name, dst_name, nonexistent_dst, 0, NULL,
+ return copy_internal (src_name, dst_name, nonexistent_dst, NULL, NULL,
options, true,
&first_dir_created_per_command_line_arg,
copy_into_self, rename_succeeded);
--
1.9.1
@@ -0,0 +1,145 @@
--- src/dircolors.hin~ 2013-12-04 15:48:30.000000000 +0100
+++ src/dircolors.hin 2014-04-02 22:17:15.099967508 +0200
@@ -1,12 +1,19 @@
-# Configuration file for dircolors, a utility to help you set the
-# LS_COLORS environment variable used by GNU ls with the --color option.
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Copying and distribution of this file, with or without modification,
-# are permitted provided the copyright notice and this notice are preserved.
-
-# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
-# slackware version of dircolors) are recognized but ignored.
+# Configuration file for the color ls utility
+# Synchronized with coreutils 8.5 dircolors
+# This file goes in the /etc directory, and must be world readable.
+# You can copy this file to .dir_colors in your $HOME directory to override
+# the system defaults.
+
+# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
+# pipes. 'all' adds color characters to all output. 'none' shuts colorization
+# off.
+COLOR tty
+
+# Extra command line options for ls go here.
+# Basically these ones are:
+# -F = show '/' for dirs, '*' for executables, etc.
+# -T 0 = don't trust tab spacing when formatting ls output.
+OPTIONS -F -T 0
# Below, there should be one TERM entry for each termtype that is colorizable
TERM Eterm
@@ -64,6 +71,9 @@
TERM xterm-color
TERM xterm-debian
+# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)
+EIGHTBIT 1
+
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
@@ -73,18 +83,19 @@
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
#NORMAL 00 # no color code at all
-#FILE 00 # regular file: use no color at all
-RESET 0 # reset to "normal" color
+#FILE 00 # normal file, use no color at all
+RESET 0 # reset to "normal" color
DIR 01;34 # directory
-LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
- # numerical value, the color is as for the file pointed to.)
+LINK 01;36 # symbolic link (If you set this to 'target' instead of a
+ # numerical value, the color is as for the file pointed to.)
MULTIHARDLINK 00 # regular file with more than one link
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
-ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
+ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
+MISSING 01;05;37;41 # ... and the files they point to
SETUID 37;41 # file that is setuid (u+s)
SETGID 30;43 # file that is setgid (g+s)
CAPABILITY 30;41 # file with capability
@@ -99,14 +110,12 @@
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
-# If you use DOS-style suffixes, you may want to uncomment the following:
-#.cmd 01;32 # executables (bright green)
+# executables (bright green)
+#.cmd 01;32
#.exe 01;32
#.com 01;32
#.btm 01;32
#.bat 01;32
-# Or if you want to colorize scripts even if they do not have the
-# executable bit actually set.
#.sh 01;32
#.csh 01;32
@@ -149,11 +158,12 @@
.ace 01;31
.zoo 01;31
.cpio 01;31
+.pisi 01;33 # Pisi Linux PiSi packages
.7z 01;31
.rz 01;31
.cab 01;31
-# image formats
+# image formats (magenta)
.jpg 01;35
.jpeg 01;35
.gif 01;35
@@ -206,21 +216,31 @@
.ogv 01;35
.ogx 01;35
-# audio formats
-.aac 00;36
-.au 00;36
-.flac 00;36
-.mid 00;36
-.midi 00;36
-.mka 00;36
-.mp3 00;36
-.mpc 00;36
-.ogg 00;36
-.ra 00;36
-.wav 00;36
+# audio formats (cyan)
+.aac 01;36
+.au 01;36
+.flac 01;36
+.mid 01;36
+.midi 01;36
+.mka 01;36
+.mp3 01;36
+.mpc 01;36
+.ogg 01;36
+.ra 01;36
+.wav 01;36
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
-.axa 00;36
-.oga 00;36
-.spx 00;36
-.xspf 00;36
+.axa 01;36
+.oga 01;36
+.spx 01;36
+.xspf 01;36
+
+# document formats
+.pdf 00;32
+.ps 00;32
+.txt 00;32
+.patch 00;32
+.diff 00;32
+.log 00;32
+.tex 00;32
+.doc 00;32
@@ -0,0 +1,74 @@
From 24eb395471176e24762b08bfcef7562911537504 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 23 Feb 2014 15:34:48 -0800
Subject: [PATCH] shuf: with -r, don't dump core if the input is empty
Problem reported by valiant xiao in <http://bugs.gnu.org/16855>.
* NEWS: Document this.
* src/shuf.c (main): With -r, report an error if the input is empty.
* tests/misc/shuf.sh: Test for the bug.
---
NEWS | 3 +++
src/shuf.c | 15 +++++++++++----
tests/misc/shuf.sh | 4 ++++
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index e72942b..2df246d 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,9 @@ GNU coreutils NEWS -*- outline -*-
it would display an error, requiring --no-dereference to avoid the issue.
[bug introduced in coreutils-5.3.0]
+ shuf -r no longer dumps core if the input is empty.
+ [bug introduced in coreutils-8.22]
+
** New features
od accepts a new option: --endian=TYPE to handle inputs with different byte
diff --git a/src/shuf.c b/src/shuf.c
index d4641fe..2a91072 100644
--- a/src/shuf.c
+++ b/src/shuf.c
@@ -576,11 +576,18 @@ main (int argc, char **argv)
/* Generate output according to requested method */
if (repeat)
{
- if (input_range)
- i = write_random_numbers (randint_source, head_lines,
- lo_input, hi_input, eolbyte);
+ if (head_lines == 0)
+ i = 0;
else
- i = write_random_lines (randint_source, head_lines, line, n_lines);
+ {
+ if (n_lines == 0)
+ error (EXIT_FAILURE, 0, _("No lines to repeat"));
+ if (input_range)
+ i = write_random_numbers (randint_source, head_lines,
+ lo_input, hi_input, eolbyte);
+ else
+ i = write_random_lines (randint_source, head_lines, line, n_lines);
+ }
}
else
{
diff --git a/tests/misc/shuf.sh b/tests/misc/shuf.sh
index d3ea1f2..d7251d1 100755
--- a/tests/misc/shuf.sh
+++ b/tests/misc/shuf.sh
@@ -43,6 +43,10 @@ compare in out1 || { fail=1; echo "not a permutation" 1>&2; }
t=$(shuf -e a b c d e | sort | fmt)
test "$t" = 'a b c d e' || { fail=1; echo "not a permutation" 1>&2; }
+# coreutils-8.22 dumps core.
+shuf -er
+test $? -eq 1 || fail=1
+
# Before coreutils-6.3, this would infloop.
# "seq 1860" produces 8193 (8K + 1) bytes of output.
seq 1860 | shuf > /dev/null || fail=1
--
1.8.5.3
@@ -0,0 +1,11 @@
--- configure.ac.OSmanOS 2013-01-31 02:46:24.000000000 +0200
+++ configure.ac 2013-02-16 22:32:00.764755892 +0200
@@ -34,7 +34,7 @@
AM_INIT_AUTOMAKE([1.11.2 no-dist-gzip dist-xz color-tests parallel-tests
subdir-objects])
-AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
+#~ AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
dnl POSIXCHECK is worthwhile for maintainers, but adds several seconds
dnl (more than 10% execution time) to ./configure, with no benefit for