Author: nickboldt
Date: 2011-03-24 19:56:32 -0400 (Thu, 24 Mar 2011)
New Revision: 29998
Modified:
trunk/build/util/checkPOMvsManifest.sh
Log:
add debug and verbose modes; fix line ending false positives
Modified: trunk/build/util/checkPOMvsManifest.sh
===================================================================
--- trunk/build/util/checkPOMvsManifest.sh 2011-03-24 23:48:04 UTC (rev 29997)
+++ trunk/build/util/checkPOMvsManifest.sh 2011-03-24 23:56:32 UTC (rev 29998)
@@ -1,11 +1,17 @@
#!/bin/bash
+verbose=false
+debug=false
+
if [[ $1 ]] && [[ -d $1 ]]; then
basedir=$1
else
basedir=.
fi
+if [[ $2 == "-v" ]]; then verbose=true; fi
+if [[ $2 == "-d" ]]; then debug=true; fi
+
files=$(find . -maxdepth 5 -type f -name MANIFEST.MF | egrep -v
"target|sdk")" "$(find . -maxdepth 4 -type f -name
"feature.xml" | egrep -v "target|sdk")
for f in $files; do
d=${f/META-INF\/MANIFEST.MF/}; #assume plugin
@@ -23,20 +29,22 @@
fi
artVersionLine=" "$altVersionLine
else
- artVersionLine=$(cat $f | egrep "Bundle-Version: " | egrep
"[0-9]\.[0-9]\.[0-9]")
+ artVersionLine=$(cat $f | egrep "Bundle-Version: " | egrep
"[0-9]\.[0-9]\.[0-9]" | tr "\r\t\n" "\n" )
artVersion=${artVersionLine##*: }
artVersion=${artVersion%%.qualifier}
artVersionLine=" "$artVersionLine
fi
if [[ -f $d/pom.xml ]]; then
- pomVersionLine=$(cat $d/pom.xml | sed "s/\t//" | egrep
".0-SNAPSHOT" | egrep "[0-9]\.[0-9]\.[0-9]")
+ pomVersionLine=$(cat $d/pom.xml | sed "s/\t//" | egrep
"\.[0-9]-SNAPSHOT" | egrep "[0-9]\.[0-9]\.[0-9]" | tail -1)
if [[ ! $pomVersionLine ]]; then # not a snapshot version
+ #echo "pomVersionLine[1] = $pomVersionLine"
pomVersionLine=$(cat $d/pom.xml | sed "s/\t//" | egrep
"<version>" | egrep "[0-9]\.[0-9]\.[0-9]" | tail -1)
pomVersion=${pomVersionLine%%</version>*}
pomVersion=${pomVersion#*<version>}
#echo "[WARNING] [$pomVersion] ${d}pom.xml not SNAPSHOT version."
else
+ #echo "pomVersionLine[2] = $pomVersionLine"
pomVersion=${pomVersionLine%%-SNAPSHOT*}
pomVersion=${pomVersion#*<version>}
fi
@@ -48,8 +56,15 @@
echo "[ERROR] $artVersionLine"
echo "[ERROR] $pomVersionLine"
echo ""
+ elif [[ $debug == true ]]; then
+ echo "[DEBUG] $d"
+ echo "[DEBUG] Artifact version [$artVersion] != pom version [$pomVersion]" |
egrep "[0-9]\.[0-9]\.[0-9]";
+ echo "[DEBUG] $artVersionLine"
+ echo "[DEBUG] $pomVersionLine"
+ echo ""
+ elif [[ $verbose == true ]]; then
+ echo "[INFO] [$artVersion] = [$pomVersion] $d "
else
- #echo "[INFO] [$artVersion] = [$pomVersion] $d "
true
fi
else
Show replies by date