summaryrefslogtreecommitdiff
path: root/archivers/gtar-base/patches/patch-ab
blob: 4d51aabdf0535610fe7a9539f3f60e70bac87808 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$NetBSD: patch-ab,v 1.14 2010/12/12 13:10:40 wiz Exp $
add --no-unlink-first option to negate --unlink-first option
earlier patches made --unlink-first a default, but that was dropped years ago

--- src/tar.c.orig	2010-10-24 18:07:55.000000000 +0000
+++ src/tar.c
@@ -300,6 +300,7 @@ enum
   NO_RECURSION_OPTION,
   NO_SAME_OWNER_OPTION,
   NO_SAME_PERMISSIONS_OPTION,
+  NO_UNLINK_FIRST_OPTION,
   NO_SEEK_OPTION,
   NO_UNQUOTE_OPTION,
   NO_WILDCARDS_MATCH_SLASH_OPTION,
@@ -505,6 +506,8 @@ static struct argp_option options[] = {
    N_("try extracting files with the same ownership as exists in the archive (default for superuser)"), GRID+1 },
   {"no-same-owner", NO_SAME_OWNER_OPTION, 0, 0,
    N_("extract files as yourself (default for ordinary users)"), GRID+1 },
+  {"no-unlink-first", NO_UNLINK_FIRST_OPTION, 0, 0,
+   N_("don't remove each file prior to extracting"), GRID+1 },
   {"numeric-owner", NUMERIC_OWNER_OPTION, 0, 0,
    N_("always use numbers for user/group names"), GRID+1 },
   {"preserve-permissions", 'p', 0, 0,
@@ -1644,6 +1647,10 @@ parse_opt (int key, char *arg, struct ar
       set_subcommand_option (TEST_LABEL_SUBCOMMAND);
       break;
 
+    case NO_UNLINK_FIRST_OPTION:
+      old_files_option = DEFAULT_OLD_FILES;
+      break;
+
     case 'T':
       update_argv (arg, state);
       /* Indicate we've been given -T option. This is for backward