From 9feec8e48075bfb06968cf3b08a5dc32cf251e92 Mon Sep 17 00:00:00 2001 From: Pablo Rodriguez Avila Date: Tue, 21 Nov 2023 14:36:59 +0000 Subject: [PATCH 1/6] Add patch --- ports/thomasmonkman-filewatch/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/thomasmonkman-filewatch/portfile.cmake b/ports/thomasmonkman-filewatch/portfile.cmake index e64a4c24c0000f..4b045ba41416ed 100644 --- a/ports/thomasmonkman-filewatch/portfile.cmake +++ b/ports/thomasmonkman-filewatch/portfile.cmake @@ -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") From f472715edbc0d89f52c9ed608ade9a06100792b0 Mon Sep 17 00:00:00 2001 From: Pablo Rodriguez Avila Date: Tue, 21 Nov 2023 14:39:57 +0000 Subject: [PATCH 2/6] Add patch --- .../fix-unix-listen.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ports/thomasmonkman-filewatch/fix-unix-listen.patch diff --git a/ports/thomasmonkman-filewatch/fix-unix-listen.patch b/ports/thomasmonkman-filewatch/fix-unix-listen.patch new file mode 100644 index 00000000000000..0e526dd9528da5 --- /dev/null +++ b/ports/thomasmonkman-filewatch/fix-unix-listen.patch @@ -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; From 5188d238c036d7c08d9264e3fb9f3e4e0b914e10 Mon Sep 17 00:00:00 2001 From: Pablo Rodriguez Avila Date: Tue, 21 Nov 2023 14:44:34 +0000 Subject: [PATCH 3/6] Update version --- versions/t-/thomasmonkman-filewatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/t-/thomasmonkman-filewatch.json b/versions/t-/thomasmonkman-filewatch.json index 5e210f5a94c3a2..c0e9d235f1d3a3 100644 --- a/versions/t-/thomasmonkman-filewatch.json +++ b/versions/t-/thomasmonkman-filewatch.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "09215796e0a4591e54d9aa37ab46dc5edc7bd491", + "git-tree": "e4d9f0bb41f94c53faf7c7eb9f2566eaf8d0fb94", "version-date": "2023-01-16", "port-version": 0 } From c2b0491115e97e649567de4d3f0c92295ea39476 Mon Sep 17 00:00:00 2001 From: Pablo Rodriguez Avila Date: Tue, 21 Nov 2023 14:46:47 +0000 Subject: [PATCH 4/6] Add port-version 1 --- ports/thomasmonkman-filewatch/vcpkg.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/thomasmonkman-filewatch/vcpkg.json b/ports/thomasmonkman-filewatch/vcpkg.json index 8ce8e5bc7a95ea..50da66e19857f0 100644 --- a/ports/thomasmonkman-filewatch/vcpkg.json +++ b/ports/thomasmonkman-filewatch/vcpkg.json @@ -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" From 6e16751f7912d89379e71db18997e94c377b87d1 Mon Sep 17 00:00:00 2001 From: Pablo Rodriguez Avila Date: Tue, 21 Nov 2023 14:47:00 +0000 Subject: [PATCH 5/6] Add version --- versions/baseline.json | 2 +- versions/t-/thomasmonkman-filewatch.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 536a975686f4ae..94a919fcbbfca8 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8338,7 +8338,7 @@ }, "thomasmonkman-filewatch": { "baseline": "2023-01-16", - "port-version": 0 + "port-version": 1 }, "thor": { "baseline": "2022-04-16", diff --git a/versions/t-/thomasmonkman-filewatch.json b/versions/t-/thomasmonkman-filewatch.json index c0e9d235f1d3a3..c91098be71cd3b 100644 --- a/versions/t-/thomasmonkman-filewatch.json +++ b/versions/t-/thomasmonkman-filewatch.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6dede6ba1ac505ea4bd64c60bf97edfe7b8d5647", + "version-date": "2023-01-16", + "port-version": 1 + }, { "git-tree": "e4d9f0bb41f94c53faf7c7eb9f2566eaf8d0fb94", "version-date": "2023-01-16", From 3de4234ae9d90dd42698ca1309c0d5fc46c7a9d8 Mon Sep 17 00:00:00 2001 From: Pablo Rodriguez Avila Date: Wed, 22 Nov 2023 10:10:42 +0000 Subject: [PATCH 6/6] Restore git-tree --- versions/t-/thomasmonkman-filewatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/t-/thomasmonkman-filewatch.json b/versions/t-/thomasmonkman-filewatch.json index c91098be71cd3b..586cad78b79833 100644 --- a/versions/t-/thomasmonkman-filewatch.json +++ b/versions/t-/thomasmonkman-filewatch.json @@ -6,7 +6,7 @@ "port-version": 1 }, { - "git-tree": "e4d9f0bb41f94c53faf7c7eb9f2566eaf8d0fb94", + "git-tree": "09215796e0a4591e54d9aa37ab46dc5edc7bd491", "version-date": "2023-01-16", "port-version": 0 }