summaryrefslogtreecommitdiffstatshomepage
path: root/gen-version.sh
blob: 80cf49af486b9aad8228f4821601e0a5e84ed0c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Get version-info specified in Makefile
V=$1

# Use `git describe` to get current version if we're inside a git repo
if test "$(git rev-parse --git-dir 2>/dev/null)" = '.git'
then
	V=$(git describe --abbrev=4 HEAD 2>/dev/null)
fi

new="CGIT_VERSION = $V"
old=$(cat VERSION 2>/dev/null)

# Exit if VERSION is uptodate
test "$old" = "$new" && exit 0

# Update VERSION with new version-info
echo "$new" > VERSION
cat VERSION
(date +%N)" done && strace \ -E HOME="$non_existant_path" \ -E CGIT_CONFIG="$PWD/cgitrc" \ -E QUERY_STRING="url=$1" \ -e access -f -o strace.out cgit && test_must_fail grep "$non_existant_path" strace.out } test_no_home_access_success() { test_expect_success "do not access \$HOME: $1" " test_no_home_access '$1' " } test_no_home_access_success test_no_home_access_success foo test_no_home_access_success foo/refs test_no_home_access_success foo/log test_no_home_access_success foo/tree test_no_home_access_success foo/tree/file-1 test_no_home_access_success foo/commit test_no_home_access_success foo/diff test_no_home_access_success foo/patch test_no_home_access_success foo/snapshot/master.tar.gz test_done