mirror of
git://code.qt.io/qt/qt5.git
synced 2026-01-04 22:17:45 +08:00
Provisioning: Reset Time Zone for macOS 10.14
Setting Time Zone for macOS 10.14 seems to be flaky. Let's reset it. If it still fails to set it then exit the script execution. Task-number: QTBUG-92174 Change-Id: I07b28d0511d8fc097a1da43b78de9a5131f6bfa7 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> (cherry picked from commitba149a162b) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> (cherry picked from commitc84925c512)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
#############################################################################
|
||||
##
|
||||
## Copyright (C) 2019 The Qt Company Ltd.
|
||||
## Copyright (C) 2021 The Qt Company Ltd.
|
||||
## Contact: http://www.qt.io/licensing/
|
||||
##
|
||||
## This file is part of the provisioning scripts of the Qt Toolkit.
|
||||
@@ -97,4 +97,16 @@ echo "Set Network Test Server address to $NTS_IP in /etc/hosts"
|
||||
echo "$NTS_IP qt-test-server qt-test-server.qt-test-net" | sudo tee -a /etc/hosts
|
||||
|
||||
sudo systemsetup settimezone GMT
|
||||
# Setting Time Zone seems to be flaky in macOS 10.13 and in macOS 10.14. Checking that Time Zone is correct. If not, reset it.
|
||||
if [[ $(sudo systemsetup -gettimezone) = *GMT* ]]; then
|
||||
echo "Time Zone is GMT"
|
||||
else
|
||||
echo "Wrong Time Zone. Reset Time Zone to GMT"
|
||||
sleep 5
|
||||
sudo systemsetup settimezone GMT
|
||||
if [[ $(sudo systemsetup -gettimezone) != *GMT* ]]; then
|
||||
echo "Couldn't set Time Zone!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
sudo rm -f "$targetFile"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#############################################################################
|
||||
##
|
||||
## Copyright (C) 2019 The Qt Company Ltd.
|
||||
## Copyright (C) 2021 The Qt Company Ltd.
|
||||
## Contact: http://www.qt.io/licensing/
|
||||
##
|
||||
## This file is part of the provisioning scripts of the Qt Toolkit.
|
||||
@@ -97,5 +97,17 @@ echo "Set Network Test Server address to $NTS_IP in /etc/hosts"
|
||||
echo "$NTS_IP qt-test-server qt-test-server.qt-test-net" | sudo tee -a /etc/hosts
|
||||
|
||||
sudo systemsetup settimezone GMT
|
||||
# Setting Time Zone seems to be flaky in macOS 10.13 and in macOS 10.14. Checking that Time Zone is correct. If not, reset it.
|
||||
if [[ $(sudo systemsetup -gettimezone) = *GMT* ]]; then
|
||||
echo "Time Zone is GMT"
|
||||
else
|
||||
echo "Wrong Time Zone. Reset Time Zone to GMT"
|
||||
sleep 5
|
||||
sudo systemsetup settimezone GMT
|
||||
if [[ $(sudo systemsetup -gettimezone) != *GMT* ]]; then
|
||||
echo "Couldn't set Time Zone!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
sudo systemsetup setusingnetworktime off
|
||||
sudo rm -f "$targetFile"
|
||||
|
||||
Reference in New Issue
Block a user