Skip to content

Commit

Permalink
add new checkFeatureLicenses.sh script for verifying migration to lic…
Browse files Browse the repository at this point in the history
…ense feature (JBIDE-20194)
  • Loading branch information
nickboldt committed Aug 21, 2015
1 parent 86bd5f9 commit 1004f64
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions util/checkFeatureLicenses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

excludepattern="\.git|/target|target/|foundation.license.feature|org.jboss.tools.xulrunner.feature"

# count features
numfeatures=$(find . -name feature.xml | egrep -v "${excludepattern}" | wc -l)
numfiles=$(find . -name feature.\* | egrep -v "${excludepattern}" | wc -l)
echo "Number of features: ${numfeatures} (files: ${numfiles})"

GRN="\033[1;32m"
RED="\033[1;31m"
BLU="\033[1;34m"
NRM="\033[0;39m"

check ()
{
pattern="$1"
files="$2"
expected="$3"

echo -n "${pattern}: "
col=$GRN
check="$(find.sh . "${files}" "${pattern}" "${excludepattern}" "" -q)"
cnt=0; for d in $check; do if [[ $d != "st" ]]; then (( cnt++ )); fi; done
if [[ $expected != $cnt ]]; then
listFiles=1
if [[ $4 ]]; then col="$4"; else col=$RED; fi
fi
echo -e "${col}${cnt}${NRM} of $expected"
}

check "providerName|featureProvider" "feature.*" $numfiles
check "licenseURL" "feature.*" $numfiles
check "license-feature" "feature.xml" $numfeatures
check "license=" "feature.properties" 0
check "updateSite" "feature.*" 0 $BLU

if [[ $listFiles ]]; then find.sh . "feature.*" "=" "" "" -q; fi

0 comments on commit 1004f64

Please sign in to comment.