make-rules/shared-macros.mk
changeset 477 068d10529156
parent 459 c7579764bc73
child 486 00cc0158aa99
--- a/make-rules/shared-macros.mk	Wed Aug 17 15:10:16 2011 -0700
+++ b/make-rules/shared-macros.mk	Wed Aug 17 15:26:03 2011 -0700
@@ -62,6 +62,18 @@
 
 ROOT =			/
 
+# The package branch version scheme is:
+#
+#       trunk_id.update.SRU.platform.buildid.nightlyid
+#
+# where
+#       trunk_id : build number for tip development gate, with leading 0
+#       update   : 0 for FCS, 1 for update 1, etc.
+#       SRU      : SRU (support repository update) number for this update
+#       platform : reserved for future use.
+#       buildid  : the build number of the last non-zero element from above
+#       nightlyid: nightly build identifier
+
 # get the most recent build number from the last mercurial tag
 LAST_HG_TAG =	$(shell hg tags -q | grep build- | head -1)
 LAST_BUILD_NUM = $(LAST_HG_TAG:build-%=%)
@@ -69,8 +81,43 @@
 OS_VERSION =		$(shell uname -r)
 SOLARIS_VERSION =	$(OS_VERSION:5.%=2.%)
 BUILD_NUM =		0.$(shell expr $(LAST_BUILD_NUM) + 1)
-BUILD_VERSION =		$(OS_VERSION)-$(BUILD_NUM)
+
+#
+# The Solaris Update number. This will be set by the gatekeepers.
+# The value must match the update number of the release.
+#
+UPDATENUM ?= 0
+
+#
+# Support Respository Update number. This is here to reserve space within the
+# version string. Typically it should not be set unless all the packages
+# are being delivered within an SRU.
+#
+SRUNUM ?= 0
 
+#
+# Platform number. This is here to reserve space within the version
+# string. It should not be set unless there is a specific need to
+# release a platform update while the Solaris Update is being built.
+#
+PLATNUM ?= 0
+
+#
+# Build Identifier. Used to indicate which build (or respin for
+# the development build) of the Solaris Update is being built.
+# This is set by the gatekeepers.
+#
+BUILDID ?= 0
+
+# Each (nightly) build of the code that produces packages needs to
+# be uniquely identified so that packages produced by different
+# builds can't be mixed.  Mixing packages from different builds can
+# easily result in broken global and nonglobal zones.
+#
+NIGHTLYID ?=	$(shell hg tip --template '{rev}\n')
+
+BUILD_VERSION =	 \
+    $(OS_VERSION)-$(BUILD_NUM).$(UPDATENUM).$(SRUNUM).$(PLATNUM).$(BUILDID).$(NIGHTLYID)
 
 COMPILER =		studio
 BITS =			32