make_release_packages
changeset 906 4c633d8c519b
parent 905 d2b59d5a79ed
child 907 3c35d611cdaa
--- a/make_release_packages	Wed Feb 17 12:30:44 2010 -0800
+++ b/make_release_packages	Wed Feb 17 14:57:13 2010 -0800
@@ -179,23 +179,21 @@
 
 cd ${PKG_SOURCE_DIR}
 
-# Get build version from pkgversion
-if [[ -f pkgversion ]] ; then
-    source ./pkgversion
-else
-    fatal_error "${PKG_SOURCE_DIR}/pkgversion not found.  Cannot continue."
+# Hardcode base package version for now, append OS version from uname
+XVERSION="6.9.0"
+OSVERSION="$(uname -r)"
+VERSION="${XVERSION}.${OSVERSION}"
+
+# Get build version from hg by searching for most recent tag matching nv_*
+BUILD_TAG="$(hg log | \
+	     perl -l -n -e 'if ($_ =~ m/^tag:\s+nv_(\d+)/) {print $1 ; exit}')"
+
+if [[ -z "${BUILD_TAG}" ]] ; then
+    fatal_error "BUILD_TAG could not be found from hg_log"
 fi
 
-if [[ -z "${VERSION}" ]] ; then
-    fatal_error "VERSION not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
-fi
-
-if [[ -z "${BUILD}" ]] ; then
-    fatal_error "BUILD not set in ${PKG_SOURCE_DIR}/pkgversion - run newPkRev"
-fi
-
-DECIMAL_BUILD=$(( ${BUILD} / 100.0 ))
-print "Building packages for X11 version ${VERSION} build ${DECIMAL_BUILD}"
+print "Building packages for X11 version ${VERSION} build ${BUILD_TAG}"
+BUILD=$(( ${BUILD_TAG} * 100 ))
 
 if [[ "${MACH}" = "sparc" ]]; then
     PROTODIR=${SOURCE_DIR}/proto-sun4-svr4