]> git.saurik.com Git - cydia.git/commitdiff
Take Telesphoreo's preinst.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 8 Mar 2011 09:45:28 +0000 (01:45 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 8 Mar 2011 10:18:58 +0000 (02:18 -0800)
makefile
preinst [new file with mode: 0755]

index 9673241fd8b10ad5e7dba15b5ec7b220ee29fe9e..70fa990bddee29241214fee05434f7d1f236f635 100644 (file)
--- a/makefile
+++ b/makefile
@@ -153,6 +153,7 @@ debs/cydia_$(version)_iphoneos-arm.deb: MobileCydia $(images) $(shell find Mobil
        
        mkdir -p _/DEBIAN
        ./control.sh _ >_/DEBIAN/control
+       cp -a preinst _/DEBIAN/
        
        find _ -exec touch -t "$$(date -j -f "%s" +"%Y%m%d%H%M.%S" "$$(git show --format='format:%ct' | head -n 1)")" {} ';'
        
diff --git a/preinst b/preinst
new file mode 100755 (executable)
index 0000000..86a4a25
--- /dev/null
+++ b/preinst
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+declare -a cydia
+cydia=($CYDIA)
+
+if [[ $1 == upgrade ]]; then
+    if [[ ${CYDIA+@} ]]; then
+        if [[ ${cydia[1]} -lt 1 ]]; then
+            echo 'PLEASE RESTART CYDIA!'
+            echo 'PLEASE RESTART CYDIA!'
+            echo 'PLEASE RESTART CYDIA!'
+        else
+            eval "echo 'finish:reopen' >&${cydia[0]}"
+        fi
+    fi
+
+    echo >/tmp/.cydia.fw
+fi
+
+exit 0