Tweak progress messages for imagex apply
authorEric Biggers <ebiggers3@gmail.com>
Wed, 19 Dec 2012 18:49:41 +0000 (12:49 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 19 Dec 2012 18:49:41 +0000 (12:49 -0600)
programs/imagex.c
src/extract_image.c

index 93c4d29..41aba7e 100644 (file)
@@ -407,13 +407,6 @@ static int imagex_progress_func(enum wimlib_progress_msg msg,
                                "NTFS volume" : "directory"),
                       info->extract.target);
                break;
-       case WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END:
-               printf("Done applying WIM image.\n");
-               if (info->extract.extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) {
-                       printf("Unmounting NTFS volume `%s'...\n",
-                              info->extract.target);
-               }
-               break;
        /*case WIMLIB_PROGRESS_MSG_EXTRACT_DIR_STRUCTURE_BEGIN:*/
                /*printf("Applying directory structure to %s\n",*/
                       /*info->extract.target);*/
@@ -432,6 +425,15 @@ static int imagex_progress_func(enum wimlib_progress_msg msg,
        case WIMLIB_PROGRESS_MSG_EXTRACT_DENTRY:
                puts(info->extract.cur_path);
                break;
+       case WIMLIB_PROGRESS_MSG_APPLY_TIMESTAMPS:
+               printf("Setting timestamps on all extracted files...\n");
+               break;
+       case WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END:
+               if (info->extract.extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) {
+                       printf("Unmounting NTFS volume `%s'...\n",
+                              info->extract.target);
+               }
+               break;
        case WIMLIB_PROGRESS_MSG_JOIN_STREAMS:
                percent_done = TO_PERCENT(info->join.completed_bytes,
                                          info->join.total_bytes);
@@ -637,6 +639,8 @@ static int imagex_apply(int argc, const char **argv)
        ret = wimlib_extract_image(w, image, target, extract_flags,
                                   additional_swms, num_additional_swms,
                                   imagex_progress_func);
+       if (ret == 0)
+               printf("Done applying WIM image.\n");
 out:
        wimlib_free(w);
        if (additional_swms) {
index 56c72f8..bebd1d3 100644 (file)
@@ -653,8 +653,10 @@ static int extract_single_image(WIMStruct *w, int image,
        if (ret != 0)
                goto out;
 
-       if (progress_func)
-               progress_func(WIMLIB_PROGRESS_MSG_APPLY_TIMESTAMPS, NULL);
+       if (progress_func) {
+               progress_func(WIMLIB_PROGRESS_MSG_APPLY_TIMESTAMPS,
+                             &args.progress);
+       }
 
        ret = for_dentry_in_tree_depth(wim_root_dentry(w),
                                       ops->apply_dentry_timestamps, &args);