Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 953dcd855110118a303762321a186f4a > files > 4

tar-1.15.1-30.el5.src.rpm

 Fix "--keep-newer-files" removing older files based on git commit 
 8d064bb816bf37dbe3e8455322281639a33e2851 for IT#284457
 
 Olivier Fourdan <ofourdan@redhat.com>
 
 extract.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff -up tar-1.15.1/src/extract.c.newer tar-1.15.1/src/extract.c
--- tar-1.15.1/src/extract.c.newer	2009-04-14 11:33:58.000000000 +0100
+++ tar-1.15.1/src/extract.c	2009-04-14 12:47:34.000000000 +0100
@@ -479,8 +479,12 @@ file_newer_p (const char *file_name, str
 
   if (stat (file_name, &st))
     {
+      /* Be on the safe side: if the file does exist assume it is newer */
+      if (errno == ENOENT)
+	return false;
+
       stat_warn (file_name);
-      return true; /* Be on the safe side */
+      return true;
     }
   if (!S_ISDIR (st.st_mode)
       && st.st_mtime >= tar_stat->stat.st_mtime)