Description: Drop Git dependency
Author: Eric Long <i@hack3r.moe>
Forwarded: not-needed

--- a/GNUmakefile
+++ b/GNUmakefile
@@ -4,7 +4,7 @@
 .PHONY: all
 
 # git version
-GIT_VERSION = $(shell LANG=C git --version)
+GIT_VERSION = unknown
 
 # check GNU Make
 ifeq ($(.FEATURES),)
@@ -44,19 +44,8 @@
 
 FULLVER := 0.4.0-devel4
 
-BLE_GIT_COMMIT_ID :=
-BLE_GIT_BRANCH :=
-ifneq ($(wildcard .git),)
-  BLE_GIT_COMMIT_ID := $(shell git show -s --format=%h)
-  BLE_GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
-else ifneq ($(wildcard make/.git-archive-export.mk),)
-  ifeq ($(shell grep '\$$Format:.*\$$' make/.git-archive-export.mk),)
-    include make/.git-archive-export.mk
-  endif
-endif
-ifeq ($(BLE_GIT_COMMIT_ID),)
-  $(error Failed to determine the commit id of the current tree.  The .git directory is required to build ble.sh.)
-endif
+BLE_GIT_COMMIT_ID := unknown
+BLE_GIT_BRANCH := unknown
 
 OUTDIR:=out
 
--- a/ble.pp
+++ b/ble.pp
@@ -103,7 +103,7 @@
 
 {
   #%[commit_hash = getenv("BLE_GIT_COMMIT_ID")]
-  #%[ble_version = getenv("FULLVER") + "+" + commit_hash]
+  #%[ble_version = getenv("FULLVER")]
   #%expand
   ##%if commit_hash != ""
   _ble_init_version=$"ble_version"
@@ -1155,6 +1155,10 @@
     status=${version#*-}
     version=${version%%-*}
   fi
+  if [[ $version == *~* ]]; then
+    status=${version#*~}
+    version=${version%%~*}
+  fi
 
   local major=${version%%.*}; version=${version#*.}
   local minor=${version%%.*}; version=${version#*.}
