X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fincremen.c;h=d4ef30a1add3af2cb526d79f52026f45528a4320;hb=38f08784bc95745e0c5e8308d098c3bc89cc9ba5;hp=48de66805defe2be728eb72e36e5d318dbbea4db;hpb=08a8d2dec63967653c7f54a1b4b7cb49c3c12679;p=chaz%2Ftar diff --git a/src/incremen.c b/src/incremen.c index 48de668..d4ef30a 100644 --- a/src/incremen.c +++ b/src/incremen.c @@ -150,6 +150,7 @@ procdir (char *name_buffer, struct stat *stat_data, { struct directory *directory; bool nfs = NFS_FILE_STAT (*stat_data); + struct name *np; if ((directory = find_directory (name_buffer)) != NULL) { @@ -202,8 +203,12 @@ procdir (char *name_buffer, struct stat *stat_data, ? ALL_CHILDREN : CHANGED_CHILDREN; } - - if (one_file_system_option && device != stat_data->st_dev) + + /* 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 */ + && !((np = name_scan (name_buffer, true)) && np->explicit)) directory->children = NO_CHILDREN; else if (children == ALL_CHILDREN) directory->children = ALL_CHILDREN; @@ -454,7 +459,7 @@ read_directory_file (void) incremental_version = 0; if (incremental_version > TAR_INCREMENTAL_VERSION) - ERROR((1, 0, _("Unsupported incremental format version: %s"), + ERROR((1, 0, _("Unsupported incremental format version: %d"), incremental_version)); t = u = (errno = 0, strtoumax (buf, &ebuf, 10)); @@ -648,15 +653,11 @@ get_gnu_dumpdir () to = archive_dir; set_next_block_after (current_header); - if (multi_volume_option) - { - assign_string (&save_name, current_stat_info.orig_file_name); - save_totsize = current_stat_info.stat.st_size; - } + mv_begin (¤t_stat_info); + for (; size > 0; size -= copied) { - if (multi_volume_option) - save_sizeleft = size; + mv_size_left (size); data_block = find_next_block (); if (!data_block) ERROR ((1, 0, _("Unexpected EOF in archive"))); @@ -668,8 +669,8 @@ get_gnu_dumpdir () set_next_block_after ((union block *) (data_block->buffer + copied - 1)); } - if (multi_volume_option) - assign_string (&save_name, 0); + + mv_end (); current_stat_info.stat.st_size = 0; /* For skip_member() and friends to work correctly */ @@ -685,6 +686,12 @@ purge_directory (char const *directory_name) char *current_dir; char *cur, *arc; + if (!current_stat_info.dumpdir) + { + skip_member (); + return; + } + current_dir = savedir (directory_name); if (!current_dir)