* WIM files can optionally contain an array of SHA1 message digests at the end,
* one digest for each 1 MB of the file. This file implements the checking of
* the digests, and the writing of the digests for new WIM files.
- *
+ */
+
+/*
* Copyright (C) 2012 Eric Biggers
*
- * wimlib - Library for working with WIM files
+ * This file is part of wimlib, a library for working with WIM files.
*
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option) any
- * later version.
+ * wimlib is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
*
- * You should have received a copy of the GNU Lesser General Public License along
- * with this library; if not, write to the Free Software Foundation, Inc., 59
- * Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wimlib; if not, see http://www.gnu.org/licenses/.
*/
#include "wimlib_internal.h"
u32 integrity_table_size;
int ret;
- DEBUG("Writing integrity table.\n");
+ DEBUG("Writing integrity table\n");
if (fseeko(out, end_header_offset, SEEK_SET) != 0) {
ERROR("Failed to seek to byte %"PRIu64" of WIM "
"to calculate integrity data: %m\n",
fflush(stdout);
}
+
size_t bytes_to_read = min(INTEGRITY_CHUNK_SIZE, bytes_remaining);
size_t bytes_read = fread(chunk_buf, 1, bytes_to_read, out);
if (bytes_read != bytes_to_read) {
bytes_remaining -= bytes_read;
}
if (show_progress)
- putchar('\n');
+ puts("Calculating integrity checksums for WIM "
+ "(0 bytes remaining, 100% done)"
+ " ");
if (fseeko(out, 0, SEEK_END) != 0) {
ERROR("Failed to seek to end of WIM to write integrity "