#!/bin/bash # find plugins by searching in some folder for feature jars, and searching through their feature.xml files for " echo "" echo "Example: $0 org.eclipse.tptp.platform.xerces xerces ." echo "Example: $0 org.apache.xml.serializer" echo "Example: $0 xerces" echo "Example: $0 platform.probekit" echo "Example: $0 probekit" exit 1 fi # if no location, look in current dir (.) if [[ $3 ]]; then location="$3"; else location="."; fi # if no featurePattern, search all features for pluginPattern if [[ ! $2 ]]; then featurePattern="*"; pluginPattern="$1"; else pluginPattern="$2"; featurePattern="$1"; fi rm -fr /tmp/findinfeature/; mkdir -p /tmp/findinfeature/features/ for f in $(find "$location" -type f -name "*${featurePattern}*" | egrep -v "pack.gz|source" | grep features | egrep "${featurePattern}"); do #echo "$f [$featurePattern, $pluginPattern]" unzip -q $f -d /tmp/findinfeature/ feature.xml if [[ ! $(cat /tmp/findinfeature/feature.xml | egrep "id=\".*${pluginPattern}.*\"" -A3 -B1 | grep plugin -A1) ]]; then rm -fr /tmp/findinfeature/feature.xml else mv /tmp/findinfeature/feature.xml /tmp/findinfeature/${f}_feature.xml echo "${f}" cat /tmp/findinfeature/${f}_feature.xml | egrep -v "