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:00:36 (GMT) |
commit | 3fbafbf7e8101db290949a1b7cbf4b77915ae526 (patch) | |
tree | e55da813ce0dfd32a4f30c6e623afe43e50f1b35 /webactivity.py | |
parent | ca7036ac986b873bb27176edeb5c8d8ec44e98c9 (diff) |
Add a version check to make sure we update cert8.db
also for upgrades.
Diffstat (limited to 'webactivity.py')
-rwxr-xr-x | webactivity.py | 12 |
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) |