if (write_flags & WIMLIB_WRITE_FLAG_STREAMS_OK)
DEBUG("\tSTREAMS_OK");
+ if (write_flags & WIMLIB_WRITE_FLAG_RETAIN_GUID)
+ DEBUG("\tRETAIN_GUID");
+
if (write_flags & WIMLIB_WRITE_FLAG_PACK_STREAMS)
DEBUG("\tPACK_STREAMS");
DEBUG("Number of threads: %u", num_threads);
DEBUG("Progress function: %s", (progress_func ? "yes" : "no"));
DEBUG("Stream list: %s", (stream_list_override ? "specified" : "autodetect"));
- DEBUG("GUID: %s", ((guid || wim->guid_set_explicitly) ?
- "specified" : "generate new"));
+ DEBUG("GUID: %s", (guid ||
+ (write_flags & WIMLIB_WRITE_FLAG_RETAIN_GUID)) ?
+ "explicit" : "generate new");
/* Internally, this is always called with a valid part number and total
* parts. */
/* Use GUID if specified; otherwise generate a new one. */
if (guid)
memcpy(wim->hdr.guid, guid, WIMLIB_GUID_LEN);
- else if (!wim->guid_set_explicitly)
+ else if (!(write_flags & WIMLIB_WRITE_FLAG_RETAIN_GUID))
randomize_byte_array(wim->hdr.guid, WIMLIB_GUID_LEN);
/* Clear references to resources that have not been written yet. */
tmpfile[wim_name_len + 9] = T('\0');
ret = wimlib_write(wim, tmpfile, WIMLIB_ALL_IMAGES,
- write_flags | WIMLIB_WRITE_FLAG_FSYNC,
+ write_flags |
+ WIMLIB_WRITE_FLAG_FSYNC |
+ WIMLIB_WRITE_FLAG_RETAIN_GUID,
num_threads, progress_func);
if (ret) {
tunlink(tmpfile);