File: remove-git.patch

package info (click to toggle)
ble.sh 0.4.0~git20250806.8060b7a-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,744 kB
  • sloc: sh: 72,358; awk: 1,316; cpp: 750; ansic: 186; javascript: 43; makefile: 35
file content (59 lines) | stat: -rw-r--r-- 1,484 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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#*.}