X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tools%2Fsetlocalversion;h=e11f54f55ab0e5db943c2b6e879962aaf848ae97;hb=5eb522a68c3573419f42e321dccf4b01b584dbe8;hp=9bbdafdb6dcb79f8f6b6f0763df3c7bdb078e18d;hpb=27f33e9f45ef7f9685cbdc65066a1828e85dde4f;p=u-boot diff --git a/tools/setlocalversion b/tools/setlocalversion index 9bbdafdb6d..e11f54f55a 100755 --- a/tools/setlocalversion +++ b/tools/setlocalversion @@ -13,7 +13,8 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then # Do we have an untagged version? if git name-rev --tags HEAD | \ grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then - git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' + (git describe || git describe --tags || git describe --all --long) \ + 2>/dev/null | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' fi # Are there uncommitted changes? @@ -22,4 +23,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`"