mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 08:48:57 +00:00
Meta: Only update hosts file when necessary in WPT.sh
Previously, the hosts file was updated at the same time the WPT repo was cloned, but updating the hosts file is only necessary for commands that start the WPT test runner.
This commit is contained in:
parent
e442aa6e10
commit
21082f5002
Notes:
github-actions[bot]
2025-09-07 12:15:37 +00:00
Author: https://github.com/tcl3
Commit: 21082f5002
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6110
1 changed files with 11 additions and 5 deletions
16
Meta/WPT.sh
16
Meta/WPT.sh
|
@ -240,11 +240,6 @@ ensure_wpt_repository() {
|
|||
if [ ! -d .git ]; then
|
||||
git clone --depth 1 "${WPT_REPOSITORY_URL}" "${WPT_SOURCE_DIR}"
|
||||
fi
|
||||
|
||||
# Update hosts file if needed
|
||||
if [ "$(comm -13 <(sort -u /etc/hosts) <(./wpt make-hosts-file | sort -u) | wc -l)" -gt 0 ]; then
|
||||
./wpt make-hosts-file | sudo_and_ask "Appending wpt hosts to /etc/hosts" tee -a /etc/hosts
|
||||
fi
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
|
@ -533,6 +528,14 @@ absolutize_log_args() {
|
|||
done
|
||||
}
|
||||
|
||||
update_hosts_file_if_needed() {
|
||||
pushd "${WPT_SOURCE_DIR}" > /dev/null
|
||||
if [ "$(comm -13 <(sort -u /etc/hosts) <(./wpt make-hosts-file | sort -u) | wc -l)" -gt 0 ]; then
|
||||
./wpt make-hosts-file | sudo_and_ask "Appending wpt hosts to /etc/hosts" tee -a /etc/hosts
|
||||
fi
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
execute_wpt() {
|
||||
local procs
|
||||
|
||||
|
@ -557,12 +560,14 @@ execute_wpt() {
|
|||
run_wpt() {
|
||||
ensure_wpt_repository
|
||||
build_ladybird_and_webdriver
|
||||
update_hosts_file_if_needed
|
||||
execute_wpt "${@}"
|
||||
}
|
||||
|
||||
serve_wpt()
|
||||
{
|
||||
ensure_wpt_repository
|
||||
update_hosts_file_if_needed
|
||||
|
||||
pushd "${WPT_SOURCE_DIR}" > /dev/null
|
||||
./wpt serve
|
||||
|
@ -735,6 +740,7 @@ compare_wpt() {
|
|||
popd > /dev/null
|
||||
WPT_ARGS+=( "--metadata=${METADATA_DIR}" )
|
||||
build_ladybird_and_webdriver
|
||||
update_hosts_file_if_needed
|
||||
execute_wpt "${@}"
|
||||
rm -rf "${METADATA_DIR}"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue