Update ranges-v3 to 0.11.0

This commit is contained in:
Sebastian Messmer 2020-07-08 00:11:29 -07:00 committed by Sebastian Messmer
parent a245ac1ffb
commit e2cd97de96
5 changed files with 20 additions and 13 deletions

View File

@ -133,16 +133,16 @@ references:
echo Download range-v3
cd ~
wget https://github.com/ericniebler/range-v3/archive/0.9.1.tar.gz -O range-v3-0.9.1.tar.gz
if [ $(sha512sum range-v3-0.9.1.tar.gz | awk '{print $1;}') == "167db645527b769f3d375db63bb0a5c831e9c854bc729581a7d25c571cc1741eafb82812006c5bbe346222a73d5fbbd0b2f17119317038394ac15cf892088aa3" ]; then
wget https://github.com/ericniebler/range-v3/archive/0.11.0.tar.gz -O range-v3-0.11.0.tar.gz
if [ $(sha512sum range-v3-0.11.0.tar.gz | awk '{print $1;}') == "9d6cdcbc1e50104206ba731c3bdc9aab3acfcf69cd83f0e0b4de18b88df2a9e73d64e55638421768d4433c542b6619f6e5af6b17cccd3090cf8b4d4efe9863e4" ]; then
echo Correct sha512sum
else
echo Wrong sha512sum
sha512sum range-v3-0.9.1.tar.gz
sha512sum range-v3-0.11.0.tar.gz
exit 1
fi
tar -xvf range-v3-0.9.1.tar.gz
cd range-v3-0.9.1/
tar -xvf range-v3-0.11.0.tar.gz
cd range-v3-0.11.0/
echo Install range-v3
mkdir build
@ -150,6 +150,9 @@ references:
cmake .. -DRANGES_HAS_WERROR=off -DRANGE_V3_EXAMPLES=off -DRANGE_V3_TESTS=off
make -j$NUMCORES
sudo make install
cd ~
rm -rf range-v3-0.11.0
rm range-v3-0.11.0.tar.gz
echo Download spdlog
cd ~

View File

@ -29,6 +29,7 @@ New features:
Other:
* Updated to spdlog 1.8.2
* Updated to ranges-v3 0.11.0
Version 0.10.3 (unreleased)
---------------

View File

@ -31,9 +31,9 @@ endfunction()
# Setup range-v3 dependency
find_package(range-v3 REQUIRED)
check_target_is_not_from_conan(range-v3)
check_target_is_not_from_conan(range-v3::range-v3)
add_library(CryfsDependencies_range-v3 INTERFACE)
target_link_libraries(CryfsDependencies_range-v3 INTERFACE range-v3)
target_link_libraries(CryfsDependencies_range-v3 INTERFACE range-v3::range-v3)

View File

@ -3,7 +3,7 @@ from conans import ConanFile, CMake
class CryFSConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = [
"range-v3/0.9.1@ericniebler/stable",
"range-v3/0.11.0@ericniebler/stable",
"spdlog/1.8.2",
]
generators = "cmake"

View File

@ -22,6 +22,7 @@
#include <range/v3/view/split.hpp>
#include <range/v3/view/join.hpp>
#include <range/v3/view/filter.hpp>
#include <range/v3/range/conversion.hpp>
#if defined(_MSC_VER)
#include <dokan/dokan.h>
@ -310,10 +311,12 @@ void extractAllAtimeOptionsAndRemoveOnesUnknownToLibfuse_(string* csv_options, v
constexpr std::array<const char*, 3> flags = {"strictatime", "relatime", "nodiratime"};
return flags.end() != std::find(flags.begin(), flags.end(), flag);
};
*csv_options = *csv_options
| ranges::view::split(',')
| ranges::view::filter(
[&] (const std::string& elem) {
*csv_options = ranges::make_subrange(csv_options->begin(), csv_options->end())
| ranges::views::split(',')
| ranges::views::filter(
[&] (auto&& elem_) {
// TODO string_view would be better
std::string elem(&*elem_.begin(), ranges::distance(elem_));
if (is_fuse_unsupported_atime_flag(elem)) {
result->push_back(elem);
return false;
@ -323,7 +326,7 @@ void extractAllAtimeOptionsAndRemoveOnesUnknownToLibfuse_(string* csv_options, v
}
return true;
})
| ranges::view::join(',')
| ranges::views::join(',')
| ranges::to<string>();
}