Browse Source

build: also consider builds off of git with `git clone --depth 1`

one case where this could happen is a shallow clone, purely for build
purposes. in source based distros, like gentoo, setting depth of the
clone to 1, globally, is a common configuration. this patch avoids that
those builds fail.

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
master
Paymon MARANDI 3 weeks ago committed by Oswald Buddenhagen
parent
commit
884413b488
  1. 4
      version.sh

4
version.sh

@ -17,12 +17,12 @@ if test -z "$mb"; then
fi fi
if test -z "$mb"; then if test -z "$mb"; then
# still no upstream, so just describe HEAD as-is. # still no upstream, so just describe HEAD as-is.
gver=$(git describe --tags HEAD) gver=$(git describe --always --tags HEAD)
else else
# find out whether we have local work, and if so, collapse it into # find out whether we have local work, and if so, collapse it into
# a single suffix. otherwise, we'd cause pointless rebuilds during # a single suffix. otherwise, we'd cause pointless rebuilds during
# development. # development.
gver=$(git describe --tags $mb) gver=$(git describe --always --tags $mb)
lcl=$(git rev-list -n 1 $mb..HEAD) lcl=$(git rev-list -n 1 $mb..HEAD)
if test -n "$lcl"; then if test -n "$lcl"; then
gver="$gver-plus" gver="$gver-plus"

Loading…
Cancel
Save