summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-arch/tar/files')
-rw-r--r--app-arch/tar/files/tar-1.25-incremental-fix.patch133
-rw-r--r--app-arch/tar/files/tar-1.25-verify-check.patch74
-rw-r--r--app-arch/tar/files/tar-1.25-verify-fix.patch43
3 files changed, 250 insertions, 0 deletions
diff --git a/app-arch/tar/files/tar-1.25-incremental-fix.patch b/app-arch/tar/files/tar-1.25-incremental-fix.patch
new file mode 100644
index 000000000000..0281580c3679
--- /dev/null
+++ b/app-arch/tar/files/tar-1.25-incremental-fix.patch
@@ -0,0 +1,133 @@
+http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00071.html
+http://bugs.gentoo.org/349164
+
+From 065cf0958c39600f2062cbeeb5b76929d03c207b Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Mon, 22 Nov 2010 22:50:58 -0800
+Subject: [PATCH] * 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.
+---
+ src/common.h | 1 -
+ src/create.c | 4 ++--
+ src/incremen.c | 8 ++------
+ src/names.c | 26 --------------------------
+ 4 files changed, 4 insertions(+), 35 deletions(-)
+
+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
+--
+1.7.3.1
+
diff --git a/app-arch/tar/files/tar-1.25-verify-check.patch b/app-arch/tar/files/tar-1.25-verify-check.patch
new file mode 100644
index 000000000000..31f0f7769dec
--- /dev/null
+++ b/app-arch/tar/files/tar-1.25-verify-check.patch
@@ -0,0 +1,74 @@
+From 73d0d1a0f883be5f67534362c99382f1eae8d178 Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff <gray@gnu.org.ua>
+Date: Mon, 15 Nov 2010 11:22:27 +0200
+Subject: [PATCH] Issue a warning if the archive being compared contais transformed file names.
+
+* src/common.h (transform_program_p): New proto.
+* src/transform.c (transform_program_p): New function.
+* src/compare.c (verify_volume): Warn if the archive contains
+transformed file names.
+---
+ src/common.h | 1 +
+ src/compare.c | 13 +++++++++++--
+ src/transform.c | 6 ++++++
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/src/common.h b/src/common.h
+index 69097b3..35e056e 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -779,6 +779,7 @@ void set_transform_expr (const char *expr);
+ bool transform_name (char **pinput, int type);
+ bool transform_name_fp (char **pinput, int type,
+ char *(*fun)(char *, void *), void *);
++bool transform_program_p (void);
+
+ /* Module suffix.c */
+ void set_compression_program_by_suffix (const char *name, const char *defprog);
+diff --git a/src/compare.c b/src/compare.c
+index f3112c6..91ced57 100644
+--- a/src/compare.c
++++ b/src/compare.c
+@@ -512,14 +512,23 @@ diff_archive (void)
+ void
+ verify_volume (void)
+ {
++ int may_fail = 0;
+ if (removed_prefixes_p ())
+ {
+ WARN((0, 0,
+ _("Archive contains file names with leading prefixes removed.")));
++ may_fail = 1;
++ }
++ if (transform_program_p ())
++ {
+ WARN((0, 0,
+- _("Verification may fail to locate original files.")));
++ _("Archive contains transformed file names.")));
++ may_fail = 1;
+ }
+-
++ if (may_fail)
++ WARN((0, 0,
++ _("Verification may fail to locate original files.")));
++
+ if (!diff_buffer)
+ diff_init ();
+
+diff --git a/src/transform.c b/src/transform.c
+index c35133f..77aa0a2 100644
+--- a/src/transform.c
++++ b/src/transform.c
+@@ -628,3 +628,9 @@ transform_name (char **pinput, int type)
+ {
+ return transform_name_fp (pinput, type, NULL, NULL);
+ }
++
++bool
++transform_program_p (void)
++{
++ return transform_head != NULL;
++}
+--
+1.7.3.1
+
diff --git a/app-arch/tar/files/tar-1.25-verify-fix.patch b/app-arch/tar/files/tar-1.25-verify-fix.patch
new file mode 100644
index 000000000000..5f5a81c1a7b9
--- /dev/null
+++ b/app-arch/tar/files/tar-1.25-verify-fix.patch
@@ -0,0 +1,43 @@
+http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00065.html
+http://bugs.gentoo.org/349155
+
+From 24214ca5d506f56dc0cb2a2e1312256472039475 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Mon, 15 Nov 2010 00:07:53 -0800
+Subject: [PATCH] tar: fix --verify option, which broke in 1.24
+
+* NEWS: Document this.
+* src/compare.c (verify_volume): Decode the header before invoking
+diff_archive, as diff_archive no longer does this as of the
+2010-06-28 commit. Also, don't try to invoke diff_archive on a
+zero block.
+* tests/Makefile.am (TESTSUITE_AT): Add verify.at.
+* tests/testsuite.at: Include verify.at.
+* tests/verify.at: New file.
+---
+ NEWS | 10 ++++++++--
+ src/compare.c | 2 ++
+ tests/Makefile.am | 1 +
+ tests/testsuite.at | 2 ++
+ tests/verify.at | 37 +++++++++++++++++++++++++++++++++++++
+ 5 files changed, 50 insertions(+), 2 deletions(-)
+ create mode 100644 tests/verify.at
+
+diff --git a/src/compare.c b/src/compare.c
+index 6b7e6d8..f3112c6 100644
+--- a/src/compare.c
++++ b/src/compare.c
+@@ -611,8 +611,10 @@ verify_volume (void)
+ (0, 0, _("A lone zero block at %s"),
+ STRINGIFY_BIGINT (current_block_ordinal (), buf)));
+ }
++ continue;
+ }
+
++ decode_header (current_header, &current_stat_info, &current_format, 1);
+ diff_archive ();
+ tar_stat_destroy (&current_stat_info);
+ }
+--
+1.7.3.1
+