]> wimlib.net Git - wimlib/blobdiff - src/export_image.c
Limit can_modify_wim() calls; remove can_delete_from_wim()
[wimlib] / src / export_image.c
index 8304ea01a8fda9af7cc622456679899e148a8fd4..54532dd19d2d38f4232d388ad1d10b86413e66f2 100644 (file)
@@ -5,20 +5,18 @@
 /*
  * Copyright (C) 2012, 2013 Eric Biggers
  *
- * This file is part of wimlib, a library for working with WIM files.
+ * This file 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 3 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 General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option)
- * any later version.
- *
- * 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 General Public License for more
+ * This file 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 General Public License
- * along with wimlib; if not, see http://www.gnu.org/licenses/.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this file; if not, see http://www.gnu.org/licenses/.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -110,8 +108,7 @@ wimlib_export_image(WIMStruct *src_wim,
                    WIMStruct *dest_wim,
                    const tchar *dest_name,
                    const tchar *dest_description,
-                   int export_flags,
-                   wimlib_progress_func_t progress_func)
+                   int export_flags)
 {
        int ret;
        int start_image;
@@ -124,7 +121,8 @@ wimlib_export_image(WIMStruct *src_wim,
        if (export_flags & ~(WIMLIB_EXPORT_FLAG_BOOT |
                             WIMLIB_EXPORT_FLAG_NO_NAMES |
                             WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS |
-                            WIMLIB_EXPORT_FLAG_GIFT))
+                            WIMLIB_EXPORT_FLAG_GIFT |
+                            WIMLIB_EXPORT_FLAG_WIMBOOT))
                return WIMLIB_ERR_INVALID_PARAM;
 
        if (src_wim == NULL || dest_wim == NULL)
@@ -133,11 +131,6 @@ wimlib_export_image(WIMStruct *src_wim,
        if (!wim_has_metadata(dest_wim))
                return WIMLIB_ERR_METADATA_NOT_FOUND;
 
-       /* Destination WIM must be writable.  */
-       ret = can_modify_wim(dest_wim);
-       if (ret)
-               return ret;
-
        if (src_image == WIMLIB_ALL_IMAGES) {
                /* Multi-image export.  */
                if ((!(export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES) &&
@@ -263,6 +256,13 @@ wimlib_export_image(WIMStruct *src_wim,
                        dest_wim->hdr.boot_idx = dest_wim->hdr.image_count;
                }
 
+               /* Possibly set WIMBoot flag  */
+               if (export_flags & WIMLIB_EXPORT_FLAG_WIMBOOT) {
+                       wim_info_set_wimboot(dest_wim->wim_info,
+                                            dest_wim->hdr.image_count,
+                                            true);
+               }
+
        }
        /* Set the reparse point fixup flag on the destination WIM if the flag
         * is set on the source WIM. */