Add support for u-boot in svn and localversion-* files
authorMike Frysinger <vapier@gentoo.org>
Tue, 8 Apr 2008 18:00:57 +0000 (14:00 -0400)
committerWolfgang Denk <wd@denx.de>
Fri, 18 Apr 2008 17:08:31 +0000 (10:08 -0700)
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
tools/setlocalversion

index 9bbdafdb6dcb79f8f6b6f0763df3c7bdb078e18d..bbb2ab2f71f562f212e2befcc6d8f69efb4f3124 100755 (executable)
@@ -22,4 +22,18 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
            | read dummy; then
                printf '%s' -dirty
        fi
+
+       # Is this git on svn?
+       if git config --get svn-remote.svn.url >/dev/null; then
+               printf -- '-svn%s' "`git-svn find-rev $head`"
+       fi
 fi
+
+# Check for svn and a svn repo.
+if rev=`svn info 2>/dev/null` ; then
+       rev=`echo "${rev}" | grep '^Revision' | awk '{print $NF}'`
+       printf -- '-svn%s' $rev
+fi
+
+# Check for any localversion-* files
+printf '%s' "`cat localversion-* 2>/dev/null`"