mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 05:30:41 +08:00
[thomasmonkman-filewatch] Add patch for fixing Unix version (#35236)
* Add patch * Add patch * Update version * Add port-version 1 * Add version * Restore git-tree --------- Co-authored-by: Pablo Rodriguez Avila <pabloro@microsoft.com>
This commit is contained in:
parent
2cb6ec989f
commit
00d762bd8c
37
ports/thomasmonkman-filewatch/fix-unix-listen.patch
Normal file
37
ports/thomasmonkman-filewatch/fix-unix-listen.patch
Normal file
@ -0,0 +1,37 @@
|
||||
diff --git a/FileWatch.hpp b/FileWatch.hpp
|
||||
index 4eba08b..2c0ff6d 100644
|
||||
--- a/FileWatch.hpp
|
||||
+++ b/FileWatch.hpp
|
||||
@@ -276,7 +276,7 @@ namespace filewatch {
|
||||
|
||||
FolderInfo _directory;
|
||||
|
||||
- const std::uint32_t _listen_filters = IN_MODIFY | IN_CREATE | IN_DELETE;
|
||||
+ const std::uint32_t _listen_filters = IN_MODIFY | IN_CREATE | IN_DELETE | IN_MOVE;
|
||||
|
||||
const static std::size_t event_size = (sizeof(struct inotify_event));
|
||||
#endif // __unix__
|
||||
@@ -604,7 +604,7 @@ namespace filewatch {
|
||||
}
|
||||
}();
|
||||
|
||||
- const auto watch = inotify_add_watch(folder, watch_path.c_str(), IN_MODIFY | IN_CREATE | IN_DELETE);
|
||||
+ const auto watch = inotify_add_watch(folder, watch_path.c_str(), IN_MODIFY | IN_CREATE | IN_DELETE | IN_MOVE);
|
||||
if (watch < 0)
|
||||
{
|
||||
throw std::system_error(errno, std::system_category());
|
||||
@@ -644,6 +644,14 @@ namespace filewatch {
|
||||
{
|
||||
parsed_information.emplace_back(StringType{ changed_file }, Event::modified);
|
||||
}
|
||||
+ else if (event->mask & IN_MOVED_FROM)
|
||||
+ {
|
||||
+ parsed_information.emplace_back(T{ changed_file }, Event::renamed_old);
|
||||
+ }
|
||||
+ else if (event->mask & IN_MOVED_TO)
|
||||
+ {
|
||||
+ parsed_information.emplace_back(T{ changed_file }, Event::renamed_new);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
i += event_size + event->len;
|
@ -4,6 +4,8 @@ vcpkg_from_github(
|
||||
REF a59891baf375b73ff28144973a6fafd3fe40aa21
|
||||
SHA512 9a110b42a499ed7047bb8a79029134943582b388db810974ad6b5f91d1ec720e45a9a3543c4a56ee97d51439f5a34222bada0fb43281dcbc2e65bdee38f836d5
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-unix-listen.patch
|
||||
)
|
||||
|
||||
file(COPY "${SOURCE_PATH}/FileWatch.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include/thomasmonkman-filewatch")
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "thomasmonkman-filewatch",
|
||||
"version-date": "2023-01-16",
|
||||
"port-version": 1,
|
||||
"description": "File watcher in C++.",
|
||||
"homepage": "https://github.com/ThomasMonkman/filewatch",
|
||||
"license": "MIT"
|
||||
|
@ -8374,7 +8374,7 @@
|
||||
},
|
||||
"thomasmonkman-filewatch": {
|
||||
"baseline": "2023-01-16",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"thor": {
|
||||
"baseline": "2022-04-16",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "6dede6ba1ac505ea4bd64c60bf97edfe7b8d5647",
|
||||
"version-date": "2023-01-16",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "09215796e0a4591e54d9aa37ab46dc5edc7bd491",
|
||||
"version-date": "2023-01-16",
|
||||
|
Loading…
Reference in New Issue
Block a user