From: Eric Biggers Date: Mon, 28 Apr 2014 06:47:46 +0000 (-0500) Subject: wimupdate: Add --no-replace default option X-Git-Tag: v1.7.0~254 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=8cf21d34c68d8d2a1917d7f6a42e01dcdf35208d wimupdate: Add --no-replace default option --- diff --git a/doc/man1/imagex-update.1.in b/doc/man1/imagex-update.1.in index 83668f5a..f688e6b7 100644 --- a/doc/man1/imagex-update.1.in +++ b/doc/man1/imagex-update.1.in @@ -37,6 +37,10 @@ The \fBadd\fR command supports a subset of the options accepted by \fB@IMAGEX_PROGNAME@-capture\fR; namely, \fB--dereference\fR, \fB--unix-data\fR, \fB--no-acls\fR, and \fB--strict-acls\fR. See \fB@IMAGEX_PROGNAME@-capture\fR (1) for explanations of these options. +.PP +In addition, the \fBadd\fR command supports the \fB--no-replace\fR option, which +causes the \fBadd\fR command to refuse to overwrite existing nondirectory files +in the WIM image. .SS \fBdelete\fR [\fIOPTION\fR...] \fIPATH\fR Delete a file or directory tree from the WIM image. \fIPATH\fR must specify the path inside the WIM image of the file or directory tree to delete. @@ -75,6 +79,9 @@ Use \fB--no-acls\fR for all \fBadd\fR commands. \fB--strict-acls\fR Use \fB--strict-acls\fR for all \fBadd\fR commands. .TP +\fB--no-replace\fR +Use \fB--no-replace\fR for all \fBadd\fR commands. +.TP \fB--config\fR=\fIFILE\fR Set the capture configuration file for all \fBadd\fR commands. See the description of this option in \fB@IMAGEX_PROGNAME@-capture\fR (1). diff --git a/programs/imagex.c b/programs/imagex.c index 81771898..c3a08e8e 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -173,6 +173,7 @@ enum { IMAGEX_NOT_PIPABLE_OPTION, IMAGEX_NO_ACLS_OPTION, IMAGEX_NO_ATTRIBUTES_OPTION, + IMAGEX_NO_REPLACE_OPTION, IMAGEX_NO_WILDCARDS_OPTION, IMAGEX_NULLGLOB_OPTION, IMAGEX_ONE_FILE_ONLY_OPTION, @@ -401,6 +402,7 @@ static const struct option update_options[] = { {T("noacls"), no_argument, NULL, IMAGEX_NO_ACLS_OPTION}, {T("no-acls"), no_argument, NULL, IMAGEX_NO_ACLS_OPTION}, {T("strict-acls"), no_argument, NULL, IMAGEX_STRICT_ACLS_OPTION}, + {T("no-replace"), no_argument, NULL, IMAGEX_NO_REPLACE_OPTION}, {NULL, 0, NULL, 0}, }; @@ -3778,6 +3780,9 @@ imagex_update(int argc, tchar **argv, int cmd) case IMAGEX_STRICT_ACLS_OPTION: default_add_flags |= WIMLIB_ADD_FLAG_STRICT_ACLS; break; + case IMAGEX_NO_REPLACE_OPTION: + default_add_flags |= WIMLIB_ADD_FLAG_NO_REPLACE; + break; default: goto out_usage; }