public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [patch] nicer version handling
@ 2007-01-12  5:50 Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2007-01-12  5:50 UTC (permalink / raw)
  To: u-boot

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
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070112/c6cf0043/attachment.pgp 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: u-boot-nicer-version-handling.patch
Type: text/x-diff
Size: 1475 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070112/c6cf0043/attachment.patch 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot-Users] [patch] nicer version handling
@ 2007-06-22  8:14 Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2007-06-22  8:14 UTC (permalink / raw)
  To: u-boot

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 <vapier@gentoo.org>
---
diff --git a/Makefile b/Makefile
index 2d8cff3..41661e3 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/tools/setlocalversion b/tools/setlocalversion
index 9a23825..25072fd 100755
--- a/tools/setlocalversion
+++ b/tools/setlocalversion
@@ -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 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-22  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-12  5:50 [U-Boot-Users] [patch] nicer version handling Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2007-06-22  8:14 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox