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
|
Description: Use recorded Git commit id when building the extension
Author: Jérémy Bobbio <lunar@debian.org>
Forwarded: not-needed
diff --git a/makexpi.sh b/makexpi.sh
index 1910712..f3f0595 100755
--- a/makexpi.sh
+++ b/makexpi.sh
@@ -114,11 +114,7 @@ fi
[ -d pkg ] || mkdir pkg
# Used for figuring out which branch to pull from when viewing source for rules
-GIT_OBJECT_FILE=".git/refs/heads/master"
-export GIT_COMMIT_ID="HEAD"
-if [ -e "$GIT_OBJECT_FILE" ]; then
- export GIT_COMMIT_ID=$(cat "$GIT_OBJECT_FILE")
-fi
+export GIT_COMMIT_ID="$(sed -e 's/[^:]*://' debian/upstream-git-commit-id)"
cd src
diff --git a/utils/make-sqlite.py b/utils/make-sqlite.py
index 4e6b190..3fa6011 100755
--- a/utils/make-sqlite.py
+++ b/utils/make-sqlite.py
@@ -34,7 +34,7 @@ c.execute('''DROP TABLE IF EXISTS git_commit''')
c.execute('''CREATE TABLE git_commit
(git_commit TEXT)''')
-git_commit = subprocess.check_output("git rev-parse HEAD", shell=True).rstrip("\n")
+git_commit = file('debian/upstream-git-commit-id').read().strip().split(':')[1]
c.execute('''INSERT INTO git_commit (git_commit) VALUES(?)''', (git_commit,))
parser = etree.XMLParser(remove_blank_text=True)
|