nicer version handling
PATCH 1/1 nicer version handling
this patch adds support to the setlocalversion script for u-boot in subversion repos and for 'localversion-' version files like the kernel
ive also fixed up the version target in the toplevel Makefile so that it only updates the $(VERSION_FILE) as needed so that it wont wrongly trigger rebuilds in files that include version.h
Signed-off-by Mike Frysinger <[email protected]>
---
Makefile +9 -5
@@ -290,11 +290,15 @@ $(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin version: - @echo -n "#define U_BOOT_VERSION \"U-Boot " > $(VERSION_FILE); \ - echo -n "$(U_BOOT_VERSION)" >> $(VERSION_FILE); \ - echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \ - $(TOPDIR)) >> $(VERSION_FILE); \ - echo "\"" >> $(VERSION_FILE) + @echo -n "#define U_BOOT_VERSION \"U-Boot " > $(VERSION_FILE).tmp; \ + echo -n "$(U_BOOT_VERSION)" >> $(VERSION_FILE).tmp; \ + echo -n "$(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion $(TOPDIR))" >> $(VERSION_FILE).tmp; \ + echo "\"" >> $(VERSION_FILE).tmp + @if ! cmp -s $(VERSION_FILE) $(VERSION_FILE).tmp; then \ + mv -f $(VERSION_FILE).tmp $(VERSION_FILE); \ + else \ + rm -f $(VERSION_FILE).tmp; \ + fi gdbtools: $(MAKE) -C tools/gdb all || exit 1
tools/setlocalversion +8 -0
@@ -20,3 +20,11 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then printf '%s' -dirty fi fi + +# Check for svn and a svn repo. +if rev=`svn info 2>/dev/null | grep '^Revision' | awk '{print $NF}'` ; then + printf -- '-svn%s' $rev +fi + +# Check for any localversion-* files +printf '%s' "`cat localversion-* 2>/dev/null`"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070622/0dba35b0/attachment.pgp