File: set_automatic_updates.sh

package info (click to toggle)
eclipse-tracecompass 6.2.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 77,440 kB
  • sloc: java: 316,465; xml: 99,829; perl: 400; sh: 353; makefile: 43; javascript: 29; python: 18
file content (37 lines) | stat: -rwxr-xr-x 1,425 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
###############################################################################
# Copyright (c) 2016 Ericsson
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
###############################################################################

# A simple script that sets the rcp to automatically update at startup by
# default. This sets the preference through plugin_customization.ini
# See https://bugs.eclipse.org/bugs/show_bug.cgi?id=499247

PATH_TO_PREFERENCE_FILE="../../rcp/org.eclipse.tracecompass.rcp.branding/plugin_customization.ini"

OUTPUT=$(cat $PATH_TO_PREFERENCE_FILE  | grep org.eclipse.equinox.p2.ui.sdk.scheduler | grep enabled)
if [[ -z "$OUTPUT" ]];
then
	echo "Setting Automatic update"
	echo "
# check for updates every time Trace Compass starts. This should only be done in stable releases.
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=499247
org.eclipse.equinox.p2.ui.sdk.scheduler/enabled=true" >> $PATH_TO_PREFERENCE_FILE
	CHECK_OUTPUT=$(cat $PATH_TO_PREFERENCE_FILE | grep org.eclipse.equinox.p2.ui.sdk.scheduler | grep enabled)
	if [[ -z "$CHECK_OUTPUT" ]];
	then
		echo "Failed!"
	else
		echo "Success!"
	fi
else
	echo "Automatic update already set?"
fi