]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_lua: s/boost::filesystem/std::filesystem/ 42448/head
authorKefu Chai <kchai@redhat.com>
Thu, 22 Jul 2021 07:49:51 +0000 (15:49 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 22 Jul 2021 08:49:30 +0000 (16:49 +0800)
for less dependencies on 3rd party libraries, and to reduce the
compilation time.

Signed-off-by: Kefu Chai <kchai@redhat.com>
CMakeLists.txt
src/rgw/CMakeLists.txt
src/rgw/rgw_lua.cc
src/test/lazy-omap-stats/CMakeLists.txt

index 2575598a6fe57238463206abc694e4df5af4b295..8e6d9a83436951077d2413902525725e2b05f50f 100644 (file)
@@ -585,7 +585,7 @@ option(WITH_SYSTEM_BOOST "require and build with system Boost" OFF)
 # Boost::thread depends on Boost::atomic, so list it explicitly.
 set(BOOST_COMPONENTS
   atomic chrono thread system regex random program_options date_time
-  iostreams context coroutine filesystem)
+  iostreams context coroutine)
 set(BOOST_HEADER_COMPONENTS container)
 
 if(WITH_MGR)
index e738875a7f08bf21159bd9043cd9aba9549faa78..73364c3aedb395ca0b714ea9feb9137ff0a09af9 100644 (file)
@@ -282,7 +282,7 @@ endif()
 list(APPEND rgw_libs ${LUA_LIBRARIES})
 
 if(WITH_RADOSGW_LUA_PACKAGES)
-  list(APPEND rgw_libs Boost::filesystem)
+  list(APPEND rgw_libs Boost::filesystem StdFilesystem::filesystem)
 endif()
 
 set(rgw_schedulers_srcs
index 946a6ff814184c1bed81d78dad10e8a2cb77ef82..bd08f06bcd99b5affa11586a04ed57bddd3fa8ef 100644 (file)
@@ -6,8 +6,8 @@
 #include "rgw_sal_rados.h"
 #include "rgw_lua.h"
 #ifdef WITH_RADOSGW_LUA_PACKAGES
+#include <filesystem>
 #include <boost/process.hpp>
-#include <boost/filesystem.hpp>
 #include "rgw_lua_version.h"
 #endif
 
@@ -196,10 +196,10 @@ int list_packages(const DoutPrefixProvider *dpp, rgw::sal::Store* store, optiona
 
 int install_packages(const DoutPrefixProvider *dpp, rgw::sal::Store* store, optional_yield y, packages_t& failed_packages, std::string& output) {
   // luarocks directory cleanup
-  boost::system::error_code ec;
+  std::error_code ec;
   const auto& luarocks_path = store->get_luarocks_path();
-  boost::filesystem::remove_all(luarocks_path, ec);
-  if (ec.value() != 0 && ec.value() != ENOENT) {
+  if (!std::filesystem::remove_all(luarocks_path, ec) &&
+      ec != std::errc::no_such_file_or_directory) {
     output.append("failed to clear luarock directory: ");
     output.append(ec.message());
     output.append("\n");
index 636d24c4e82d4b06cf456f25c851d3814c1fddb9..1dac35469c23712256b5af116e4b229c160745f9 100644 (file)
@@ -4,7 +4,7 @@ add_executable(ceph_test_lazy_omap_stats
   main.cc
   lazy_omap_stats_test.cc)
 target_link_libraries(ceph_test_lazy_omap_stats
-  librados Boost::system Boost::filesystem ${UNITTEST_LIBS})
+  librados Boost::system ${UNITTEST_LIBS})
 install(TARGETS
   ceph_test_lazy_omap_stats
   DESTINATION ${CMAKE_INSTALL_BINDIR})