From c52da37557b77351f702a865909582b29ed02d1c Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 20 Aug 2013 18:04:22 -0500 Subject: [PATCH] wimlib-imagex: Simplify options for delta WIMs & template images --- NEWS | 4 ++-- doc/imagex-capture.1.in | 12 ++++++------ programs/imagex.c | 31 +++++++++++++++---------------- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/NEWS b/NEWS index 13cf485c..e11c1f2c 100644 --- a/NEWS +++ b/NEWS @@ -9,11 +9,11 @@ Version 1.5.0: To better support incremental backups, added support for declaring an image as a modified form of another image. See the documentation for - the '--as-update-of' option of `wimlib-imagex append' and `wimlib-imagex + the '--update-of' option of `wimlib-imagex append' and `wimlib-imagex capture'. Added supported for "delta" WIMs. See the documentation for the - '--as-delta-from' option of `wimlib-imagex capture'. + '--delta-from' option of `wimlib-imagex capture'. The library support for managing split WIMs has been changed to support other arrangements, such as delta WIMs, and be easier to use. This diff --git a/doc/imagex-capture.1.in b/doc/imagex-capture.1.in index 42719119..0aa4a2aa 100644 --- a/doc/imagex-capture.1.in +++ b/doc/imagex-capture.1.in @@ -394,7 +394,7 @@ default for \fB@IMAGEX_PROGNAME@ capture\fR, except when writing to standard output (\fIWIMFILE\fR specified as "-"), and also for \fB@IMAGEX_PROGNAME@ append\fR, except when appending to a WIM that is already pipable. .TP -\fB--as-update-of\fR=[\fIWIMFILE\fR]:\fIIMAGE\fR +\fB--update-of\fR=[\fIWIMFILE\fR]:\fIIMAGE\fR Declares that the image being captured from \fISOURCE\fR is mostly the same as the existing image \fIIMAGE\fR in \fIWIMFILE\fR, but captured at a later point in time, possibly with some modifications in the intervening time. This is @@ -410,12 +410,12 @@ appear not to have been modified since they were archived in the existing performance and does not change the resulting WIM file. .IP "" As shown, the full syntax for the argument to this option is to specify the WIM -file, a colon, and the image; for example, "--as-update-of mywim.wim:1". +file, a colon, and the image; for example, "--update-of mywim.wim:1". However, the WIM file may be omitted, in which case it will default to the WIM file being appended to for append operations, or the WIM file from which a delta -is being taken (with \fB--as-delta-from\fR, if specified) for capture operations. +is being taken (with \fB--delta-from\fR, if specified) for capture operations. .TP -\fB--as-delta-from\fR=\fIWIMFILE\fR +\fB--delta-from\fR=\fIWIMFILE\fR For \fB@IMAGEX_PROGNAME@ capture\fR only: capture the new WIM as a "delta" from \fIWIMFILE\fR. Any streams that would ordinarily need to be archived in the new WIM are omitted if they are already present in the \fIWIMFILE\fR on which the @@ -429,7 +429,7 @@ Beware to retain the proper functioning of the delta WIM, you can only add, not delete, files and images to the base WIM following the capture of a delta from it. .IP "" -\fB--as-delta-from\fR may be combined with \fB--as-update-of\fR to increase the +\fB--delta-from\fR may be combined with \fB--update-of\fR to increase the speed of capturing a delta WIM. .IP "" As an example, consider the following backup and restore sequence: @@ -443,7 +443,7 @@ $ wimcapture /some/directory bkup-base.wim (some days later, create second backup as delta from first) $ wimcapture /some/directory bkup-2013-08-20.dwm \\ - --as-update-of=winbkup.wim:-1 --as-delta-from=winbkup.wim + --update-of=winbkup.wim:-1 --delta-from=winbkup.wim (restoring the second backup) diff --git a/programs/imagex.c b/programs/imagex.c index 031f555b..370681a5 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -118,8 +118,6 @@ static FILE *imagex_info_file; enum { IMAGEX_ALLOW_OTHER_OPTION, - IMAGEX_AS_DELTA_FROM_OPTION, - IMAGEX_AS_UPDATE_OF_OPTION, IMAGEX_BOOT_OPTION, IMAGEX_CHECK_OPTION, IMAGEX_COMMAND_OPTION, @@ -127,6 +125,7 @@ enum { IMAGEX_COMPRESS_OPTION, IMAGEX_CONFIG_OPTION, IMAGEX_DEBUG_OPTION, + IMAGEX_DELTA_FROM_OPTION, IMAGEX_DEREFERENCE_OPTION, IMAGEX_DEST_DIR_OPTION, IMAGEX_EXTRACT_XML_OPTION, @@ -159,6 +158,7 @@ enum { IMAGEX_THREADS_OPTION, IMAGEX_TO_STDOUT_OPTION, IMAGEX_UNIX_DATA_OPTION, + IMAGEX_UPDATE_OF_OPTION, IMAGEX_VERBOSE_OPTION, IMAGEX_XML_OPTION, }; @@ -203,9 +203,8 @@ static const struct option capture_or_append_options[] = { {T("norpfix"), no_argument, NULL, IMAGEX_NORPFIX_OPTION}, {T("pipable"), no_argument, NULL, IMAGEX_PIPABLE_OPTION}, {T("not-pipable"), no_argument, NULL, IMAGEX_NOT_PIPABLE_OPTION}, - {T("as-update-of"), required_argument, NULL, IMAGEX_AS_UPDATE_OF_OPTION}, - {T("as-update-from"), required_argument, NULL, IMAGEX_AS_UPDATE_OF_OPTION}, - {T("as-delta-from"), required_argument, NULL, IMAGEX_AS_DELTA_FROM_OPTION}, + {T("update-of"), required_argument, NULL, IMAGEX_UPDATE_OF_OPTION}, + {T("delta-from"), required_argument, NULL, IMAGEX_DELTA_FROM_OPTION}, {NULL, 0, NULL, 0}, }; @@ -1731,9 +1730,9 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd) case IMAGEX_NOT_PIPABLE_OPTION: write_flags |= WIMLIB_WRITE_FLAG_NOT_PIPABLE; break; - case IMAGEX_AS_UPDATE_OF_OPTION: + case IMAGEX_UPDATE_OF_OPTION: if (template_image_name_or_num) { - imagex_error(T("'--as-update-of' can only be " + imagex_error(T("'--update-of' can only be " "specified one time!")); goto out_err; } else { @@ -1750,14 +1749,14 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd) } } break; - case IMAGEX_AS_DELTA_FROM_OPTION: + case IMAGEX_DELTA_FROM_OPTION: if (cmd != CMD_CAPTURE) { - imagex_error(T("'--as-delta-from' is only " + imagex_error(T("'--delta-from' is only " "valid for capture!")); goto out_usage; } if (base_wimfile) { - imagex_error(T("'--as-delta-from' can only be " + imagex_error(T("'--delta-from' can only be " "specified one time!")); goto out_err; } @@ -1801,8 +1800,8 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd) set_fd_to_binary_mode(wim_fd); } - /* If template image was specified using --as-update-of=IMAGE rather - * than --as-update-of=WIMFILE:IMAGE, set the default WIMFILE. */ + /* If template image was specified using --update-of=IMAGE rather + * than --update-of=WIMFILE:IMAGE, set the default WIMFILE. */ if (template_image_name_or_num && !template_wimfile) { if (base_wimfile) { /* Capturing delta WIM: default to base WIM. */ @@ -1815,7 +1814,7 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd) /* Capturing a normal (non-delta) WIM, so the WIM file * *must* be explicitly specified. */ imagex_error(T("For capture of non-delta WIM, " - "'--as-update-of' must specify " + "'--update-of' must specify " "WIMFILE:IMAGE!")); goto out_usage; } @@ -2012,7 +2011,7 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd) if (desc || flags_element || template_image_name_or_num) { /* User provided or element, or an image * on which the added one is to be based has been specified with - * --as-update-of. Get the index of the image we just + * --update-of. Get the index of the image we just * added, then use it to call the appropriate functions. */ struct wimlib_wim_info info; @@ -3603,7 +3602,7 @@ T( " [--dereference] [--config=FILE] [--threads=NUM_THREADS]\n" " [--rebuild] [--unix-data] [--source-list] [--no-acls]\n" " [--strict-acls] [--rpfix] [--norpfix] [--pipable]\n" -" [--not-pipable] [--as-update-of=[WIMFILE:]IMAGE]\n" +" [--not-pipable] [--update-of=[WIMFILE:]IMAGE]\n" ), [CMD_APPLY] = T( @@ -3621,7 +3620,7 @@ T( " [--verbose] [--dereference] [--config=FILE]\n" " [--threads=NUM_THREADS] [--unix-data] [--source-list]\n" " [--no-acls] [--strict-acls] [--norpfix] [--pipable]\n" -" [--as-update-of=[WIMFILE:]IMAGE] [--as-delta-from=WIMFILE]\n" +" [--update-of=[WIMFILE:]IMAGE] [--delta-from=WIMFILE]\n" ), [CMD_DELETE] = T( -- 2.43.0