rhtyd commented on a change in pull request #2433: Fix and enhance package
script
URL: https://github.com/apache/cloudstack/pull/2433#discussion_r165447722
##########
File path: packaging/package.sh
##########
@@ -67,22 +79,38 @@ function packaging() {
exit 2
fi
fi
+
VERSION=$(cd ../; $MVN
org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate
-Dexpression=project.version | grep --color=none '^[0-9]\.')
+
+ if [ -n "$5" ]; then
+ DEFBRN="-D_brand -$5"
+ BRAND="${5}."
+ else
+ BASEVER=$(echo "$VERSION" | sed 's/-SNAPSHOT//g')
+ REALVER=$(echo "$BASEVER" | cut -d '-' -f 1)
+ BRAND=$(echo "$BASEVER" | cut -d '-' -f 2)
+
+ if [ "$REALVER" != "$BRAND" ]; then
+ DEFBRN="-D_brand -$BRAND"
+ BRAND="${BRAND}."
+ else
+ BRAND=""
+ fi
+ fi
+
Review comment:
If $5 or branding is passed, then the above code is not needed. `$5` may be
used as argument for `-D_rel`, why introduce a new `-D_brand`, that way changes
to the spec files may be removed as well.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services