Skip to content

Commit

Permalink
JBIDE-21601 support input of a csv list of excluded IUs
Browse files Browse the repository at this point in the history
  • Loading branch information
nickboldt committed Jan 28, 2016
1 parent 7af54f6 commit 2c4543f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion util/installFromCentral.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ if [[ $# -lt 1 ]]; then
usage;
fi

# comma-separated list of IUs to exclude from installation
EXCLUDES=""

#director.xml script is used with Eclipse's AntRunner to launch p2.director
DIRECTORXML="http://download.jboss.org/jbosstools/updates/scripted-install/director.xml"

Expand All @@ -43,6 +46,7 @@ while [[ "$#" -gt 0 ]]; do
'-DIRECTORXML') DIRECTORXML="$2"; shift 1;;
'-CLEAN') CLEAN="$2"; shift 1;;
'-vm') VM="-vm $2"; shift 1;;
'-EXCLUDES') EXCLUDES="$2"; shift 1;;
esac
shift 1
done
Expand Down Expand Up @@ -164,6 +168,7 @@ if [[ $CENTRAL_URL != $INSTALL_PLAN ]]; then
</xsl:stylesheet>
XSLT

# for each Central Discover plugin
for PLUGINJAR in $PLUGINJARS; do
curl -k ${CENTRAL_URL}/${PLUGINJAR} > ${WORKSPACE}/plugin.jar
unzip -oq -d ${WORKSPACE} ${WORKSPACE}/plugin.jar plugin.xml
Expand All @@ -174,7 +179,17 @@ XSLT

# parse the list of features from plugin.transformed.xml
FEATURES=`cat ${WORKSPACE}/plugin.transformed.xml | grep "iu id" | sed "s#.\+id=\"\(.\+\)\"\ */>#\1#" | sort | uniq`
for f in $FEATURES; do CENTRAL_IUs="${CENTRAL_IUs},${f}.feature.group"; done
for f in $FEATURES; do
# only add the found features if they're NOT matched by the EXCLUDE rule
for e in ${EXCLUDES//,/ }; do
if [[ ${f} == ${e} ]] || [[ ${f}.feature.group == ${e} ]]; then
echo "Exclude installation of ${f}.feature.group [EXCLUDE = $EXCLUDES ]"
else
# echo "Add ${f}.feature.group ..."
CENTRAL_IUs="${CENTRAL_IUs},${f}.feature.group"
fi
done
done

# parse the list of 3rd party siteUrl values from plugin.transformed.xml; exclude jboss.discovery.site.url entries
EXTRA_URLS=`cat ${WORKSPACE}/plugin.transformed.xml | grep -i siteUrl | egrep -v "jboss.discovery.site.url|jboss.discovery.earlyaccess.site.url" | sed "s#.\+siteUrl=\"\(.\+\)\"\ *>#\1#" | sort | uniq`
Expand Down

0 comments on commit 2c4543f

Please sign in to comment.