Advertisement
Guest User

Untitled

a guest
Aug 16th, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. --- tar-1.29-origin/src/incremen.c 2016-08-15 15:11:17.933557116 +0200
  2. +++ tar-1.29/src/incremen.c 2016-08-16 13:37:03.163495153 +0200
  3. @@ -502,10 +502,22 @@
  4. }
  5. else
  6. {
  7. - perhaps_renamed = true;
  8. - directory->children = ALL_CHILDREN;
  9. - directory->device_number = stat_data->st_dev;
  10. - directory->inode_number = stat_data->st_ino;
  11. + if(ignore_root_inode)
  12. + {
  13. + const char root_dir_char[] = ".";
  14. + if(strcmp(name_buffer, root_dir_char) != 0)
  15. + {
  16. + perhaps_renamed = true;
  17. + directory->children = ALL_CHILDREN;
  18. + directory->device_number = stat_data->st_dev;
  19. + directory->inode_number = stat_data->st_ino;
  20. + }
  21. + } else {
  22. + perhaps_renamed = true;
  23. + directory->children = ALL_CHILDREN;
  24. + directory->device_number = stat_data->st_dev;
  25. + directory->inode_number = stat_data->st_ino;
  26. + }
  27. }
  28. if (nfs)
  29. DIR_SET_FLAG (directory, DIRF_NFS);
  30. --- tar-1.29-origin/src/tar.c 2016-08-15 15:11:17.933557116 +0200
  31. +++ tar-1.29/src/tar.c 2016-08-16 13:28:25.026194462 +0200
  32. @@ -290,6 +290,7 @@
  33. KEEP_DIRECTORY_SYMLINK_OPTION,
  34. KEEP_NEWER_FILES_OPTION,
  35. LEVEL_OPTION,
  36. + IGNORE_ROOT_INODE,
  37. LZIP_OPTION,
  38. LZMA_OPTION,
  39. LZOP_OPTION,
  40. @@ -431,6 +432,8 @@
  41. N_("handle new GNU-format incremental backup"), GRID+1 },
  42. {"level", LEVEL_OPTION, N_("NUMBER"), 0,
  43. N_("dump level for created listed-incremental archive"), GRID+1 },
  44. + {"ignore-root-inode", IGNORE_ROOT_INODE , 0, 0,
  45. + N_("ignore root inode changed for incremental backup"), GRID+1 },
  46. {"ignore-failed-read", IGNORE_FAILED_READ_OPTION, 0, 0,
  47. N_("do not exit with nonzero on unreadable files"), GRID+1 },
  48. {"occurrence", OCCURRENCE_OPTION, N_("NUMBER"), OPTION_ARG_OPTIONAL,
  49. @@ -1729,7 +1732,10 @@
  50. case IGNORE_COMMAND_ERROR_OPTION:
  51. ignore_command_error_option = true;
  52. break;
  53. -
  54. + case IGNORE_ROOT_INODE:
  55. + ignore_root_inode = true;
  56. + break;
  57. +
  58. case IGNORE_FAILED_READ_OPTION:
  59. ignore_failed_read_option = true;
  60. break;
  61. --- tar-1.29-origin/src/common.h 2016-08-15 15:11:17.933557116 +0200
  62. +++ tar-1.29/src/common.h 2016-08-16 13:17:57.959587643 +0200
  63. @@ -166,6 +166,8 @@
  64.  
  65. GLOBAL bool ignore_failed_read_option;
  66.  
  67. +GLOBAL bool ignore_root_inode;
  68. +
  69. GLOBAL bool ignore_zeros_option;
  70.  
  71. GLOBAL bool incremental_option;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement