summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-03-27 08:56:26 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-03-27 08:56:26 +0000
commit71d2a66f4220a64ac896706d56c0de7eae7b8d2e (patch)
tree8405050d0914ea5bbe28aa2aaf37737d990621af
parente496c1b52955887eb0a7544eb621e896c989c6ac (diff)
downloadtar-71d2a66f4220a64ac896706d56c0de7eae7b8d2e.tar.gz
* 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.
-rw-r--r--ChangeLog13
-rw-r--r--THANKS1
-rw-r--r--src/common.h2
-rw-r--r--src/incremen.c3
-rw-r--r--src/tar.c18
5 files changed, 36 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 83a613f8..3a62405d 100644
--- 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 6d9e4328..1b40c3eb 100644
--- 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
diff --git a/src/common.h b/src/common.h
index e2fdf0d1..9e0a3fbd 100644
--- a/src/common.h
+++ b/src/common.h
@@ -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;
diff --git a/src/incremen.c b/src/incremen.c
index 1c9113ce..d75b844c 100644
--- a/src/incremen.c
+++ b/src/incremen.c
@@ -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))
{
diff --git a/src/tar.c b/src/tar.c
index f3228e14..4a58a74b 100644
--- 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. */