Simplify ROM filename, s/SNAPSHOT/EXPERIMENTAL/, other cleanups

* Remove "update-" prefix and "-signed" suffix.
* Replace SNAPSHOT with EXPERIMENTAL (arcee).
* If CM_EXTRAVERSION, force to type EXPERIMENTAL.
* UNOFFICIAL builds now with datestamp in the same manner as NIGHTLY.
* date -u uses UTC timezone for consistency.
* Remove some CM7 dead code.

Change-Id: I681fd92e27aaf62c50eae20265ce07c67d477bca
diff --git a/config/common.mk b/config/common.mk
index d183a85..52e9086 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -120,21 +120,33 @@
 PRODUCT_VERSION_MINOR = 0
 PRODUCT_VERSION_MAINTENANCE = 0-RC0
 
+# Set CM_BUILDTYPE
 ifdef CM_NIGHTLY
-    CM_VERSION :=$(PRODUCT_VERSION_MAJOR)-$(shell date +%Y%m%d)-NIGHTLY-$(CM_BUILD)
+    CM_BUILDTYPE := NIGHTLY
+endif
+ifdef CM_EXPERIMENTAL
+    CM_BUILDTYPE := EXPERIMENTAL
+endif
+ifdef CM_RELEASE
+    CM_BUILDTYPE := RELEASE
+endif
+
+ifdef CM_EXTRAVERSION
+    # Force build type to EXPERIMENTAL
+    CM_BUILDTYPE := EXPERIMENTAL
+    # Add leading dash to CM_EXTRAVERSION
+    CM_EXTRAVERSION := -$(CM_EXTRAVERSION)
+endif
+
+# If CM_BUILDTYPE is not defined, set to UNOFFICIAL
+ifndef CM_BUILDTYPE
+    CM_BUILDTYPE := UNOFFICIAL
+endif
+
+ifdef CM_RELEASE
+    CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD)
 else
-    ifdef CM_SNAPSHOT
-        ifdef CM_EXTRAVERSION
-            CM_EXTRAVERSION := -$(CM_EXTRAVERSION)
-        endif
-        CM_VERSION := $(PRODUCT_VERSION_MAJOR)-$(shell date +%Y%m%d)-SNAPSHOT-$(CM_BUILD)$(CM_EXTRAVERSION)
-    else
-        ifdef CM_RELEASE
-            CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD)
-        else
-            CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD)-UNOFFICIAL
-        endif
-    endif
+    CM_VERSION := $(PRODUCT_VERSION_MAJOR)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)-$(CM_BUILD)$(CM_EXTRAVERSION)
 endif
 
 PRODUCT_PROPERTY_OVERRIDES += \
diff --git a/tools/squisher b/tools/squisher
index 6ef914d..552929f 100755
--- a/tools/squisher
+++ b/tools/squisher
@@ -77,14 +77,9 @@
 	find $REPACK/ota/system/lib/modules -name "*.ko" -print0 | xargs -0 arm-eabi-strip --strip-unneeded
 
 # Determine what to name the new signed package
-if [ -z "$CYANOGEN_NIGHTLY" ]; then
-	MODVERSION=`sed -n -e'/ro\.cm\.version/s/^.*=//p' $REPACK/ota/system/build.prop`
-	: ${MODVERSION:=nightly}
-	OUTFILE=$OUT/update-cm-$MODVERSION-signed.zip
-	echo MODVERSION: $MODVERSION
-else
-	OUTFILE=$OUT/update-squished.zip
-fi
+MODVERSION=`sed -n -e'/ro\.cm\.version/s/^.*=//p' $REPACK/ota/system/build.prop`
+OUTFILE=$OUT/cm-$MODVERSION.zip
+echo MODVERSION: $MODVERSION
 
 # Pack it up and sign
 printf "Zipping package..."