Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/webactivity.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-11-29 23:00:36 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-11-29 23:00:36 (GMT)
commit3fbafbf7e8101db290949a1b7cbf4b77915ae526 (patch)
treee55da813ce0dfd32a4f30c6e623afe43e50f1b35 /webactivity.py
parentca7036ac986b873bb27176edeb5c8d8ec44e98c9 (diff)
Add a version check to make sure we update cert8.db
also for upgrades.
Diffstat (limited to 'webactivity.py')
-rwxr-xr-xwebactivity.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/webactivity.py b/webactivity.py
index 52b9f6c..d52788b 100755
--- a/webactivity.py
+++ b/webactivity.py
@@ -36,8 +36,18 @@ from sugar import profile
from sugar.graphics.alert import Alert
from sugar.graphics.icon import Icon
+PROFILE_VERSION = 1
+
+_profile_version = 0
_profile_path = os.path.join(env.get_profile_path(), 'gecko')
-if not os.path.exists(_profile_path):
+_version_file = os.path.join(_profile_path, 'version')
+
+if os.path.exists(_version_file):
+ f = open(_version_file)
+ _profile_version = int(f.read())
+ f.close()
+
+if _profile_version < 1:
os.mkdir(_profile_path)
shutil.copy('cert8.db', _profile_path)
os.chmod(os.path.join(_profile_path, 'cert8.db'), 0600)