diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-11-29 23:00:36 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-11-29 23:12:30 (GMT) |
commit | 50819ac11e79d8acc5d292ce4e9e53afd5c27ac0 (patch) | |
tree | 35a19cc2c96e9b676c2c453fcb1163862e5dc1ab | |
parent | a84c0c5f36beb7eb25893f3089c824b3973536e9 (diff) |
Add a version check to make sure we update cert8.db
also for upgrades.
-rwxr-xr-x | webactivity.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/webactivity.py b/webactivity.py index eea98d2..91d60f5 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) |