* 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.
This commit is contained in:
Sergey Poznyakoff
2008-03-27 08:56:26 +00:00
parent e496c1b529
commit 71d2a66f42
5 changed files with 36 additions and 1 deletions

View File

@@ -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.

1
THANKS
View File

@@ -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

View 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;

View 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))
{

View File

@@ -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. */