]> wimlib.net Git - wimlib/commitdiff
Tweak progress messages
authorEric Biggers <ebiggers3@gmail.com>
Sat, 28 Dec 2013 17:12:31 +0000 (11:12 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 28 Dec 2013 17:12:31 +0000 (11:12 -0600)
include/wimlib.h
programs/imagex.c
src/extract.c

index f627044f714fad6ee9aab4fabb09bae9b2602350..9bd9ac105431748fa83322eaf8a8b32b9973ed2d 100644 (file)
@@ -440,8 +440,8 @@ enum wimlib_progress_msg {
         * ::wimlib_progress_info.extract. */
        WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN = 0,
 
-       /** A file or directory tree within a WIM image (not the full image) is
-        * about to be extracted.  @p info will point to
+       /** One or more file or directory trees within a WIM image (not the full
+        * image) is about to be extracted.  @p info will point to
         * ::wimlib_progress_info.extract. */
        WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN,
 
@@ -693,7 +693,8 @@ union wimlib_progress_info {
 
                /** Path to the root dentry within the WIM for the tree that is
                 * being extracted.  Will be the empty string when extracting a
-                * full image. */
+                * full image, or when extracting a set of paths using
+                * wimlib_extract_paths() or wimlib_extract_pathlist().  */
                const wimlib_tchar *extract_root_wim_source_path;
 
                /** Currently only used for
index 92e64ee775d0b815567e1eb99a566a55b45741c1..5f2bd7b59c1bd141524ce39905435398859296a2 100644 (file)
@@ -1079,7 +1079,7 @@ report_scan_progress(const struct wimlib_progress_info_scan *scan, bool done)
 
                unit_shift = get_unit(scan->num_bytes_scanned, &unit_name);
                imagex_printf(T("\r%"PRIu64" %"TS" scanned (%"PRIu64" files, "
-                               "%"PRIu64" directories)"),
+                               "%"PRIu64" directories)    "),
                              scan->num_bytes_scanned >> unit_shift,
                              unit_name,
                              scan->num_nondirs_scanned,
@@ -1205,14 +1205,17 @@ imagex_progress_func(enum wimlib_progress_msg msg,
                        info->extract.target);
                break;
        case WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN:
-               imagex_printf(T("Extracting "
-                         "\""WIMLIB_WIM_PATH_SEPARATOR_STRING"%"TS"\" from image %d (\"%"TS"\") "
-                         "in \"%"TS"\" to \"%"TS"\"\n"),
-                       info->extract.extract_root_wim_source_path,
-                       info->extract.image,
-                       info->extract.image_name,
-                       info->extract.wimfile_name,
-                       info->extract.target);
+               if (info->extract.extract_root_wim_source_path[0] != T('\0')) {
+                       imagex_printf(T("Extracting "
+                                 "\""WIMLIB_WIM_PATH_SEPARATOR_STRING"%"TS"\" "
+                                 "from image %d (\"%"TS"\") "
+                                 "in \"%"TS"\" to \"%"TS"\"\n"),
+                               info->extract.extract_root_wim_source_path,
+                               info->extract.image,
+                               info->extract.image_name,
+                               info->extract.wimfile_name,
+                               info->extract.target);
+               }
                break;
        case WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS:
                percent_done = TO_PERCENT(info->extract.completed_bytes,
index abce21f030f0c7776d49f2f4e1ff27aba5e9ceb6..c53515d62e723b1ad4d12a1697248227d0d9be0b 100644 (file)
@@ -2391,9 +2391,12 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees,
        }
 
        if (progress_func) {
-               progress_func(*wim_source_path ? WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN :
-                                                WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN,
-                             &ctx.progress);
+               int msg;
+               if (*wim_source_path || (extract_flags & WIMLIB_EXTRACT_FLAG_PATHMODE))
+                       msg = WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN;
+               else
+                       msg = WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN;
+               progress_func(msg, &ctx.progress);
        }
 
        if (!ctx.root_dentry_is_special)