From 4ef1eef9480ebfd5cc710b82d8d4968b84a0ed32 Mon Sep 17 00:00:00 2001 From: Brandon Schaefer Date: Tue, 26 Aug 2014 16:17:51 -0700 Subject: * Create a migration script to move the old stamp to the new location (bzr r3860.4.2) --- .../03_unity_first_run_stamp_move | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 tools/migration-scripts/03_unity_first_run_stamp_move (limited to 'tools/migration-scripts') diff --git a/tools/migration-scripts/03_unity_first_run_stamp_move b/tools/migration-scripts/03_unity_first_run_stamp_move new file mode 100755 index 000000000..a2ecdf5f2 --- /dev/null +++ b/tools/migration-scripts/03_unity_first_run_stamp_move @@ -0,0 +1,35 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# Copyright (C) 2014 Canonical +# +# Authors: +# Brandon Schaefer +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 3. +# +# This program is distributed in the hope that it will be useful, but WITHOUTa +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from gi.repository import GLib +from os import path, rename, mkdir + +old_first_run_path = GLib.get_user_cache_dir() + "/unity/first_run.stamp" +new_first_run_path = GLib.get_user_config_dir() + "/unity" + +# If we have the old first_run.stamp file, we must move it to the new location +if path.isfile(old_first_run_path): + + # make sure the new dir exists before attempting to move + if not path.isdir(new_first_run_path): + mkdir(new_first_run_path) + + new_first_run_path += "/first_run.stamp" + rename(old_first_run_path, new_first_run_path) -- cgit v1.2.3