chiark / gitweb /
cvs-adjustroot: properly exit nonzero in case of error. Fixes the first half of ...
[chiark-utils.git] / scripts / cvs-adjustroot
index 0e128cc4a98548ad2a145f16fd6066bbb2579076..081859fcdb58b6ba60e97d55c65dfd3b054e8855 100755 (executable)
@@ -41,4 +41,12 @@ if $reinvoke; then
        exit 0
 fi
 
-find -path '*/CVS/Root' -exec cvs-adjustroot --reinvoke "$old" "$new" '{}' ';'
+# GNU find provides + exec variants which set exit status and pass
+# multiple arguments, or \; variants which pass one argument but do
+# not set exit status.  So use a separate -exec false + to arrange for
+# nonzero exit status when appropriate.
+
+find   -path '*/CVS/Root'                                              \
+  \(   -exec cvs-adjustroot --reinvoke "$old" "$new" '{}' ';'          \
+  -o   -exec false '{}' +                                              \
+  \)