File: get-version.patch

package info (click to toggle)
jq 1.8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,852 kB
  • sloc: ansic: 28,064; yacc: 888; sh: 841; python: 316; cpp: 314; lex: 192; makefile: 181; javascript: 34
file content (29 lines) | stat: -rw-r--r-- 822 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
From: =?utf-8?b?IkNoYW5nWmh1byBDaGVuICjpmbPmmIzlgKwpIg==?=
 <czchen@debian.org>
Date: Mon, 9 Jun 2025 09:11:06 +0800
Subject: Use dpkg-parsechangelog to get build version

Forwarded: not-needed
---
 scripts/version | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/scripts/version b/scripts/version
index f24a18d..41c1947 100755
--- a/scripts/version
+++ b/scripts/version
@@ -1,13 +1,2 @@
 #!/bin/sh
-set -eu
-
-cd "$(dirname "$0")/../"
-test -e .git || exit 1
-
-if git describe --tags --match 'jq-*' >/dev/null 2>&1; then
-  git describe --tags --match 'jq-*' --dirty | sed 's/^jq-//'
-else
-  branch=$(git rev-parse --abbrev-ref HEAD)
-  commit=$(git describe --always --dirty)
-  echo "${branch}-${commit}"
-fi
+dpkg-parsechangelog --show-field Version | cut --delimiter='-' --field=1