Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- tar-1.29-origin/src/incremen.c 2016-08-15 15:11:17.933557116 +0200
- +++ tar-1.29/src/incremen.c 2016-08-16 13:37:03.163495153 +0200
- @@ -502,10 +502,22 @@
- }
- else
- {
- - perhaps_renamed = true;
- - directory->children = ALL_CHILDREN;
- - directory->device_number = stat_data->st_dev;
- - directory->inode_number = stat_data->st_ino;
- + if(ignore_root_inode)
- + {
- + const char root_dir_char[] = ".";
- + if(strcmp(name_buffer, root_dir_char) != 0)
- + {
- + perhaps_renamed = true;
- + directory->children = ALL_CHILDREN;
- + directory->device_number = stat_data->st_dev;
- + directory->inode_number = stat_data->st_ino;
- + }
- + } else {
- + perhaps_renamed = true;
- + directory->children = ALL_CHILDREN;
- + directory->device_number = stat_data->st_dev;
- + directory->inode_number = stat_data->st_ino;
- + }
- }
- if (nfs)
- DIR_SET_FLAG (directory, DIRF_NFS);
- --- tar-1.29-origin/src/tar.c 2016-08-15 15:11:17.933557116 +0200
- +++ tar-1.29/src/tar.c 2016-08-16 13:28:25.026194462 +0200
- @@ -290,6 +290,7 @@
- KEEP_DIRECTORY_SYMLINK_OPTION,
- KEEP_NEWER_FILES_OPTION,
- LEVEL_OPTION,
- + IGNORE_ROOT_INODE,
- LZIP_OPTION,
- LZMA_OPTION,
- LZOP_OPTION,
- @@ -431,6 +432,8 @@
- N_("handle new GNU-format incremental backup"), GRID+1 },
- {"level", LEVEL_OPTION, N_("NUMBER"), 0,
- N_("dump level for created listed-incremental archive"), GRID+1 },
- + {"ignore-root-inode", IGNORE_ROOT_INODE , 0, 0,
- + N_("ignore root inode changed for incremental backup"), GRID+1 },
- {"ignore-failed-read", IGNORE_FAILED_READ_OPTION, 0, 0,
- N_("do not exit with nonzero on unreadable files"), GRID+1 },
- {"occurrence", OCCURRENCE_OPTION, N_("NUMBER"), OPTION_ARG_OPTIONAL,
- @@ -1729,7 +1732,10 @@
- case IGNORE_COMMAND_ERROR_OPTION:
- ignore_command_error_option = true;
- break;
- -
- + case IGNORE_ROOT_INODE:
- + ignore_root_inode = true;
- + break;
- +
- case IGNORE_FAILED_READ_OPTION:
- ignore_failed_read_option = true;
- break;
- --- tar-1.29-origin/src/common.h 2016-08-15 15:11:17.933557116 +0200
- +++ tar-1.29/src/common.h 2016-08-16 13:17:57.959587643 +0200
- @@ -166,6 +166,8 @@
- GLOBAL bool ignore_failed_read_option;
- +GLOBAL bool ignore_root_inode;
- +
- GLOBAL bool ignore_zeros_option;
- GLOBAL bool incremental_option;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement