aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-03-08 23:51:55 -0800
committerRobert Schumacher <roschuma@microsoft.com>2018-03-08 23:51:55 -0800
commit965e99cf268b32cc32e0599d99e6c9a1991e95f4 (patch)
tree9c2e9ae6789214f9f87e72f828ad4c47a9ff7dfc
parenta506559ba9ff9aab7a6176b43313a8ce26891269 (diff)
downloadvcpkg-965e99cf268b32cc32e0599d99e6c9a1991e95f4.tar.gz
vcpkg-965e99cf268b32cc32e0599d99e6c9a1991e95f4.zip
[rttr] Fix executables. Fix read-only permissions.
-rw-r--r--ports/rttr/CONTROL2
-rw-r--r--ports/rttr/portfile.cmake9
-rw-r--r--ports/rttr/remove-owner-read-perms.patch41
-rw-r--r--toolsrc/src/vcpkg/remove.cpp19
4 files changed, 66 insertions, 5 deletions
diff --git a/ports/rttr/CONTROL b/ports/rttr/CONTROL
index e7ed99b8c..80cff00bd 100644
--- a/ports/rttr/CONTROL
+++ b/ports/rttr/CONTROL
@@ -1,3 +1,3 @@
Source: rttr
-Version: 0.9.5-1
+Version: 0.9.5-2
Description: an easy and intuitive way to use reflection in C++
diff --git a/ports/rttr/portfile.cmake b/ports/rttr/portfile.cmake
index da66d3134..bfb1d23ad 100644
--- a/ports/rttr/portfile.cmake
+++ b/ports/rttr/portfile.cmake
@@ -20,6 +20,7 @@ vcpkg_apply_patches(
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/fix-directory-output.patch"
"${CMAKE_CURRENT_LIST_DIR}/disable-unit-tests.patch"
+ "${CMAKE_CURRENT_LIST_DIR}/remove-owner-read-perms.patch"
)
vcpkg_configure_cmake(
@@ -31,6 +32,14 @@ vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
+file(GLOB REL_EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe)
+file(GLOB DBG_EXES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
+if(REL_EXES)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/rttr)
+ file(COPY ${REL_EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/rttr)
+endif()
+file(REMOVE ${REL_EXES} ${DBG_EXES})
+
#Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/rttr)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/rttr/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/rttr/copyright)
diff --git a/ports/rttr/remove-owner-read-perms.patch b/ports/rttr/remove-owner-read-perms.patch
new file mode 100644
index 000000000..918de14cc
--- /dev/null
+++ b/ports/rttr/remove-owner-read-perms.patch
@@ -0,0 +1,41 @@
+diff --git a/CMake/config.cmake b/CMake/config.cmake
+index 1d753b3..393e3d0 100644
+--- a/CMake/config.cmake
++++ b/CMake/config.cmake
+@@ -131,4 +131,4 @@ install(
+
+ install(FILES "${LICENSE_FILE}" "${README_FILE}"
+ DESTINATION "."
+- PERMISSIONS OWNER_READ)
++ )
+diff --git a/CMake/utility.cmake b/CMake/utility.cmake
+index 9dbc172..c37671e 100644
+--- a/CMake/utility.cmake
++++ b/CMake/utility.cmake
+@@ -165,7 +165,7 @@ function(loadFolder FOLDER _HEADER_FILES _SOURCE_FILES)
+ # we don't want to install header files which are marked as private
+ if (${shouldInstall})
+ if (NOT ${FULL_HEADER_PATH} MATCHES ".*_p.h$")
+- install(FILES ${FULL_HEADER_PATH} DESTINATION "include/${DIRNAME}/${REL_PATH}" PERMISSIONS OWNER_READ)
++ install(FILES ${FULL_HEADER_PATH} DESTINATION "include/${DIRNAME}/${REL_PATH}")
+ endif()
+ endif()
+ endforeach()
+diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
+index ec10eaf..454c41e 100644
+--- a/doc/CMakeLists.txt
++++ b/doc/CMakeLists.txt
+@@ -127,11 +127,11 @@ add_custom_target(doc ALL
+ install(DIRECTORY "${DOXYGEN_OUTPUT_DIRECTORY}/${DOXYGEN_CUSTOM_HTML_DIR}"
+ DESTINATION "${DOXYGEN_DOC_INSTALL_DIR}"
+ PATTERN "*.*"
+- PERMISSIONS OWNER_READ)
++ )
+
+ install(FILES "${DOXYGEN_OUTPUT_DIRECTORY}/${DOXYGEN_INDEX_FILE}"
+ DESTINATION "${DOXYGEN_DOC_INSTALL_DIR}"
+- PERMISSIONS OWNER_READ)
++ )
+
+ #########################################################################################
+
diff --git a/toolsrc/src/vcpkg/remove.cpp b/toolsrc/src/vcpkg/remove.cpp
index 3eaf991ce..32433b234 100644
--- a/toolsrc/src/vcpkg/remove.cpp
+++ b/toolsrc/src/vcpkg/remove.cpp
@@ -58,7 +58,7 @@ namespace vcpkg::Remove
const auto status = fs.status(target, ec);
if (ec)
{
- System::println(System::Color::error, "failed: %s", ec.message());
+ System::println(System::Color::error, "failed: status(%s): %s", target.u8string(), ec.message());
continue;
}
@@ -71,12 +71,23 @@ namespace vcpkg::Remove
fs.remove(target, ec);
if (ec)
{
- System::println(System::Color::error, "failed: %s: %s", target.u8string(), ec.message());
+#if defined(_WIN32)
+ fs::stdfs::permissions(target, fs::stdfs::perms::owner_all | fs::stdfs::perms::group_all, ec);
+ fs.remove(target, ec);
+ if (ec)
+ {
+ System::println(
+ System::Color::error, "failed: remove(%s): %s", target.u8string(), ec.message());
+ }
+#else
+ System::println(
+ System::Color::error, "failed: remove(%s): %s", target.u8string(), ec.message());
+#endif
}
}
- else if (!fs::status_known(status))
+ else if (!fs::stdfs::exists(status))
{
- System::println(System::Color::warning, "Warning: unknown status: %s", target.u8string());
+ System::println(System::Color::warning, "Warning: %s: file not found", target.u8string());
}
else
{