X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/6348721de3e4baa701f117ba60534a9d8732705c..c9f3aa21b5f00bb40fc836f25758c357bf7d4efa:/version.sh?ds=sidebyside diff --git a/version.sh b/version.sh index 3d2ce58d..3c95ec71 100755 --- a/version.sh +++ b/version.sh @@ -6,10 +6,17 @@ else flags=("$@") fi -version=$(git describe --tags --match="v*" "${flags[@]}" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@') +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}"