omni: Dont use ROM_VERSION again in cookies target
it can be different to what we wrote into the propery before
cause date is evaluated again
so just grep build.prop for the ro.omni.version string
Change-Id: I30925228bfacad73b4eff48b0a5211f38093d5ee
diff --git a/build/tasks/cookies.mk b/build/tasks/cookies.mk
index f2ca0a5..0484a54 100644
--- a/build/tasks/cookies.mk
+++ b/build/tasks/cookies.mk
@@ -1,10 +1,12 @@
-OMNI_TARGET_PACKAGE := $(PRODUCT_OUT)/omni-$(ROM_VERSION).zip
-
MD5 := prebuilts/build-tools/path/$(HOST_PREBUILT_TAG)/md5sum
+define get-omni-target-package
+ $(PRODUCT_OUT)/omni-$$(sed -n -e'/ro.omni.version=/s/^.*=//p' $(PRODUCT_OUT)/system/build.prop).zip
+endef
+
.PHONY: cookies
cookies: $(INTERNAL_OTA_PACKAGE_TARGET)
- $(hide) ln -f $(INTERNAL_OTA_PACKAGE_TARGET) $(OMNI_TARGET_PACKAGE)
- $(hide) $(MD5) $(OMNI_TARGET_PACKAGE) | sed "s|$(PRODUCT_OUT)/||" > $(OMNI_TARGET_PACKAGE).md5sum
- @echo -e "Package complete: $(OMNI_TARGET_PACKAGE)" >&2
+ $(hide) ln -f $(INTERNAL_OTA_PACKAGE_TARGET) $(call get-omni-target-package)
+ $(hide) $(MD5) $(call get-omni-target-package) | sed "s|$(PRODUCT_OUT)/||" > $(call get-omni-target-package).md5sum
+ @echo -e "Package complete: $(call get-omni-target-package)" >&2