Fixed boot scripts
[ussd-widget] / ussd4all / rtcom / rtcompatcher.py
index 450defe..9da9731 100644 (file)
@@ -73,7 +73,7 @@ class Patcher:
         f.close()
 
 if __name__ == '__main__':
-    import sys, os, shutil
+    import sys, os, shutil, subprocess
 
     library = '/usr/lib/librtcom-call-ui.so.0.0.0'
 
@@ -85,13 +85,17 @@ if __name__ == '__main__':
 
     if not patcher.check_md5sum(library):
         if not patcher.check_data(library):
-            print "Your %s is not recognized. So I won't patch it." % (library,)
-            sys.exit(1)
+            message = "Your %s is not recognized. So I won't patch it." % (library,)
+           subprocess.call(["dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:\""+message+"\" uint32:0 string:\"OK\""],shell=True)
+           print message       
+           sys.exit(1)
         if len(sys.argv) > 1 and sys.argv[1] == '--force':
-            print "Patching an unrecognized %s. Please test your system before rebooting." % (library,)
+            message = "Patching an unrecognized %s. Please test your system before rebooting." % (library,)
+           print message           
         else:
            message = "Your %s is not recognized, but it seems to match the patterns.\nRun '%s --force' to try patching anyway, but understand that\nTHIS MAY BREAK YOUR SYSTEM.  If you do, test your system thoroughly before rebooting." % (library,library,sys.argv[0])
            subprocess.call(["dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:\""+message+"\" uint32:0 string:\"OK\""],shell=True)
+           print message
            sys.exit(1)
 
     shutil.copy2(library, library+'.orig')