bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] --keep-old-files bug


From: Jim Meyering
Subject: Re: [Bug-tar] --keep-old-files bug
Date: Mon, 28 Nov 2011 09:00:04 +0100

Sergey Poznyakoff wrote:
> I have installed the attached patch.

Thank you!

I noticed some trailing blanks added by that patch
(a couple marked below)

In case you would like to avoid those, here are some preventive measures:

Run this to set a global git config option to highlight them in git diff
output:

  git config --global color.diff.whitespace 'red reverse'

Add these lines to your ~/.vimrc file if you use vim:
  let c_space_errors=1
  highlight RedundantSpaces ctermbg=red guibg=red
  match RedundantSpaces /\s\+$\| \+\ze\t/

Use this with Emacs:
  http://www.emacswiki.org/emacs/WhiteSpace

> Subject: [PATCH] Fix --keep-old-files option.
>
> The regression was introduced by 8f390db9.  This patch implements additional
> option --skip-old-files, which silently skips members which would cause
> writing over existing files, and restores --keep-old-files to its traditional
> behavior.
...
> diff --git a/src/extract.c b/src/extract.c
...
> +     case KEEP_OLD_FILES:
> +       return RECOVER_NO;
> +       <<<===
>       case KEEP_NEWER_FILES:
>         if (file_newer_p (file_name, stp, &current_stat_info))
>           break;
> diff --git a/src/tar.c b/src/tar.c
...
> @@ -1544,7 +1549,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
>        /* Don't replace existing files.  */
>        old_files_option = KEEP_OLD_FILES;
>        break;
> -
> +      <<<===
>      case 'K':
>        starting_file_option = true;
>        addname (arg, 0, true, NULL);
> @@ -1674,6 +1679,10 @@ parse_opt (int key, char *arg, struct argp_state 
> *state)
>        sparse_option = true;
>        break;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]