]> Dogcows Code - chaz/tar/commitdiff
* src/common.h (check_device_option): New global.
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 27 Mar 2008 08:56:26 +0000 (08:56 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 27 Mar 2008 08:56:26 +0000 (08:56 +0000)
* src/incremen.c (procdir): Use boolean and instead of bitwise
one. Patch by Jean-Louis Martineau.
Compare device numbers only if check_device_option is set.
* src/tar.c: New command line options --no-check-device and
--check-device. Proposed by Jean-Louis Martineau.
(parse_opt): Hanlde new options.
(decode_options): Initialize check_device_option to true.

ChangeLog
THANKS
src/common.h
src/incremen.c
src/tar.c

index 83a613f8aa62fbbf040bb6bcf403a69ead22f24f..3a62405d6ae5cc6e601e532a5f25e93f07e5a3d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
+
+       * src/common.h (check_device_option): New global.
+       * src/incremen.c (procdir): Use boolean and instead of bitwise
+       one. Patch by Jean-Louis Martineau.
+       Compare device numbers only if check_device_option is set.
+       * src/tar.c: New command line options --no-check-device and
+       --check-device. Proposed by Jean-Louis Martineau.
+       (parse_opt): Hanlde new options.
+       (decode_options): Initialize check_device_option to true.
+       
+       * THANKS: Update
+
 2008-03-06  Sergey Poznyakoff  <gray@gnu.org.ua>
 
        * bootstrap: Use rsync to get translations.
diff --git a/THANKS b/THANKS
index 6d9e432867e6e80db226befaf0ea90679a1e5870..1b40c3eb0bb79460e9b12f04a3b4142ed8fb5bb3 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -217,6 +217,7 @@ Janne Snabb         snabb@niksula.hut.fi
 Jason R. Mastaler      jason@webmaster.net
 Jason Armistead                Jason.Armistead@otis.com
 Jay Fenlason           hack@gnu.org
+Jean-Louis Martineau    martineau@zmanda.com
 Jean-Michel Soenen     soenen@lectra.fr
 Jean-Loup Gailly       jloup@chorus.fr
 Jeff Moskow            jeff@rtr.com
index e2fdf0d13dfa612d101ca74f0cc4e9124ddbf9ce..9e0a3fbd3ba70b88c4ffb51f3ac26b37e1bee4e2 100644 (file)
@@ -188,6 +188,8 @@ GLOBAL enum old_files old_files_option;
 
 /* Specified file name for incremental list.  */
 GLOBAL const char *listed_incremental_option;
+/* Check device numbers when doing incremental dumps. */
+GLOBAL bool check_device_option;
 
 /* Specified mode change string.  */
 GLOBAL struct mode_change *mode_option;
index 1c9113cecbc67c69707ad0c531b79865522bd182..d75b844c979b0871c47a13757246a171eb806ac4 100644 (file)
@@ -250,7 +250,8 @@ procdir (char *name_buffer, struct stat *stat_data,
         directories, consider all NFS devices as equal,
         relying on the i-node to establish differences.  */
 
-      if (! (((DIR_IS_NFS (directory) & nfs)
+      if (! ((!check_device_option
+             || (DIR_IS_NFS (directory) && nfs)
              || directory->device_number == stat_data->st_dev)
             && directory->inode_number == stat_data->st_ino))
        {
index f3228e146c79ebcb9037a86e48599bfe5a8f3131..4a58a74b4280bbe6f042be4421c66178875cbfa1 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -249,6 +249,7 @@ enum
   ANCHORED_OPTION = CHAR_MAX + 1,
   ATIME_PRESERVE_OPTION,
   BACKUP_OPTION,
+  CHECK_DEVICE_OPTION,
   CHECKPOINT_OPTION,
   CHECKPOINT_ACTION_OPTION,
   DELAY_DIRECTORY_RESTORE_OPTION,
@@ -275,6 +276,7 @@ enum
   MTIME_OPTION,
   NEWER_MTIME_OPTION,
   NO_ANCHORED_OPTION,
+  NO_CHECK_DEVICE_OPTION,
   NO_DELAY_DIRECTORY_RESTORE_OPTION,
   NO_IGNORE_CASE_OPTION,
   NO_IGNORE_COMMAND_ERROR_OPTION,
@@ -411,6 +413,12 @@ static struct argp_option options[] = {
       " NUMBER defaults to 1"), GRID+1 },
   {"seek", 'n', NULL, 0,
    N_("archive is seekable"), GRID+1 },
+  {"no-check-device", NO_CHECK_DEVICE_OPTION, NULL, 0,
+   N_("do not check device numbers when creating incremental archives"),
+   GRID+1 },
+  {"check-device", CHECK_DEVICE_OPTION, NULL, 0,
+   N_("check device numbers when creating incremental archives (default)"),
+   GRID+1 },
 #undef GRID
 
 #define GRID 30
@@ -1545,6 +1553,14 @@ parse_opt (int key, char *arg, struct argp_state *state)
                        " on this platform")));
       break;
 
+    case CHECK_DEVICE_OPTION:
+      check_device_option = true;
+      break;
+      
+    case NO_CHECK_DEVICE_OPTION:
+      check_device_option = false;
+      break;
+      
     case CHECKPOINT_OPTION:
       if (arg)
        {
@@ -2053,6 +2069,8 @@ decode_options (int argc, char **argv)
   owner_option = -1;
   group_option = -1;
 
+  check_device_option = true;
+  
   /* Convert old-style tar call by exploding option element and rearranging
      options accordingly.  */
 
This page took 0.033817 seconds and 4 git commands to generate.