fgerlits commented on a change in pull request #973:
URL: https://github.com/apache/nifi-minifi-cpp/pull/973#discussion_r559595576



##########
File path: cmake/BundledOSSPUUID.cmake
##########
@@ -21,8 +21,11 @@ function(use_bundled_osspuuid SOURCE_DIR BINARY_DIR)
     message("Using bundled ossp-uuid")
 
     # Define patch step
-    set(PC "${Patch_EXECUTABLE}" -p1 -i 
"${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
-           "${Patch_EXECUTABLE}" -p1 -i 
"${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")
+    set(PC "${Patch_EXECUTABLE}" -p1 -N -i 
"${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+            "${Patch_EXECUTABLE}" -p1 -N -i 
"${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch" ||
+            # if already applied, reverse application should succeed
+            "${Patch_EXECUTABLE}" -p1 -R --dry-run -i 
"${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch" &&
+            "${Patch_EXECUTABLE}" -p1 -R --dry-run -i 
"${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")

Review comment:
       It would be nicer to have a `( ... )` around the `--dry-run` commands.  
Otherwise, if the first two patch commands succeed, we skip the third command, 
but execute the fourth.  This is not a big problem, as the fourth command 
should succeed, but it isn't nice.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to