]> git.saurik.com Git - cydia.git/blame_incremental - version.sh
The Sources list hasn't been sorted since 2008.
[cydia.git] / version.sh
... / ...
CommitLineData
1#!/bin/bash
2
3if [[ $# -eq 0 ]]; then
4 flags=(--dirty="+")
5else
6 flags=("$@")
7fi
8
9version=$(git describe --tags --match="v*" "${flags[@]}" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@;s@%@~@g')
10
11if grep '#define ForRelease 0' MobileCydia.mm &>/dev/null; then
12 version=${version}~srk
13fi
14
15define="#define CYDIA_VERSION \"${version}\""
16before=$(cat Version.h 2>/dev/null)
17
18if [[ ${before} != ${define} ]]; then
19 echo "${define}" >Version.h
20fi
21
22echo "${version}"