]> git.saurik.com Git - cydia.git/blobdiff - version.sh
Do not restart SpringBoard if symlink is damaged.
[cydia.git] / version.sh
index 3d2ce58d3cd1b6b3c2c0ec21e7fe2f94ad0b8339..3c95ec71093ac6e38117c07f8487fee9f9f52e26 100755 (executable)
@@ -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}"