]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - scripts/setlocalversion
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
[net-next-2.6.git] / scripts / setlocalversion
index e90a91cc5185709d31a9a128b4790b676a35599e..ef8729f48586d193d3926d5bd6c4d0b9c34bcb96 100755 (executable)
@@ -43,7 +43,7 @@ scm_version()
        fi
 
        # Check for git and a git repo.
-       if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
+       if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
 
                # If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
                # it, because this version is defined in the top level Makefile.
@@ -85,7 +85,7 @@ scm_version()
        fi
 
        # Check for mercurial and a mercurial repo.
-       if hgid=`hg id 2>/dev/null`; then
+       if test -d .hg && hgid=`hg id 2>/dev/null`; then
                tag=`printf '%s' "$hgid" | cut -s -d' ' -f2`
 
                # Do we have an untagged version?
@@ -160,8 +160,10 @@ if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
        # full scm version string
        res="$res$(scm_version)"
 else
-       # apped a plus sign if the repository is not in a clean tagged
-       # state and  LOCALVERSION= is not specified
+       # append a plus sign if the repository is not in a clean
+       # annotated or signed tagged state (as git describe only
+       # looks at signed or annotated tags - git tag -a/-s) and
+       # LOCALVERSION= is not specified
        if test "${LOCALVERSION+set}" != "set"; then
                scm=$(scm_version --short)
                res="$res${scm:++}"