Author: baggins                      Date: Tue Dec 14 10:48:40 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fix --listed-incremental with --one-file-system creating empty archives

---- Files affected:
packages/tar:
   tar.spec (1.131 -> 1.132) , tar-listed-incremental.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/tar/tar.spec
diff -u packages/tar/tar.spec:1.131 packages/tar/tar.spec:1.132
--- packages/tar/tar.spec:1.131 Thu Nov 11 08:35:21 2010
+++ packages/tar/tar.spec       Tue Dec 14 11:48:34 2010
@@ -12,7 +12,7 @@
 Summary(tr.UTF-8):     Yaygın kullanılan yedekleyici
 Name:          tar
 Version:       1.25
-Release:       1
+Release:       1.1
 Epoch:         1
 License:       GPL v3+
 Group:         Applications/Archiving
@@ -23,6 +23,7 @@
 Patch0:                %{name}-info.patch
 Patch1:                %{name}-pl.po-update.patch
 Patch2:                %{name}-zero-block.patch
+Patch3:                %{name}-listed-incremental.patch
 URL:           http://www.gnu.org/software/tar/tar.html
 BuildRequires: autoconf >= 2.63
 BuildRequires: automake >= 1:1.11
@@ -143,6 +144,7 @@
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %{__rm} po/stamp-po
 
@@ -211,6 +213,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.132  2010/12/14 10:48:34  baggins
+- fix --listed-incremental with --one-file-system creating empty archives
+
 Revision 1.131  2010/11/11 07:35:21  qboosh
 - updated to 1.25 (-C bug should be fixed now)
 - updated pl.po-update patch (from TP)

================================================================
Index: packages/tar/tar-listed-incremental.patch
diff -u /dev/null packages/tar/tar-listed-incremental.patch:1.1
--- /dev/null   Tue Dec 14 11:48:40 2010
+++ packages/tar/tar-listed-incremental.patch   Tue Dec 14 11:48:34 2010
@@ -0,0 +1,123 @@
+From 065cf0958c39600f2062cbeeb5b76929d03c207b Mon Sep 17 00:00:00 2001
+From: Paul Eggert <[email protected]>
+Date: Tue, 23 Nov 2010 06:50:58 +0000
+Subject: * src/names.c: tar: fix bug with --one-file-system 
--listed-incremental
+
+Problem (and idea for fix) reported by Martin Weigel
+<http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00071.html>.
+* src/common.h (is_individual_file): Remove decl.
+* src/create.c (dump_file0): Replace "is_individual_file (p)"
+with "top_level".
+* src/incremen.c (procdir): Replace "!is_individual_file
+(name_buffer)" with "st->parent".  Fix bug with --one-file-system
+and --listed-incremental.
+* src/names.c (individual_file_table, register_individual_file):
+(is_individual_file): Remove.  All uses removed.
+---
+diff --git a/src/common.h b/src/common.h
+index 35e056e..9444fd7 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -680,7 +680,6 @@ bool excluded_name (char const *name);
+ 
+ void add_avoided_name (char const *name);
+ bool is_avoided_name (char const *name);
+-bool is_individual_file (char const *name);
+ 
+ bool contains_dot_dot (char const *name);
+ 
+diff --git a/src/create.c b/src/create.c
+index a1e90a3..e8de6b9 100644
+--- a/src/create.c
++++ b/src/create.c
+@@ -1678,9 +1678,9 @@ dump_file0 (struct tar_stat_info *st, char const *name, 
char const *p)
+      put in the archive.
+ 
+      This check is omitted if incremental_option is set *and* the
+-     requested file is not explicitely listed in the command line. */
++     requested file is not explicitly listed in the command line.  */
+ 
+-  if (!(incremental_option && !is_individual_file (p))
++  if (! (incremental_option && ! top_level)
+       && !S_ISDIR (st->stat.st_mode)
+       && OLDER_TAR_STAT_TIME (*st, m)
+       && (!after_date_option || OLDER_TAR_STAT_TIME (*st, c)))
+diff --git a/src/incremen.c b/src/incremen.c
+index 628ff29..2b33c5d 100644
+--- a/src/incremen.c
++++ b/src/incremen.c
+@@ -426,7 +426,6 @@ procdir (const char *name_buffer, struct tar_stat_info *st,
+ {
+   struct directory *directory;
+   struct stat *stat_data = &st->stat;
+-  dev_t device = st->parent ? st->parent->stat.st_dev : 0;
+   bool nfs = NFS_FILE_STAT (*stat_data);
+ 
+   if ((directory = find_directory (name_buffer)) != NULL)
+@@ -540,11 +539,8 @@ procdir (const char *name_buffer, struct tar_stat_info 
*st,
+       }
+     }
+ 
+-  /* If the directory is on another device and --one-file-system was given,
+-     omit it... */
+-  if (one_file_system_option && device != stat_data->st_dev
+-      /* ... except if it was explicitely given in the command line */
+-      && !is_individual_file (name_buffer))
++  if (one_file_system_option && st->parent
++      && stat_data->st_dev != st->parent->stat.st_dev)
+     /* FIXME:
+       WARNOPT (WARN_XDEV,
+                (0, 0,
+diff --git a/src/names.c b/src/names.c
+index 6e214bf..ba4d509 100644
+--- a/src/names.c
++++ b/src/names.c
+@@ -47,8 +47,6 @@ static char *cached_no_such_gname;
+ static uid_t cached_no_such_uid;
+ static gid_t cached_no_such_gid;
+ 
+-static void register_individual_file (char const *name);
+-
+ /* Given UID, find the corresponding UNAME.  */
+ void
+ uid_to_uname (uid_t uid, char **uname)
+@@ -360,8 +358,6 @@ name_next_elt (int change_dirs)
+       {
+         if (unquote_option)
+           unquote_string (name_buffer);
+-        if (incremental_option)
+-          register_individual_file (name_buffer);
+         entry.type = ep->type;
+         entry.v.name = name_buffer;
+         return &entry;
+@@ -1152,28 +1148,6 @@ excluded_name (char const *name)
+   return excluded_file_name (excluded, name + FILE_SYSTEM_PREFIX_LEN (name));
+ }
+ 
+-static Hash_table *individual_file_table;
+-
+-static void
+-register_individual_file (char const *name)
+-{
+-  struct stat st;
+-
+-  if (deref_stat (name, &st) != 0)
+-    return; /* Will be complained about later */
+-  if (S_ISDIR (st.st_mode))
+-    return;
+-
+-  hash_string_insert (&individual_file_table, name);
+-}
+-
+-bool
+-is_individual_file (char const *name)
+-{
+-  return hash_string_lookup (individual_file_table, name);
+-}
+-
+-
+ 
+ /* Return the size of the prefix of FILE_NAME that is removed after
+    stripping NUM leading file name components.  NUM must be
+--
+cgit v0.8.3.2
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/tar/tar.spec?r1=1.131&r2=1.132&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to