diff options
author | David Williams | 2016-04-25 20:18:55 +0000 |
---|---|---|
committer | David Williams | 2016-04-25 20:18:55 +0000 |
commit | dfeaa967879a2132ab98dfc05bd8d8c0d6867d3b (patch) | |
tree | 24da7dd048c46749dd7fd4360977d5b4982491a6 /production/miscToolsAndNotes/misc/wgetFresh.sh | |
parent | 8c73859f8e2f17374df41fbad78b69709f6fabcc (diff) | |
download | eclipse.platform.releng.aggregator-dfeaa967879a2132ab98dfc05bd8d8c0d6867d3b.tar.gz eclipse.platform.releng.aggregator-dfeaa967879a2132ab98dfc05bd8d8c0d6867d3b.tar.xz eclipse.platform.releng.aggregator-dfeaa967879a2132ab98dfc05bd8d8c0d6867d3b.zip |
[releng] Misc cleanup and clarification
Diffstat (limited to 'production/miscToolsAndNotes/misc/wgetFresh.sh')
-rwxr-xr-x | production/miscToolsAndNotes/misc/wgetFresh.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/production/miscToolsAndNotes/misc/wgetFresh.sh b/production/miscToolsAndNotes/misc/wgetFresh.sh new file mode 100755 index 000000000..e29345bfc --- /dev/null +++ b/production/miscToolsAndNotes/misc/wgetFresh.sh @@ -0,0 +1,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 +# http://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} http://${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} http://${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} http://${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 http://${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 + |