mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
Fix Chaos Calmer revision numbering. CC has been stuck at r49389 since the final move to Github as revision number evaluation has still been based on git-svn-id that is not found in the new original Github commits. So the revision has been stuck at last svn commit in June. This patch * copies the git revision logic from master and uses v15.05.1 tag as the base. As the last commit with a known svn revision 49389 wascb4f071with tag+135, use 49254 as the adjustment. That produces r49461 for the current8a1f7c9* removes the useless svn evaluation (similarly as in master). Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
35 lines
698 B
Bash
Executable File
35 lines
698 B
Bash
Executable File
#!/usr/bin/env bash
|
|
export LANG=C
|
|
export LC_ALL=C
|
|
[ -n "$TOPDIR" ] && cd $TOPDIR
|
|
|
|
try_version() {
|
|
[ -f version ] || return 1
|
|
REV="$(cat version)"
|
|
[ -n "$REV" ]
|
|
}
|
|
|
|
try_svn() {
|
|
[ -d .svn ] || return 1
|
|
REV="$(svn info | awk '/^Last Changed Rev:/ { print $4 }')"
|
|
REV="${REV:+r$REV}"
|
|
[ -n "$REV" ]
|
|
}
|
|
|
|
try_git() {
|
|
git rev-parse --git-dir >/dev/null 2>&1 || return 1
|
|
REV="$(git describe --tags | sed "s/v15.05.1-\([0-9]*\)-.*/\1/g")"
|
|
REV="${REV:+r$((REV+49254))}"
|
|
[ -n "$REV" ]
|
|
}
|
|
|
|
try_hg() {
|
|
[ -d .hg ] || return 1
|
|
REV="$(hg log -r-1 --template '{desc}' | awk '{print $2}' | sed 's/\].*//')"
|
|
REV="${REV:+$REV}"
|
|
[ -n "$REV" ]
|
|
}
|
|
|
|
try_version || try_git || try_hg || REV="unknown"
|
|
echo "$REV"
|