rpms/coreutils/F-8 coreutils-6.9-du-ls-upstream.patch, NONE, 1.1 coreutils-getdateYYYYMMDD.patch, NONE, 1.1 coreutils-selinux.patch, 1.36, 1.37 coreutils.spec, 1.179, 1.180

Ondrej Vasik (ovasik) fedora-extras-commits at redhat.com
Fri Nov 23 11:10:28 UTC 2007


Author: ovasik

Update of /cvs/extras/rpms/coreutils/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22757

Modified Files:
	coreutils-selinux.patch coreutils.spec 
Added Files:
	coreutils-6.9-du-ls-upstream.patch 
	coreutils-getdateYYYYMMDD.patch 
Log Message:
various fixes from rawhide-details in changelog

coreutils-6.9-du-ls-upstream.patch:

--- NEW FILE coreutils-6.9-du-ls-upstream.patch ---
Fixes some small bugs (merged upstream patches)
Fixed RedHat Bugzillas: 250089(fix by jplans at redhat.com), 239266 

diff -Naurp coreutils-5.2.1/lib/fts.c coreutils-5.2.1.new/lib/fts.c
--- coreutils-5.2.1/lib/fts.c	2003-12-20 10:05:23.000000000 -0800
+++ coreutils-5.2.1.new/lib/fts.c	2007-06-14 11:38:00.696001000 -0700
@@ -685,7 +685,7 @@ fts_read(sp)
			   /* If fts_build's call to fts_safe_changedir failed
			   because it was not able to fchdir into a
			   subdirectory, tell the caller.  */
-			if (p->fts_errno)
+			if (p->fts_errno && p->fts_info != FTS_DNR)
				p->fts_info = FTS_ERR;
			LEAVE_DIR (sp, p, "2");
			return (p);
		}
diff -ur coreutils-6.9-orig/src/du.c coreutils-6.9/src/du.c
--- coreutils-6.9-orig/src/du.c
+++ coreutils-6.9/src/du.c
     duinfo_add (&dulvl[level].ent, &dui);
 
   /* Even if this directory is unreadable or we can't chdir into it,
-     do let its size contribute to the total, ... */
+     do let its size contribute to the total. */
   duinfo_add (&tot_dui, &dui);
 
-  /* ... but don't print out a total for it, since without the size(s)
-     of any potential entries, it could be very misleading.  */
-  if (ent->fts_info == FTS_DNR)
-    return ok;
-
   /* If we're not counting an entry, e.g., because it's a hard link
      to a file we've already counted (and --count-links), then don't
      print a line for it.  */
diff -urNp coreutils-6.9-orig/src/dircolors.hin coreutils-6.9/src/dircolors.hin
--- coreutils-6.9-orig/src/dircolors.hin	2007-03-18 22:36:43.000000000 +0100
+++ coreutils-6.9/src/dircolors.hin	2007-11-02 12:27:03.000000000 +0100
@@ -27,6 +27,7 @@ TERM cons25
 TERM console
 TERM cygwin
 TERM dtterm
+TERM eterm-color
 TERM gnome
 TERM konsole
 TERM kterm
@@ -40,6 +40,7 @@ TERM rxvt-cygwin
 TERM rxvt-cygwin-native
 TERM rxvt-unicode
 TERM screen
+TERM screen-256color
 TERM screen-bce
 TERM screen-w
 TERM screen.linux
@@ -46,7 +47,9 @@ 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

diff -ur a/src/ls.c b/src/ls.c
--- a/src/ls.c
+++ b/src/ls.c
@@ -1168,7 +1168,7 @@ main (int argc, char **argv)
     {
       /* Avoid following symbolic links when possible.  */
       if (is_colored (C_ORPHAN)
-	  || is_colored (C_EXEC)
+	  || (is_colored (C_EXEC) && color_symlink_as_referent)
	  || (is_colored (C_MISSING) && format == long_format))
	check_symlink_color = true;
 
@@ -2713,6 +2713,12 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
          free (linkname);
        }
 
+      /* When not distinguishing types of symlinks, pretend we know that
+        it is stat'able, so that it will be colored as a regular symlink,
+        and not as an orphan.  */
+      if (S_ISLNK (f->stat.st_mode) && !check_symlink_color)
+       f->linkok = true;
+
       if (S_ISLNK (f->stat.st_mode))
        f->filetype = symbolic_link;
       else if (S_ISDIR (f->stat.st_mode))

coreutils-getdateYYYYMMDD.patch:

--- NEW FILE coreutils-getdateYYYYMMDD.patch ---
diff -urNp coreutils-6.9.orig/lib/getdate.y coreutils-6.9/lib/getdate.y
--- coreutils-6.9.orig/lib/getdate.y	2007-02-23 19:25:21.000000000 +0100
+++ coreutils-6.9/lib/getdate.y	2007-11-23 10:27:13.000000000 +0100
@@ -199,6 +199,42 @@ static int yylex (union YYSTYPE *, parse
 static int yyerror (parser_control const *, char const *);
 static long int time_zone_hhmm (textint, long int);
 
+static void
+digits_to_date_time (parser_control *pc, textint text_int)
+{
+	if (pc->dates_seen && ! pc->year.digits
+	    && ! pc->rels_seen && (pc->times_seen || 2 < text_int.digits))
+	  pc->year = text_int;
+	else
+	  {
+	    if (4 < text_int.digits)
+	      {
+		pc->dates_seen++;
+		pc->day = text_int.value % 100;
+		pc->month = (text_int.value / 100) % 100;
+		pc->year.value = text_int.value / 10000;
+		pc->year.digits = text_int.digits - 4;
+	      }
+	    else
+	      {
+		pc->times_seen++;
+		if (text_int.digits <= 2)
+		  {
+		    pc->hour = text_int.value;
+		    pc->minutes = 0;
+		  }
+		else
+		  {
+		    pc->hour = text_int.value / 100;
+		    pc->minutes = text_int.value % 100;
+		  }
+		pc->seconds.tv_sec = 0;
+		pc->seconds.tv_nsec = 0;
+		pc->meridian = MER24;
+	      }
+	  }
+}
+
 %}
 
 /* We want a reentrant parser, even if the TZ manipulation and the calls to
@@ -268,6 +304,7 @@ item:
   | rel
       { pc->rels_seen = true; }
   | number
+  | hybrid
   ;
 
 time:
@@ -543,38 +580,23 @@ unsigned_seconds:
 
 number:
     tUNUMBER
+      { digits_to_date_time (pc, $1); }
+  ;
+
+hybrid:
+    tUNUMBER relunit_snumber
       {
-	if (pc->dates_seen && ! pc->year.digits
-	    && ! pc->rels_seen && (pc->times_seen || 2 < $1.digits))
-	  pc->year = $1;
-	else
-	  {
-	    if (4 < $1.digits)
-	      {
-		pc->dates_seen++;
-		pc->day = $1.value % 100;
-		pc->month = ($1.value / 100) % 100;
-		pc->year.value = $1.value / 10000;
-		pc->year.digits = $1.digits - 4;
-	      }
-	    else
-	      {
-		pc->times_seen++;
-		if ($1.digits <= 2)
-		  {
-		    pc->hour = $1.value;
-		    pc->minutes = 0;
-		  }
-		else
-		  {
-		    pc->hour = $1.value / 100;
-		    pc->minutes = $1.value % 100;
-		  }
-		pc->seconds.tv_sec = 0;
-		pc->seconds.tv_nsec = 0;
-		pc->meridian = MER24;
-	      }
-	  }
+	/* Hybrid all-digit and relative offset, so that we accept e.g.,
+	   "YYYYMMDD +N days" as well as "YYYYMMDD N days".  */
+	digits_to_date_time (pc, $1);
+	pc->rel.ns += $2.ns;
+	pc->rel.seconds += $2.seconds;
+	pc->rel.minutes += $2.minutes;
+	pc->rel.hour += $2.hour;
+	pc->rel.day += $2.day;
+	pc->rel.month += $2.month;
+	pc->rel.year += $2.year;
+	pc->rels_seen = true;
       }
   ;
 
diff -urNp coreutils-6.9.orig/tests/misc/date coreutils-6.9/tests/misc/date
--- coreutils-6.9.orig/tests/misc/date	2007-03-18 22:36:43.000000000 +0100
+++ coreutils-6.9/tests/misc/date	2007-11-23 10:14:19.000000000 +0100
@@ -135,6 +135,11 @@ my @Tests =
      ['next-mo', "-d '$d1 next month' '+%Y-%m-%d %T'", {OUT=>"$dm $t0"}],
      ['next-y', "-d '$d1 next year'   '+%Y-%m-%d %T'", {OUT=>"$dy $t0"}],
 
+     # This has always worked, ...
+     ['rel-1',  "-d '20050101  1 day'  +%F", {OUT=>"2005-01-02"}],
+     # ...but up to coreutils-6.9, this was rejected due to the "+".
+     ['rel-1p', "-d '20050101 +1 day'  +%F", {OUT=>"2005-01-02"}],
+
      ['utc-0', "-u -d '08/01/97 6:00' '+%D,%H:%M'", {OUT=>"08/01/97,06:00"},
 	       {ENV => 'TZ=UTC+4'}],
 

coreutils-selinux.patch:

Index: coreutils-selinux.patch
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-8/coreutils-selinux.patch,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- coreutils-selinux.patch	30 Oct 2007 16:47:35 -0000	1.36
+++ coreutils-selinux.patch	23 Nov 2007 11:10:20 -0000	1.37
@@ -2223,18 +2223,32 @@
 +#endif
  	case_GETOPT_HELP_CHAR;
  	case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
- 	default:
-@@ -523,6 +613,10 @@
+ 	default: 
+@@ -503,6 +591,7 @@
+ static bool
+ change_attributes (char const *name)
+ {
++  bool ok = false;
+   /* chown must precede chmod because on some systems,
+      chown clears the set[ug]id bits for non-superusers,
+      resulting in incorrect permissions.
+@@ -521,9 +610,14 @@
+   else if (chmod (name, mode) != 0)
+     error (0, errno, _("cannot change permissions of %s"), quote (name));
    else
-     return true;
- 
+-    return true;
++    ok = true;
++
 +#ifdef WITH_SELINUX
 +  if (use_default_selinux_context)
-+    setdefaultfilecon(name);
++    setdefaultfilecon (name);
 +#endif
-   return false;
+ 
+-  return false;
++  return ok;
  }
  
+ /* Set the timestamps of file TO to match those of file FROM.
 @@ -687,6 +781,11 @@
    -T, --no-target-directory  treat DEST as a normal file\n\
    -v, --verbose       print the name of each directory as it is created\n\


Index: coreutils.spec
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-8/coreutils.spec,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -r1.179 -r1.180
--- coreutils.spec	30 Oct 2007 16:47:35 -0000	1.179
+++ coreutils.spec	23 Nov 2007 11:10:20 -0000	1.180
@@ -1,7 +1,7 @@
 Summary: The GNU core utilities: a set of tools commonly used in shell scripts
 Name:    coreutils
 Version: 6.9
-Release: 9%{?dist}
+Release: 10%{?dist}
 License: GPLv2+
 Group:   System Environment/Base
 Url:     http://www.gnu.org/software/coreutils/
@@ -20,9 +20,11 @@
 Patch1: coreutils-futimens.patch
 Patch2: coreutils-ls-x.patch
 Patch3: coreutils-6.9-cp-i-u.patch
+Patch4: coreutils-6.9-du-ls-upstream.patch
 
 # Our patches
 Patch100: coreutils-chgrp.patch
+Patch101: coreutils-getdateYYYYMMDD.patch
 
 # sh-utils
 Patch703: sh-utils-2.0.11-dateman.patch
@@ -89,9 +91,11 @@
 %patch1 -p1 -b .futimens
 %patch2 -p1 -b .ls-x
 %patch3 -p1 -b .cp-i-u
+%patch4 -p1 -b .du-ls
 
 # Our patches
 %patch100 -p1 -b .chgrp
+%patch101 -p1 -b .getdate
 
 # sh-utils
 %patch703 -p1 -b .dateman
@@ -285,6 +289,15 @@
 /sbin/runuser
 
 %changelog
+* Fri Nov 23 2007 Ondrej Vasik <ovasik at redhat.com> - 6.9-10
+- fixed bug in handling YYYYMMDD date format with relative
+  signed offset(#377821)
+- fixed bug in selinux patch which caused bad preserving
+  of security context in install(#319231)
+- added some upstream supported dircolors TERMs(#239266)
+- fixed du output for unaccesible dirs(#250089)
+- a bit of upstream tunning for symlinks
+
 * Tue Oct 30 2007 Ondrej Vasik <ovasik at redhat.com> - 6.9-9
 - applied upstream patch for runuser to coreutils-selinux.patch(#232652)
 - modified coreutils-i18n.patch because of sort -R in




More information about the fedora-extras-commits mailing list