Skip to content

Commit

Permalink
Update build cache to run xargs in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Oct 31, 2024
1 parent 7b745b2 commit 02f5fd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/automation/cache/build_new_cache.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/automation/cache/update_module_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 02f5fd7

Please sign in to comment.