From 02f5fd77be59eb792d0693cb43e319b456455748 Mon Sep 17 00:00:00 2001 From: adfoster-r7 Date: Wed, 30 Oct 2024 18:27:07 +0000 Subject: [PATCH] Update build cache to run xargs in parallel --- tools/automation/cache/build_new_cache.sh | 2 +- tools/automation/cache/update_module_cache.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/automation/cache/build_new_cache.sh b/tools/automation/cache/build_new_cache.sh index a3786c157a..1da9287ff7 100755 --- a/tools/automation/cache/build_new_cache.sh +++ b/tools/automation/cache/build_new_cache.sh @@ -1,7 +1,7 @@ #!/bin/sh -ex bundle install rm db/modules_metadata_base.json -git ls-files modules/ -z | xargs -0 -n1 -I{} -- git log -1 --format="%ai {}" {} | while read -r udate utime utz ufile ; do +git ls-files modules/ -z | xargs -0 -n1 -P `nproc` -I{} -- git log -1 --format="%ai {}" {} | while read -r udate utime utz ufile ; do touch -d "$udate $utime" $ufile done ./msfconsole -qr tools/automation/cache/wait_for_cache.rc diff --git a/tools/automation/cache/update_module_cache.sh b/tools/automation/cache/update_module_cache.sh index eb1b27a7eb..5c56dbc152 100755 --- a/tools/automation/cache/update_module_cache.sh +++ b/tools/automation/cache/update_module_cache.sh @@ -17,4 +17,4 @@ IMG='metasploitframework/metasploit-framework:latest' docker run --rm=true --tty \ --volume=`pwd`:/r7-source \ --workdir=/r7-source ${IMG} \ - /bin/sh -c ./tools/automation/cache/build_new_cache.sh + /bin/sh -c 'time ./tools/automation/cache/build_new_cache.sh'