Add DATE and PRIORITY fields to the manifest

This commit is contained in:
Matthias Schiffer 2014-07-20 16:33:46 +02:00
parent d376f4d425
commit c4109b349c
2 changed files with 24 additions and 12 deletions

View File

@ -90,7 +90,8 @@ toolchain/% package/% target/%: FORCE
+@$(GLUONMAKE) $@
manifest: FORCE
[ -n "$(GLUON_BRANCH)" ] || (echo 'Please set GLUON_BRANCH to create a manifest.'; false)
[ -n '$(GLUON_BRANCH)' ] || (echo 'Please set GLUON_BRANCH to create a manifest.'; false)
echo '$(GLUON_PRIORITY)' | grep -qE '^([0-9]*\.)?[0-9]+$$' || (echo 'Please specify a numeric value for GLUON_PRIORITY to create a manifest.'; false)
@$(CheckExternal)
+@$(GLUONMAKE_EARLY) maybe-prepare-target
+@$(GLUONMAKE) $@
@ -342,17 +343,23 @@ images: $(patsubst %,call_image/%,$(PROFILES)) ;
manifest: FORCE
mkdir -p $(GLUON_IMAGEDIR)/sysupgrade
(cd $(GLUON_IMAGEDIR)/sysupgrade && echo 'BRANCH=$(GLUON_BRANCH)' && echo && ($(foreach profile,$(PROFILES), \
$(foreach model,$(GLUON_$(profile)_MODELS), \
for file in gluon-*-'$(GLUON_$(profile)_MODEL_$(model))-sysupgrade.bin'; do \
[ -e "$$file" ] && echo \
'$(GLUON_$(profile)_MODEL_$(model))' \
"$$(echo "$$file" | sed -n -r -e 's/^gluon-$(call regex-escape,$(GLUON_SITE_CODE))-(.*)-$(call regex-escape,$(GLUON_$(profile)_MODEL_$(model)))-sysupgrade\.bin$$/\1/p')" \
"$$($(SHA512SUM) "$$file")" \
"$$file" && break; \
done; \
) \
) :)) > $(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_BRANCH).manifest
(cd $(GLUON_IMAGEDIR)/sysupgrade && \
echo 'BRANCH=$(GLUON_BRANCH)' && \
echo 'DATE=$(shell $(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/scripts/rfc3339date.lua)' && \
echo 'PRIORITY=$(GLUON_PRIORITY)' && \
echo && \
($(foreach profile,$(PROFILES), \
$(foreach model,$(GLUON_$(profile)_MODELS), \
for file in gluon-*-'$(GLUON_$(profile)_MODEL_$(model))-sysupgrade.bin'; do \
[ -e "$$file" ] && echo \
'$(GLUON_$(profile)_MODEL_$(model))' \
"$$(echo "$$file" | sed -n -r -e 's/^gluon-$(call regex-escape,$(GLUON_SITE_CODE))-(.*)-$(call regex-escape,$(GLUON_$(profile)_MODEL_$(model)))-sysupgrade\.bin$$/\1/p')" \
"$$($(SHA512SUM) "$$file")" \
"$$file" && break; \
done; \
) \
) :) \
) > $(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_BRANCH).manifest
.PHONY: all images prepare clean gluon-tools

5
scripts/rfc3339date.lua Normal file
View File

@ -0,0 +1,5 @@
local time = os.time()
local timestamp = os.date('%F %T', time)
local timezone = os.date('%z', time):gsub('^([+-]%d%d)(%d%d)$', '%1:%2')
print(timestamp .. timezone)