Пример #1
0
static int
metadata_filter(struct archive *a, void *_data, struct archive_entry *entry)
{
	struct bsdtar *bsdtar = (struct bsdtar *)_data;

	/* 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.
	 * We want this to be fairly late; if some other
	 * check would veto this file, we shouldn't bother
	 * the user with it.
	 */
	if (bsdtar->option_interactive &&
	    !yes("add '%s'", archive_entry_pathname(entry)))
		return (0);

	/* Note: if user vetoes, we won't descend. */
	if (!bsdtar->option_no_subdirs && archive_read_disk_can_descend(a))
		archive_read_disk_descend(a);

	return (1);
}
Пример #2
0
static int metadata_filter(archive *a, void *data, archive_entry *entry)
{
    (void) data;
    (void) entry;

    if (archive_read_disk_can_descend(a)) {
        archive_read_disk_descend(a);
    }
    return 1;
}
Пример #3
0
static void
excluded_callback(struct archive *a, void *_data, struct archive_entry *entry)
{
	struct bsdtar *bsdtar = (struct bsdtar *)_data;

	if (bsdtar->option_no_subdirs)
		return;
	if (!archive_read_disk_can_descend(a))
		return;
	if (bsdtar->option_interactive &&
	    !yes("add '%s'", archive_entry_pathname(entry)))
		return;
	archive_read_disk_descend(a);
}