Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: aa20bb84d7969c008eeabaa8af9b63de258d77f3 (plain) (blame)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash

# gets a fresh copy of utility scripts

# this localBuildProperties.shsource file is to ease local builds to override some variables.
# It should not be used for production builds.
source localBuildProperties.shsource 2>/dev/null

export GIT_HOST=${GIT_HOST:-"git.eclipse.org"}

# codifying the branch (or tag) to use, so it can be set/chagned in one place
initScriptTag="h=master"

# to use a tag instead of branch, would be tag=X, such as
# tag=vI20120417-0700, or in full form
# https://git.eclipse.org/c/platform/eclipse.platform.releng.eclipsebuilder.git/plain/scripts/wgetFresh.sh?tag=vI20120417-0700

source checkForErrorExit.sh

gitfile=makeBranch.sh
wget --no-verbose -O ${gitfile} https://${GIT_HOST}/c/platform/eclipse.platform.releng.eclipsebuilder.git/plain/scripts/sdk/${gitfile}?$initScriptTag 2>&1;
checkForErrorExit $? "could not wget file: ${gitfile}"
gitfile=renameBuild.sh
wget --no-verbose -O ${gitfile} https://${GIT_HOST}/c/platform/eclipse.platform.releng.eclipsebuilder.git/plain/scripts/sdk/${gitfile}?$initScriptTag 2>&1;
checkForErrorExit $? "could not wget file: ${gitfile}"
gitfile=checkForErrorExit.sh
wget --no-verbose -O ${gitfile} https://${GIT_HOST}/c/platform/eclipse.platform.releng.eclipsebuilder.git/plain/scripts/sdk/${gitfile}?$initScriptTag 2>&1;
checkForErrorExit $? "could not wget file: ${gitfile}"

# get this script itself (would have to run twice to make use changes, naturally)
# and has trouble "writing over itself" so we put in a file with 'NEW' suffix
# but will remove it if no differences found.
# and a command line like the following works well

wget --no-verbose -O wgetFresh.NEW.sh https://${GIT_HOST}/c/platform/eclipse.platform.releng.eclipsebuilder.git/plain/scripts/sdk/wgetFresh.sh?$initScriptTag 2>&1;

differs=`diff wgetFresh.NEW.sh wgetFresh.sh`

if [ -z "${differs}" ]
then
  # 'new' not different from existing, so remove 'new' one
  rm wgetFresh.NEW.sh
else
  echo " "
  echo "     wgetFresh.sh has changed. Compare with and consider replacing with wgetFresh.NEW.sh"
  echo "  "
  echo "differences: ${differs}"
  echo "  "
fi

chmod ug+x *.sh
chmod o-rwx *.sh

Back to the top