Speed up resetting file/directory dates to zip epoch by 100x.
It is better to use the {} + as it passes the file list to touch instead of calling touch command once for each file. This will reduce the number of times touch process is created and massively speed up the script
From man page
-exec utility [argument ...] {} +
Same as -exec, except that ``{}'' is replaced with as many pathnames as possible for each invocation of utility. This behaviour is similar to that of
xargs(1).
--
MOS_MIGRATED_REVID=125821677
diff --git a/src/create_embedded_tools.sh b/src/create_embedded_tools.sh
index d6b11b8..f8ab4c8 100755
--- a/src/create_embedded_tools.sh
+++ b/src/create_embedded_tools.sh
@@ -75,5 +75,5 @@
for i in $(find "${PACKAGE_DIR}" -name BUILD.tools); do
mv "$i" "$(dirname "$i")/BUILD"
done
-find "${PACKAGE_DIR}" -exec touch -t 198001010000.00 '{}' ';'
+find "${PACKAGE_DIR}" -exec touch -t 198001010000.00 '{}' '+'
(cd "${PACKAGE_DIR}" && find . -type f | sort | zip -qDX@ "${OUTPUT}")