summaryrefslogtreecommitdiff
path: root/tar/write.c
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-01-19 06:51:43 -0500
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-01-19 06:51:43 -0500
commitffa08263e3add5f077e444cde2b1488be2984360 (patch)
treed6aef3bc1a55e156c6291b6c3344f6551850cc68 /tar/write.c
parent3df7554a9745565e8b9ad830ce5d65facdae475f (diff)
downloadlibarchive-ffa08263e3add5f077e444cde2b1488be2984360.tar.gz
Implement optional behavior of archive_read_disk that do not traverse mount points if user requests.
SVN-Revision: 4186
Diffstat (limited to 'tar/write.c')
-rw-r--r--tar/write.c42
1 files changed, 13 insertions, 29 deletions
diff --git a/tar/write.c b/tar/write.c
index b3b8355b..d6ba06a2 100644
--- a/tar/write.c
+++ b/tar/write.c
@@ -711,14 +711,6 @@ excluded_callback(struct archive *a, void *_data, struct archive_entry *entry)
return;
if (!archive_read_disk_can_descend(a))
return;
- if (bsdtar->option_dont_traverse_mounts) {
- if (bsdtar->first_fs == -1)
- bsdtar->first_fs =
- archive_read_disk_current_filesystem(a);
- else if (bsdtar->first_fs !=
- archive_read_disk_current_filesystem(a))
- return;
- }
if (bsdtar->option_interactive &&
!yes("add '%s'", archive_entry_pathname(entry)))
return;
@@ -730,27 +722,19 @@ metadata_filter(struct archive *a, void *_data, struct archive_entry *entry)
{
struct bsdtar *bsdtar = (struct bsdtar *)_data;
- if (bsdtar->option_dont_traverse_mounts) {
- if (bsdtar->first_fs == -1)
- bsdtar->first_fs =
- archive_read_disk_current_filesystem(a);
- else if (bsdtar->first_fs !=
- archive_read_disk_current_filesystem(a))
- return (0);
- /* XXX TODO: check whether this filesystem is
- * synthetic and/or local. Add a new
- * --local-only option to skip non-local
- * filesystems. Skip synthetic filesystems
- * regardless.
- *
- * The results should be cached, since
- * tree.c doesn't usually visit a directory
- * and the directory contents together. A simple
- * move-to-front list should perform quite well.
- *
- * Use archive_read_disk_current_filesystem_is_remote().
- */
- }
+ /* XXX TODO: check whether this filesystem is
+ * synthetic and/or local. Add a new
+ * --local-only option to skip non-local
+ * filesystems. Skip synthetic filesystems
+ * regardless.
+ *
+ * The results should be cached, since
+ * tree.c doesn't usually visit a directory
+ * and the directory contents together. A simple
+ * move-to-front list should perform quite well.
+ *
+ * Use archive_read_disk_current_filesystem_is_remote().
+ */
/*
* If the user vetoes this file/directory, skip it.