Skip to content
Snippets Groups Projects
Commit 7d692f4e authored by david_williams's avatar david_williams
Browse files

misc utility scripts

parent c2bbb9f7
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Simple script to count number of mirrors available for a particular URL
# Copyright (c) 2009 IBM
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# David Williams - initial API and implementation
function usage() {
printf "\n\tSimple script to count number of mirrors available for a particular URL" >&2
printf "\n\tUsage: %s [-h] | [-v] [-f] [-p] urls" $(basename $0) >&2
printf "\n\t\t%s" "where h==help, v==verbose, f==only ftp mirrors, p==only http mirrors " >&2
printf "\n\t\t%s" "and urls is space delimited list of URL parameters," >&2
printf "\n\t\t%s\n" "such as /ganymede/releases/site.xml" >&2
}
function checkMirrorsForURL() {
if [ -z $1 ]
then
echo "Error: internal funtion requires mirror url parameter";
exit 3;
else
mirrorURL=$1
fi
if [ -z $2 ]
then
protocol=
pword="http and ftp"
else
protocolarg="&protocol=$2"
pword="$2"
fi
nMirrors=$(wget -q -O - "http://www.eclipse.org/downloads/download.php?file=${mirrorURL}&format=xml${protocolarg}" | grep \<mirror\ | wc -l)
echo " number of" ${pword} "mirrors: " ${nMirrors} " for" ${mirrorURL}
}
urls=
ftponly=0
httponly=0
protocol=
while getopts 'hvfp' OPTION
do
case $OPTION in
h) usage
exit 1
;;
f) ftponly=1
;;
p) httponly=1
;;
v) verbose=1
;;
?) usage
exit 2
;;
esac
done
shift $(($OPTIND - 1))
urls=$*
if [ $ftponly == 1 ]
then
protocol="ftp"
fi
if [ $httponly == 1 ]
then
protocol="http"
fi
if [ $ftponly == 1 -a $httponly == 1 ]
then
protocol=
fi
if [ $verbose ]
then
echo "ftponly: " $ftponly " httponly: " $httponly
echo "protocol: " $protocol
echo "urls: " $urls
fi
if [ "${urls}" ]
then
echo
for mirrorURL in $urls
do
checkMirrorsForURL $mirrorURL $protocol
done
echo
else
usage
fi
#!/bin/sh
# If "local" users have this file on their path,
# that is, in "someDirectory" on the users local path,
# then the bash "include source" function will find that version
# first, instead of this "standard" eclipse production one.
# That is assuming users don't have "." on their path, which
# they shouldn't. Many systems assumes ${HOME}/bin is on the
# users path.
# This file is intentionally named "shsource" to denote this is intended to
# be included in other sh files, with "source" command, not
# executed on its own.
# Some things _have_ to go in this file, instead of being an ant property,
# since they may be used outside the contect of ant (or, before ant get's started).
# as one example, anything used directly in the cc_config.xml file has to be
# provided as environment variable, since it can not import ant property files
# like most ant project files can.
# the top directory of build-related directories
export BUILD_HOME=/shared/webtools
# the following does not commonly vary, but must be specified "early"
# so is specified in this file
export RELENG_CONTROL=${BUILD_HOME}/releng.control
# this variable must batch the screen number that Xvfb is using
export DISPLAY=127.0.0.1:1.0
# these should be full, abosolute path to the respective home directories
# on this particular build machine
export ANT_HOME=/shared/webtools/apps/apache-ant-1.7.0
export JAVA_4_HOME=/shared/webtools/apps/IBMJava2-SDK-1.4.2-10.0.ppc
export JAVA_5_HOME=/shared/webtools/apps/ibm-java2-sdk-5.0-6.0-linux-ppc
export CCDIR=/shared/webtools/apps/cruisecontrol-bin-2.7.2
export BASEOS=linux
export BASEWS=gtk
export BASEARCH=ppc
# no local build properties, for production builds
# for local builds, this should be set to a real directory,
# so meaningful properties can be set for that local machine.
# See the 'localBuildExample' directory for a starting example
export LOCAL_BUILD_PROPERTIES_DIR=
# note: buildmaster email address should be "real" address
# that is subscribed to the mailing list, if you want to send
# mail to mailing lists.
export BUILD_BUILDMASTER_EMAIL=david.williams@eclipse.org
export BUILD_BUILDMASTER_RETURN_NAME=wtpBuilder
# use following for CC 2.7.1
#export BUILD_RESULT_URL=http://build.eclipse.org:7777/dashboard/build/detail
# use following for CC 2.7.2
export BUILD_RESULT_URL=http://build.eclipse.org:7777/dashboard/tab/build/detail
export BUILD_ALWAYS_TO_ADDRESS=david_williams@us.ibm.com
export FAILED_ADDRESS=wtp-releng@eclipse.org
export BUILD_SUBJECT_PREFIX=WTPBUILD:
# note: this file, notifyMapper.properties is not normally in cvs,
# to avoid "publishing" email addresses; but is maintained directly on
# the build server.
export EMAIL_PROPERTIES=${BUILD_HOME}/notification/notifyMapper.properties
# controls quietness of logging to console
# false means more output to console, true uses ant's logger
export USE_LOGGER=true
#contols ANT's quietness level
# true logs error and warnings only
export USE_QUIET=true
# controls ANT's debug level
# setting to true will result in TONS of ouput
export USE_DEBUG=false
# should be true for production, false for local.
# it can be set to true for local builds, but then the
# properties in upload.properties need to be set to valid values.
export BUILD_UPLOAD=true
# if true, locally existing maps will be used as is, instead of being
# checked out afresh. Set to false for production builds, so maps are
# always fresh.
export USE_LOCAL_MAPS=false
# normally, cvs logging output can be "really quiet", but if problems, then it can be turned back on
# to get more potentially diagnostic information
# TODO: if both of these are 'true' and error is generated by cvs ...
# saying you can't set both to true.
# we could put in some logic to prevent that, someday.
export CVS_QUIET=true
export CVS_REALLY_QUIET=true
# these cvs values need to have write access if
# tag.maps is true, as on production machine.
# This is the ID used to both read, and
# to tag releng map files.
#
# Note:
# 'ext' protocol typically requires
# environment variable CVS_RSH to be set to ssh
# So, we just always do it. Can't imagine it'd hurt
# if protocol was pserver, but could be removed in that
# case, if desired.
export CVS_RSH=ssh
export BUILD_CVS_READ_PROTOCOL=pserver
export BUILD_CVS_READ_USER=anonymous
export BUILD_CVS_WRITE_PROTOCOL=ext
export BUILD_CVS_WRITE_USER=david_williams
export BUILD_CVS_SERVER=dev.eclipse.org
export BUILD_CVS_ROOT=/cvsroot/webtools
# for builds on local machines, SKIPUSERS should be 'true' to avoid
# notifying users about those builds on your local machine
export SKIPUSERS=false
export DOWNLOAD_ROOT=/home/data/httpd/download.eclipse.org
# Here this variable, SKIP_JAR_SIGNING, should be false for
# production builds. But, the variable is set elsewhere to true,
# such as in cc_config, for the R2 builds.
# There is another variable, 'sign' in each components build.properties
# to allow components to be the final say to allow signing.
# This variable, SKIP_JAR_SIGNING, should always be true for
# "local" builds.
export SKIP_JAR_SIGNING=false
# this is used especially during signing, where we need to execute
# the signing script from a signer ID, while running as wtpBuild.
# should be blank or omitted in local builds
export REMOTE_SSH_COMMAND="ssh david_williams@build.eclipse.org "
#cd /shared/orbit
screen -D -RR
eclipseLocation=$HOME/eclipse-ppc-33RC4
jvmLocation=$HOME/ibm-java2-ppc-50
xslSite=/home/data/httpd/download.eclipse.org/webtools/downloads/drops/R0.5/R-0.5-20080820002020/updateSite
wtpSite=/opt/public/webtools/committers/wtp-R3.0-M/20080918035538/M-3.0.2-20080918035538
cp -r "${xslSite}" "${wtpSite}"
# echo
# echo $(basename $1
jarname=$(basename $1)
# purposely no line delimiter, so output of jarsigner is on same line
printf '%-100s \t\t' " ${jarname}: "
/shared/webtools/apps/ibm-java2-sdk-5.0-6.0-linux-ppc/bin/jarsigner -verify $1
exitcode=$?
if [ $exitcode -gt 0 ]
then
echo "\nexitcode: $exitcode: $(basename $1)"
fi
if [ -z $1 ]
then
loc=./
else
loc=${1}
fi
if [ -z $2 ]
then
pat="*.jar"
else
pat="${2}"
fi
echo "verify directory: ${loc}";
echo " for pattern: ${pat}";
find "${loc}" -name "${pat}" -exec verify.sh '{}' \;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment