|
0 |
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
|
1 |
Date: Thu, 11 Jun 2015 18:26:16 -0400
|
|
2 |
Subject: Remove upstream git fanciness
|
|
3 |
|
|
4 |
Debian needs to be able to build libgpg-error while using git for
|
|
5 |
tracking the debian packaging itself. Debian also wants to autoreconf
|
|
6 |
this stuff. However, Debian does *not* need to conform exactly to
|
|
7 |
upstream's git configurations.
|
|
8 |
|
|
9 |
This avoids mistakes like accidentally identifying running code as a
|
|
10 |
beta.
|
|
11 |
|
|
12 |
This is the same approach taken in debian's libgpg-error packaging
|
|
13 |
since 2017.
|
|
14 |
|
|
15 |
Forwarded: not-needed
|
|
16 |
---
|
|
17 |
autogen.sh | 67 ++++----------------------------------------------------------
|
|
18 |
1 file changed, 4 insertions(+), 63 deletions(-)
|
|
19 |
|
|
20 |
diff --git a/autogen.sh b/autogen.sh
|
|
21 |
index 9b36158..5dfca0e 100755
|
|
22 |
--- a/autogen.sh
|
|
23 |
+++ b/autogen.sh
|
|
24 |
@@ -249,27 +249,10 @@ if [ "$myhost" = "find-version" ]; then
|
|
25 |
fi
|
|
26 |
|
|
27 |
beta=no
|
|
28 |
- if [ -e .git ]; then
|
|
29 |
- ingit=yes
|
|
30 |
- tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
|
|
31 |
- tmp=$(echo "$tmp" | sed s/^"$package"//)
|
|
32 |
- if [ -n "$tmp" ]; then
|
|
33 |
- tmp=$(echo "$tmp" | sed s/^"$package"// \
|
|
34 |
- | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
|
|
35 |
- else
|
|
36 |
- tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \
|
|
37 |
- | awk -F- '$4!=0{print"-beta"$4}')
|
|
38 |
- fi
|
|
39 |
- [ -n "$tmp" ] && beta=yes
|
|
40 |
- rev=$(git rev-parse --short HEAD | tr -d '\n\r')
|
|
41 |
- rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
|
|
42 |
- else
|
|
43 |
- ingit=no
|
|
44 |
- beta=yes
|
|
45 |
- tmp="-unknown"
|
|
46 |
- rev="0000000"
|
|
47 |
- rvd="0"
|
|
48 |
- fi
|
|
49 |
+ ingit=no
|
|
50 |
+ tmp=""
|
|
51 |
+ rvd="$(wc -l < debian/changelog)"
|
|
52 |
+ rev="$(printf %07x $rvd)"
|
|
53 |
|
|
54 |
echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:"
|
|
55 |
exit 0
|
|
56 |
@@ -452,48 +435,6 @@ EOF
|
|
57 |
die_p
|
|
58 |
fi
|
|
59 |
|
|
60 |
-# Check the git setup.
|
|
61 |
-if [ -d .git ]; then
|
|
62 |
- CP="cp -p"
|
|
63 |
- # If we have a GNU cp we can add -v
|
|
64 |
- if cp --version >/dev/null 2>/dev/null; then
|
|
65 |
- [ -z "${SILENT}" ] && CP="$CP -v"
|
|
66 |
- fi
|
|
67 |
- if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
|
|
68 |
- [ -z "${SILENT}" ] && cat <<EOF
|
|
69 |
-*** Activating trailing whitespace git pre-commit hook. ***
|
|
70 |
- For more information see this thread:
|
|
71 |
- https://mail.gnome.org/archives/desktop-devel-list/2009-May/msg00084.html
|
|
72 |
- To deactivate this pre-commit hook again move .git/hooks/pre-commit
|
|
73 |
- and .git/hooks/pre-commit.sample out of the way.
|
|
74 |
-EOF
|
|
75 |
- $CP .git/hooks/pre-commit.sample .git/hooks/pre-commit
|
|
76 |
- chmod +x .git/hooks/pre-commit
|
|
77 |
- fi
|
|
78 |
-
|
|
79 |
- if [ "$gettext_vers" != "n/a" ]; then
|
|
80 |
- tmp=$(git config --get filter.cleanpo.clean)
|
|
81 |
- if [ "$tmp" != \
|
|
82 |
- "awk '/^\"POT-Creation-Date:/&&!s{s=1;next};!/^#: /{print}'" ]
|
|
83 |
- then
|
|
84 |
- info "*** Adding GIT filter.cleanpo.clean configuration."
|
|
85 |
- git config --add filter.cleanpo.clean \
|
|
86 |
- "awk '/^\"POT-Creation-Date:/&&!s{s=1;next};!/^#: /{print}'"
|
|
87 |
- fi
|
|
88 |
- fi
|
|
89 |
- if [ -f build-aux/git-hooks/commit-msg -a ! -f .git/hooks/commit-msg ] ; then
|
|
90 |
- [ -z "${SILENT}" ] && cat <<EOF
|
|
91 |
-*** Activating commit log message check hook. ***
|
|
92 |
-EOF
|
|
93 |
- $CP build-aux/git-hooks/commit-msg .git/hooks/commit-msg
|
|
94 |
- chmod +x .git/hooks/commit-msg
|
|
95 |
- if [ x"${display_name}" != x ]; then
|
|
96 |
- git config format.subjectPrefix "PATCH ${display_name}"
|
|
97 |
- git config sendemail.to "${patches_to}"
|
|
98 |
- fi
|
|
99 |
- fi
|
|
100 |
-fi
|
|
101 |
-
|
|
102 |
aclocal_flags="-I m4"
|
|
103 |
if [ -n "${extra_aclocal_flags}" ]; then
|
|
104 |
aclocal_flags="${aclocal_flags} ${extra_aclocal_flags}"
|