Skip to content

Commit

Permalink
JBIDE-22611 JBIDE-22633 add dupe IU reporting when running verifyTarg…
Browse files Browse the repository at this point in the history
…et.sh - if dupe features, throw error; if dupe plugins, throw warning
  • Loading branch information
nickboldt committed Jun 28, 2016
1 parent c08aa44 commit cbb7724
Showing 1 changed file with 42 additions and 9 deletions.
51 changes: 42 additions & 9 deletions util/verifyTarget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# OPTIONAL if you want to perform an install test, rather than just ensure that your TP can be validated and resolved locally
# set path to where you have the latest compatible Eclipse bundle stored locally
# -z /path/to/eclipse-jee-neon-M2-linux-gtk-x86_64.tar.gz
# -z /path/to/eclipse-jee-neon-R-linux-gtk-x86_64.tar.gz

# OPTIONAL if you're testing a TP that's downstream from the jbosstoolstarget or jbdevstudiotarget, eg., Central, Early Access, or Integration Stack
# set URL(s) for JBT / JBT Target so that all Central deps can be resolved; for more than one, separate w/ commas
Expand All @@ -32,31 +32,31 @@ usage ()
echo ""
echo "Example (JBT/JBDS - include sources): $0 \\"
echo " -b /path/to/jbosstools-target-platforms -p jbosstools,jbdevstudio \\"
echo " -z /path/to/eclipse-jee-neon-M2-linux-gtk-x86_64.tar.gz -d /path/to/executable/p2diff"
echo " -z /path/to/eclipse-jee-neon-R-linux-gtk-x86_64.tar.gz -d /path/to/executable/p2diff"
echo ""
echo "Example (JBoss Central - eXclude sources): $0 \\"
echo " -b /path/to/jbosstools-discovery -p jbtcentral -x \\"
echo " -z /path/to/eclipse-jee-neon-M2-linux-gtk-x86_64.tar.gz -d /path/to/executable/p2diff \\"
echo " -u http://download.jboss.org/jbosstools/targetplatforms/jbosstoolstarget/4.60.0.Final-SNAPSHOT/,\\
echo " -z /path/to/eclipse-jee-neon-R-linux-gtk-x86_64.tar.gz -d /path/to/executable/p2diff \\"
echo " -u http://download.jboss.org/jbosstools/targetplatforms/jbosstoolstarget/4.60.0.Final/,\\
http://download.jboss.org/jbosstools/neon/snapshots/updates/core/master/"
echo " or, use locally built sites"
echo " -u file:///path/to/jbosstools-target-platforms/jbosstools/multiple/target/jbosstools-multiple.target.repo/,\\
file:///path/to/jbosstools-build-sites/aggregate/site/target/"
echo ""
echo "Example (JBoss Central Early Access - eXclude sources): $0 \\"
echo " -b /path/to/jbosstools-discovery -p jbtearlyaccess -x \\"
echo " -z /path/to/eclipse-jee-neon-M2-linux-gtk-x86_64.tar.gz -d /path/to/executable/p2diff \\"
echo " -u http://download.jboss.org/jbosstools/targetplatforms/jbosstoolstarget/4.60.0.Final-SNAPSHOT/,\\
echo " -z /path/to/eclipse-jee-neon-R-linux-gtk-x86_64.tar.gz -d /path/to/executable/p2diff \\"
echo " -u http://download.jboss.org/jbosstools/targetplatforms/jbosstoolstarget/4.60.0.Final/,\\
http://download.jboss.org/jbosstools/neon/snapshots/updates/core/master/,\\
http://download.jboss.org/jbosstools/targetplatforms/jbtcentraltarget/4.60.0.Final-SNAPSHOT/"
http://download.jboss.org/jbosstools/targetplatforms/jbtcentraltarget/4.60.0.Final/"
echo " or, use locally built sites"
echo " -u file:///path/to/jbosstools-target-platforms/jbosstools/multiple/target/jbosstools-multiple.target.repo/,\\
file:///path/to/jbosstools-build-sites/aggregate/site/target/,\\
file:///path/to/jbosstools-discovery/jbtcentraltarget/multiple/target/jbtcentral-multiple.target.repo/"
echo ""
echo "Example (JBoss Tools Integration Stack - include sources): $0 \\"
echo " -b /path/to/jbosstools-integration-stack/target-platform -p target-platform \\"
echo " -z /path/to/eclipse-jee-neon-M2-linux-gtk-x86_64.tar.gz -d /path/to/executable/p2diff"
echo " -z /path/to/eclipse-jee-neon-R-linux-gtk-x86_64.tar.gz -d /path/to/executable/p2diff"
echo ""
exit 1;
}
Expand All @@ -74,7 +74,7 @@ LOG_GREP_INCLUDES="BUILD FAILURE|Only one of the following|Missing requirement|U
LOG_GREP_INCLUDES2="TargetDefinitionResolutionException|Could not find"
LOG_GREP_EXCLUDES="Failed to execute goal org.jboss.tools.tycho-plugins:target-platform-utils|Checksum validation failed, no checksums available from the repository"
#BASEDIR=`pwd`
#ECLIPSEZIP=${HOME}/tmp/Eclipse_Bundles/eclipse-jee-neon-M2-linux-gtk-x86_64.tar.gz
#ECLIPSEZIP=${HOME}/tmp/Eclipse_Bundles/eclipse-jee-neon-R-linux-gtk-x86_64.tar.gz
#UPSTREAM_SITES=file://$HOME/tru/jbosstools-target-platforms/jbosstools/multiple/target/jbosstools-multiple.target.repo/,http://download.jboss.org/jbosstools/updates/nightly/core/master/
# for JBDS tests, use UPSTREAM_SITES=file://$HOME/tru/jbosstools-target-platforms/jbdevstudio/multiple/target/jbdevstudio-multiple.target.repo/,http://www.qa.jboss.com/binaries/RHDS/builds/staging/devstudio.product_master/all/repo/
#P2DIFF=${HOME}/tmp/p2diff/p2diff
Expand Down Expand Up @@ -195,6 +195,39 @@ for PROJECT in $PROJECTS; do echo "Process $PROJECT ..."

popd

# check for duplicate IUs in the TP
echo ""
for pf in plugins features; do
if [[ -d ${WORKDIR}/target/${REPODIR}/${pf} ]]; then
allIUs=$(cd ${WORKDIR}/target/${REPODIR}/${pf};ls *.jar|sort)
rm -f /tmp/resolve_log_dupeIUs_${PROJECT}_${NOW}.txt /tmp/resolve_log_allIUs_${PROJECT}_${NOW}.txt
for iu in $allIUs; do
echo ${iu%_*.jar} >> /tmp/resolve_log_allIUs_${PROJECT}_${NOW}.txt
done
cat /tmp/resolve_log_allIUs_${PROJECT}_${NOW}.txt | uniq -d | sort > /tmp/resolve_log_dupeIUs_${PROJECT}_${NOW}.txt
numFound=$(cat /tmp/resolve_log_dupeIUs_${PROJECT}_${NOW}.txt | wc -l)
if [[ $numFound != 0 ]]; then
# dupe features = error; dupe plugins = warning
if [[ $pf == "features" ]]; then prefix="[ERROR] "; else prefix="[WARNING] "; fi
echo "$prefix Found ${numFound} duplicate ${PROJECT} ${pf}:"
c=0
for i in $(cat /tmp/resolve_log_dupeIUs_${PROJECT}_${NOW}.txt); do
(( c++ ));
pushd ${WORKDIR} >/dev/null
find target/${REPODIR}/${pf} -name "${i}_*.jar" | sed "s#target/#${prefix} [${c}] #" | tee -a /tmp/resolve_log_dupeIUs_${PROJECT}_${NOW}.txt
popd >/dev/null
echo ""
done
# dupe features = error; dupe plugins = warning
if [[ $pf == "features" ]]; then exit 1; fi
else
rm -f /tmp/resolve_log_dupeIUs_${PROJECT}_${NOW}.txt /tmp/resolve_log_allIUs_${PROJECT}_${NOW}.txt
fi
else
echo "[WARNING] No directory ${WORKDIR}/target/${REPODIR}/${pf} - cannot check for duplicate IUs!"
fi
done

if [[ -f ${ECLIPSEZIP} ]]; then
echo ""
echo "Step 3: Install the new target platform into a clean Eclipse JEE bundle"
Expand Down

0 comments on commit cbb7724

Please sign in to comment.