]> wimlib.net Git - wimlib/blobdiff - src/unix_capture.c
Add WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE
[wimlib] / src / unix_capture.c
index eb3005d41f504af88d5355faafd6f48b85cc5fc6..fe95b9a6b6c7173bca3e225a657b7d30136fc343 100644 (file)
@@ -145,12 +145,9 @@ unix_capture_symlink(struct wim_dentry **root_p,
        inode->i_attributes = FILE_ATTRIBUTE_REPARSE_POINT;
        inode->i_reparse_tag = WIM_IO_REPARSE_TAG_SYMLINK;
 
-       /* The idea here is to call readlink() to get the UNIX target of
-        * the symbolic link, then turn the target into a reparse point
-        * data buffer that contains a relative or absolute symbolic
-        * link (NOT a junction point or *full* path symbolic link with
-        * drive letter).
-        */
+       /* The idea here is to call readlink() to get the UNIX target of the
+        * symbolic link, then turn the target into a reparse point data buffer
+        * that contains a relative or absolute symbolic link. */
        deref_name_len = readlink(path, deref_name_buf,
                                  sizeof(deref_name_buf) - 1);
        if (deref_name_len >= 0) {
@@ -213,7 +210,7 @@ unix_build_dentry_tree_recursive(struct wim_dentry **root_ret,
                {
                        union wimlib_progress_info info;
                        info.scan.cur_path = path;
-                       info.scan.excluded = true;
+                       info.scan.status = WIMLIB_SCAN_DENTRY_EXCLUDED;
                        params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
                }
                goto out;
@@ -224,7 +221,7 @@ unix_build_dentry_tree_recursive(struct wim_dentry **root_ret,
        {
                union wimlib_progress_info info;
                info.scan.cur_path = path;
-               info.scan.excluded = false;
+               info.scan.status = WIMLIB_SCAN_DENTRY_OK;
                params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
        }
 
@@ -244,9 +241,19 @@ unix_build_dentry_tree_recursive(struct wim_dentry **root_ret,
        }
        if (!S_ISREG(stbuf.st_mode) && !S_ISDIR(stbuf.st_mode)
            && !S_ISLNK(stbuf.st_mode)) {
-               ERROR("`%s' is not a regular file, directory, or symbolic link.",
-                     path);
-               ret = WIMLIB_ERR_SPECIAL_FILE;
+               if (params->add_flags & WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE)
+               {
+                       ERROR("Can't archive unsupported file \"%s\"", path);
+                       return WIMLIB_ERR_UNSUPPORTED_FILE;
+               }
+               if ((params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE)
+                   && params->progress_func)
+               {
+                       union wimlib_progress_info info;
+                       info.scan.cur_path = path;
+                       info.scan.status = WIMLIB_SCAN_DENTRY_UNSUPPORTED;
+                       params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
+               }
                goto out;
        }