X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/75896941dcc686055fe7ac8e6a86d54a69aac216..60bd32466fcc4830ee8ff1774cd2e8d5bf390f4a:/version.sh diff --git a/version.sh b/version.sh index 7fcf1515..3c95ec71 100755 --- a/version.sh +++ b/version.sh @@ -6,6 +6,17 @@ else flags=("$@") fi -echo -n "$(git describe --tags --match="v*" "${flags[@]}" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@')" -grep '#define ForRelease 0' MobileCydia.mm &>/dev/null && echo -n '~srk' -echo +version=$(git describe --tags --match="v*" "${flags[@]}" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@;s@%@~@g') + +if grep '#define ForRelease 0' MobileCydia.mm &>/dev/null; then + version=${version}~srk +fi + +define="#define CYDIA_VERSION \"${version}\"" +before=$(cat Version.h 2>/dev/null) + +if [[ ${before} != ${define} ]]; then + echo "${define}" >Version.h +fi + +echo "${version}"