Fix taglist script to include subprojects 05/4105/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 8 Jun 2016 21:22:33 +0000 (17:22 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 3 Feb 2017 17:04:39 +0000 (12:04 -0500)
For example integration/distribution was not being processed in the
tag script.

Change-Id: I9c989936f4421562245a61e57cfafcd5eb297f9b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
patch-odl-release.sh

index f111566..7edf9cb 100755 (executable)
@@ -39,7 +39,13 @@ scriptdir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
 # built the release. Basically ensuring that no new patches snuck into the
 # project during code freeze.
 CURRENT_HASH=`git rev-parse HEAD`
-EXPECTED_HASH=`grep "$project[[:space:]]" $PATCH_DIR/taglist.log | awk '{ print $2 }'`
+EXPECTED_HASH=`grep "^${project} " $PATCH_DIR/taglist.log | awk '{ print $2 }'`
+if [ "$EXPECTED_HASH" == "" ]; then
+    parent_dir="$(dirname `pwd`)"
+    project="${parent_dir##*/}/$project"
+    EXPECTED_HASH=`grep "^${project} " $PATCH_DIR/taglist.log | awk '{ print $2 }'`
+fi
+
 echo "Current Hash: $CURRENT_HASH"
 echo "Expected Hash: $EXPECTED_HASH"
 if [ "$CURRENT_HASH" != "$EXPECTED_HASH" ]
@@ -51,12 +57,10 @@ fi
 #######################
 # Start apply patches #
 #######################
-
-git apply ${PATCH_DIR}/${project}.patch
+git apply ${PATCH_DIR}/${project/\//-}.patch
 git commit -asm "Release $RELEASE_TAG"
 git tag -asm "OpenDaylight $RELEASE_TAG release" release/${RELEASE_TAG,,}
 find . -name pom.xml | xargs grep SNAPSHOT
 $scriptdir/version.sh bump $RELEASE_TAG
 git commit -asm "Bumping versions by 0.0.1 for next dev cycle"
 find . -name pom.xml | xargs grep $RELEASE_TAG
-