vapier 14/07/28 09:43:14
Added: 003_all_coreutils-gentoo-uname.patch
010_all_coreutils-tests.patch
030_all_coreutils-more-dir-colors.patch
040_all_coreutils-cp-mkdir-eexist.patch
051_all_coreutils-mangen.patch README.history
Log:
initial 8.23 patchset based on last 8.22 patchset
Revision Changes Path
1.1
src/patchsets/coreutils/8.23/003_all_coreutils-gentoo-uname.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/003_all_coreutils-gentoo-uname.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/003_all_coreutils-gentoo-uname.patch?rev=1.1&content-type=text/plain
Index: 003_all_coreutils-gentoo-uname.patch
===================================================================
On linux platforms, grok /proc/cpuinfo for the CPU/vendor info.
Prob not suitable for upstream seeing as how it's 100% linux-specific
http://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html
Patch originally by Carlos E. Gorges <[email protected]>, but
heavily reworked to suck less.
To add support for additional platforms, check out the show_cpuinfo()
func in the linux/arch/<ARCH>/ source tree of the kernel.
--- coreutils/src/uname.c
+++ coreutils/src/uname.c
@@ -50,6 +50,11 @@
# include <mach-o/arch.h>
#endif
+#if defined(__linux__)
+# define USE_PROCINFO
+# define UNAME_HARDWARE_PLATFORM
+#endif
+
#include "system.h"
#include "error.h"
#include "quote.h"
@@ -138,6 +143,117 @@
exit (status);
}
+#if defined(USE_PROCINFO)
+
+# if defined(__s390__) || defined(__s390x__)
+# define CPUINFO_FILE "/proc/sysinfo"
+# define CPUINFO_FORMAT "%64[^\t :]%*[ :]%256[^\n]%c"
+# else
+# define CPUINFO_FILE "/proc/cpuinfo"
+# define CPUINFO_FORMAT "%64[^\t:]\t:%256[^\n]%c"
+# endif
+
+# define PROCINFO_PROCESSOR 0
+# define PROCINFO_HARDWARE_PLATFORM 1
+
+static void __eat_cpuinfo_space(char *buf)
+{
+ /* first eat trailing space */
+ char *tmp = buf + strlen(buf) - 1;
+ while (tmp > buf && isspace(*tmp))
+ *tmp-- = '\0';
+ /* then eat leading space */
+ tmp = buf;
+ while (*tmp && isspace(*tmp))
+ tmp++;
+ if (tmp != buf)
+ memmove(buf, tmp, strlen(tmp)+1);
+ /* finally collapse whitespace */
+ tmp = buf;
+ while (tmp[0] && tmp[1]) {
+ if (isspace(tmp[0]) && isspace(tmp[1])) {
+ memmove(tmp, tmp+1, strlen(tmp));
+ continue;
+ }
+ ++tmp;
+ }
+}
+
+static int __linux_procinfo(int x, char *fstr, size_t s)
+{
+ FILE *fp;
+
+ char *procinfo_keys[] = {
+ /* --processor --hardware-platform */
+ #if defined(__alpha__)
+ "cpu model", "system type"
+ #elif defined(__arm__)
+ "Processor", "Hardware"
+ #elif defined(__avr32__)
+ "processor", "cpu family"
+ #elif defined(__bfin__)
+ "CPU", "BOARD Name"
+ #elif defined(__cris__)
+ "cpu", "cpu model"
+ #elif defined(__frv__)
+ "CPU-Core", "System"
+ #elif defined(__i386__) || defined(__x86_64__)
+ "model name", "vendor_id"
+ #elif defined(__ia64__)
+ "model name", "vendor"
+ #elif defined(__hppa__)
+ "cpu", "model"
+ #elif defined(__m68k__)
+ "CPU", "MMU"
+ #elif defined(__mips__)
+ "cpu model", "system type"
+ #elif defined(__powerpc__) || defined(__powerpc64__)
+ "cpu", "machine"
+ #elif defined(__s390__) || defined(__s390x__)
+ "Type", "Manufacturer"
+ #elif defined(__sh__)
+ "cpu type", "machine"
+ #elif defined(sparc) || defined(__sparc__)
+ "type", "cpu"
+ #elif defined(__vax__)
+ "cpu type", "cpu"
+ #else
+ "unknown", "unknown"
+ #endif
+ };
+
+ if ((fp = fopen(CPUINFO_FILE, "r")) != NULL) {
+ char key[65], value[257], eol, *ret = NULL;
+
+ while (fscanf(fp, CPUINFO_FORMAT, key, value, &eol) != EOF) {
+ __eat_cpuinfo_space(key);
+ if (!strcmp(key, procinfo_keys[x])) {
+ __eat_cpuinfo_space(value);
+ ret = value;
+ break;
+ }
+ if (eol != '\n') {
+ /* we need two fscanf's here in case the
previous
+ * length limit caused us to read right up to
the
+ * newline ... doing "%*[^\n]\n" wont eat the
newline
+ */
+ fscanf(fp, "%*[^\n]");
+ fscanf(fp, "\n");
+ }
+ }
+ fclose(fp);
+
+ if (ret) {
+ strncpy(fstr, ret, s);
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+#endif
+
/* Print ELEMENT, preceded by a space if something has already been
printed. */
@@ -250,10 +344,14 @@ main (int argc, char **argv)
if (toprint & PRINT_PROCESSOR)
{
char const *element = unknown;
-#if HAVE_SYSINFO && defined SI_ARCHITECTURE
+#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO)
{
static char processor[257];
+#if defined(USE_PROCINFO)
+ if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof
processor))
+#else
if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
+#endif
element = processor;
}
#endif
@@ -306,9 +404,13 @@ main (int argc, char **argv)
if (element == unknown)
{
static char hardware_platform[257];
+#if defined(USE_PROCINFO)
+ if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM,
hardware_platform, sizeof hardware_platform))
+#else
size_t s = sizeof hardware_platform;
static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM };
if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
+#endif
element = hardware_platform;
}
#endif
1.1 src/patchsets/coreutils/8.23/010_all_coreutils-tests.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/010_all_coreutils-tests.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/010_all_coreutils-tests.patch?rev=1.1&content-type=text/plain
Index: 010_all_coreutils-tests.patch
===================================================================
this test only gets run as non-root, so giving it temp write access to the
root dir is safe since normal unix access will deny it #259876
--- a/tests/touch/not-owner.sh
+++ b/tests/touch/not-owner.sh
@@ -34,6 +34,7 @@
# Before fileutils-4.1, we'd get the following misleading
# diagnostic instead of '...: Permission denied'.
# touch: creating '/': Is a directory
+env SANDBOX_WRITE=${SANDBOX_WRITE}:/ \
touch / > out 2>&1 && fail=1
# On SunOS4, EPERM is 'Not owner'.
the dd test looks up a device and tries to test seeking on it. it shouldnt
cause any corruption because it uses a count of 0 and seeks past the end of
the device
--- a/tests/dd/skip-seek-past-dev.sh
+++ b/tests/dd/skip-seek-past-dev.sh
@@ -48,6 +48,7 @@
0+0 records out" > err_ok || framework_failure_
compare err_ok err || fail=1
+env SANDBOX_WRITE=${SANDBOX_WRITE}:$device \
timeout 10 dd bs=1 seek=$DEV_OFLOW count=0 status=noxfer > "$device" 2> err
test "$?" = "1" || fail=1
echo "dd: 'standard output': cannot seek: Invalid argument
running through strace and counting stat syscalls is off when using sandbox
https://bugs.gentoo.org/415487
--- a/tests/ls/stat-free-color.sh
+++ b/tests/ls/stat-free-color.sh
@@ -19,6 +19,8 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ ls
+skip_ 'strace does not work under sandbox #415487'
+
# Note this list of _file name_ stat functions must be
# as cross platform as possible and so doesn't include
# fstatat64 as that's not available on aarch64 for example.
1.1
src/patchsets/coreutils/8.23/030_all_coreutils-more-dir-colors.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/030_all_coreutils-more-dir-colors.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/030_all_coreutils-more-dir-colors.patch?rev=1.1&content-type=text/plain
Index: 030_all_coreutils-more-dir-colors.patch
===================================================================
--- coreutils-7.5/src/dircolors.hin
+++ coreutils-7.5/src/dircolors.hin
@@ -5,6 +5,9 @@
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
+
+# You can copy this file to .dir_colors in your $HOME directory to override
+# the system defaults.
# Below, there should be one TERM entry for each termtype that is colorizable
TERM Eterm
@@ -66,7 +66,8 @@
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 01;05;37;41 # orphaned syminks
+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)
STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
@@ -125,6 +154,16 @@
.xwd 01;35
.yuv 01;35
+# Document files
+.pdf 00;32
+.ps 00;32
+.txt 00;32
+.patch 00;32
+.diff 00;32
+.log 00;32
+.tex 00;32
+.doc 00;32
+
# audio formats
.aac 00;36
.au 00;36
1.1
src/patchsets/coreutils/8.23/040_all_coreutils-cp-mkdir-eexist.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/040_all_coreutils-cp-mkdir-eexist.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/040_all_coreutils-cp-mkdir-eexist.patch?rev=1.1&content-type=text/plain
Index: 040_all_coreutils-cp-mkdir-eexist.patch
===================================================================
https://bugs.gentoo.org/449838
http://lists.gnu.org/archive/html/bug-coreutils/2013-01/msg00002.html
>From 597db089bfa64656540206b3826e0a97759f6720 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <[email protected]>
Date: Thu, 3 Jan 2013 18:31:37 -0500
Subject: [PATCH] cp: ignore EEXIST errors from mkdir
If you're copying multiple source trees into a single destination in
parallel (which have overlapping dirs, but not files), you can easily
hit a race condition.
This can crop up more generally if you're running multiple installs
from different build directories in parallel. You don't get as much
of a speed up due to the parallel I/O, but you do from processing all
the build scripts.
Simple test to reproduce:
mkdir -p in/`printf %s/ {a..z} {0..10}`
(rm -rf out; for ((i=0;i<100;++i)); do cp -pPR in out & :; done)
* src/cp.c (make_dir_parents_private): Ignore EEXIST from mkdir.
---
src/cp.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/cp.c b/src/cp.c
index 625ea0b..b9dff18 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -473,9 +473,15 @@ make_dir_parents_private (char const *const_dir, size_t
src_offset,
mkdir_mode = src_mode & CHMOD_MODE_BITS & ~omitted_permissions;
if (mkdir (dir, mkdir_mode) != 0)
{
- error (0, errno, _("cannot make directory %s"),
- quote (dir));
- return false;
+ /* If someone else created it between our stat/mkdir,
+ don't complain. It's debatable whether we should
+ also preserve the mode bits in this scenario. */
+ if (errno != EEXIST)
+ {
+ error (0, errno, _("cannot make directory %s"),
+ quote (dir));
+ return false;
+ }
}
else
{
--
1.8.0.2
1.1 src/patchsets/coreutils/8.23/051_all_coreutils-mangen.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/051_all_coreutils-mangen.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/051_all_coreutils-mangen.patch?rev=1.1&content-type=text/plain
Index: 051_all_coreutils-mangen.patch
===================================================================
avoid regenerating man pages all the time (since the locally compiled binaries
will always be newer than the bundled man pages)
--- a/Makefile.in
+++ b/Makefile.in
@@ -14038,7 +14038,6 @@ check-local: check-texinfo
distclean-local:
test x$(srcdir) = x$(builddir) || rm -f $(ALL_MANS)
-$(ALL_MANS): $(mandeps)
man/dynamic-deps.mk: Makefile
$(AM_V_GEN)rm -f $@ $@-t
$(AM_V_at)for man in $(ALL_MANS); do \
@@ -14058,9 +14057,6 @@ man/dynamic-deps.mk: Makefile
done > $@-t \
&& mv $@-t $@
-# Include the generated man dependencies.
-@AMDEP_TRUE@@am__include@ man/dynamic-deps.mk
-
.x.1:
$(AM_V_GEN)name=`echo $@ | sed 's|.*/||; s|\.1$$||'` || exit 1; \
case $$name in \
1.1 src/patchsets/coreutils/8.23/README.history
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/README.history?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.23/README.history?rev=1.1&content-type=text/plain
Index: README.history
===================================================================
1.0 28 Jul 2014
+ 003_all_coreutils-gentoo-uname.patch
+ 010_all_coreutils-tests.patch
+ 030_all_coreutils-more-dir-colors.patch
+ 040_all_coreutils-cp-mkdir-eexist.patch
+ 051_all_coreutils-mangen.patch