diff --git a/source/dub/compilers/utils.d b/source/dub/compilers/utils.d index 7780203..48e312d 100644 --- a/source/dub/compilers/utils.d +++ b/source/dub/compilers/utils.d @@ -83,6 +83,7 @@ void resolveLibs(ref BuildSettings settings) { import std.string : format; + import std.array : array; if (settings.libs.length == 0) return; diff --git a/source/dub/internal/vibecompat/core/file.d b/source/dub/internal/vibecompat/core/file.d index afacf52..92b79ae 100644 --- a/source/dub/internal/vibecompat/core/file.d +++ b/source/dub/internal/vibecompat/core/file.d @@ -112,20 +112,26 @@ removeFile(to); } - .copy(from.toNativeString(), to.toNativeString()); - - // try to preserve ownership/permissions in Posix - version (Posix) { - import core.sys.posix.sys.stat; - import core.sys.posix.unistd; - import std.utf; - auto cspath = toUTFz!(const(char)*)(from.toNativeString()); - auto cdpath = toUTFz!(const(char)*)(to.toNativeString()); - stat_t st; - enforce(stat(cspath, &st) == 0, "Failed to get attributes of source file."); - if (chown(cdpath, st.st_uid, st.st_gid) != 0) - st.st_mode &= ~(S_ISUID | S_ISGID); - chmod(cdpath, st.st_mode); + static if (is(PreserveAttributes)) + { + .copy(from.toNativeString(), to.toNativeString(), PreserveAttributes.yes); + } + else + { + .copy(from.toNativeString(), to.toNativeString()); + // try to preserve ownership/permissions in Posix + version (Posix) { + import core.sys.posix.sys.stat; + import core.sys.posix.unistd; + import std.utf; + auto cspath = toUTFz!(const(char)*)(from.toNativeString()); + auto cdpath = toUTFz!(const(char)*)(to.toNativeString()); + stat_t st; + enforce(stat(cspath, &st) == 0, "Failed to get attributes of source file."); + if (chown(cdpath, st.st_uid, st.st_gid) != 0) + st.st_mode &= ~(S_ISUID | S_ISGID); + chmod(cdpath, st.st_mode); + } } } /// ditto diff --git a/source/dub/version_.d b/source/dub/version_.d index 613930c..75c9c36 100644 --- a/source/dub/version_.d +++ b/source/dub/version_.d @@ -1,2 +1,2 @@ module dub.version_; -enum dubVersion = "v1.1.0"; +enum dubVersion = "v1.1.1-beta.1";