mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-24 16:05:36 +08:00
Provisioning: Allow retry when disabling spotlight indexing
Task-number: QTQAINFRA-5996 Change-Id: I05ef6d33d74448ee830d137b137c6ee73f6e0518 Reviewed-by: Ville-Pekka Karhu <ville-pekka.karhu@qt.io>
This commit is contained in:
@@ -2,14 +2,17 @@
|
||||
# Copyright (C) 2017 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
# Allow retry in case mdutil fails with first tries
|
||||
set +e
|
||||
|
||||
disableSpotlight() {
|
||||
# Disable spotlight and and stop indexing
|
||||
sudo mdutil -a -i off
|
||||
sudo mdutil -a -i off /
|
||||
sudo mdutil -a -i off || return 1
|
||||
sudo mdutil -a -i off / || return 1
|
||||
# Disable spotlight indexing /Volumes
|
||||
sudo mdutil -i off /Volumes
|
||||
sudo mdutil -i off /Volumes || return 1
|
||||
# Erase spotlight index
|
||||
sudo mdutil -E /
|
||||
sudo mdutil -E / || return 1
|
||||
}
|
||||
|
||||
# Disabling spotlight tends to be flaky, add some retry
|
||||
|
||||
Reference in New Issue
Block a user