Merge lp:~bregma/compiz/lp-1423566 into lp:compiz/0.9.12

Proposed by Stephen M. Webb
Status: Merged
Approved by: Christopher Townsend
Approved revision: 3928
Merged at revision: 3948
Proposed branch: lp:~bregma/compiz/lp-1423566
Merge into: lp:compiz/0.9.12
Diff against target: 242 lines (+0/-209)
6 files modified
debian/00_remove_unityshell_in_gnome_session.py (+0/-47)
debian/00_remove_unityshell_in_mate_session.py (+0/-47)
debian/compiz-gnome.migrations (+0/-1)
debian/compiz-mate.migrations (+0/-1)
postinst/migration-scripts/02_migrate_to_gsettings.py (+0/-69)
postinst/migration-scripts/03_migrate_profile_independent.py (+0/-44)
To merge this branch: bzr merge lp:~bregma/compiz/lp-1423566
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Compiz Maintainers Pending
Review via email: mp+250340@code.launchpad.net

Commit message

removed redundant 12.04 migration scripts

Description of the change

Removes the migration scripts added for the 12.04 LTS release of Compiz and duplicated for the recent Maté support.

These scripts are no longer required since migration from pre-12.04 would require upgrading to 12.04 first, and installs after 12.04 would not need migrating.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~bregma/compiz/lp-1423566 updated
3928. By Stephen M. Webb

removed gsettings migration scripts

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'debian/00_remove_unityshell_in_gnome_session.py'
--- debian/00_remove_unityshell_in_gnome_session.py 2012-10-17 11:25:46 +0000
+++ debian/00_remove_unityshell_in_gnome_session.py 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3# Copyright (C) 2012 Canonical
4#
5# Authors:
6# Didier Roche <didrocks@ubuntu.com>
7#
8# This program is free software; you can redistribute it and/or modify it under
9# the terms of the GNU General Public License as published by the Free Software
10# Foundation; version 3.
11#
12# This program is distributed in the hope that it will be useful, but WITHOUTa
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15# details.
16#
17# You should have received a copy of the GNU General Public License along with
18# this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21from gi.repository import Gio
22import os
23
24gsettings=Gio.Settings(schema="org.compiz.core", path="/org/compiz/profiles/Default/plugins/core/")
25plugins_list = gsettings.get_strv("active-plugins")
26
27# Remove unityshell the default profile if present (case of new install and first session startup)
28try:
29 plugins_list.remove('unityshell')
30except ValueError:
31 pass
32try:
33 plugins_list.remove('unitymtgrabhandles')
34except ValueError:
35 pass
36# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
37#gsettings.set_strv("active-plugins", plugins_list)
38from subprocess import Popen, PIPE, STDOUT
39p = Popen(['dconf', 'load', '/org/compiz/profiles/Default/plugins/core/'], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
40p.communicate(input="[/]\nactive-plugins=%s" % plugins_list)
41
42# remove the eventually existing local config file which can prevent the default profile to use gsettings for quantal users before this fix
43try:
44 os.remove(os.path.join(os.path.expanduser('~'), '.config', 'compiz-1', 'compizconfig', 'config'))
45except OSError:
46 pass
47
480
=== removed file 'debian/00_remove_unityshell_in_mate_session.py'
--- debian/00_remove_unityshell_in_mate_session.py 2015-02-04 22:20:18 +0000
+++ debian/00_remove_unityshell_in_mate_session.py 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3# Copyright (C) 2012 Canonical
4#
5# Authors:
6# Didier Roche <didrocks@ubuntu.com>
7#
8# This program is free software; you can redistribute it and/or modify it under
9# the terms of the GNU General Public License as published by the Free Software
10# Foundation; version 3.
11#
12# This program is distributed in the hope that it will be useful, but WITHOUTa
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15# details.
16#
17# You should have received a copy of the GNU General Public License along with
18# this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21from gi.repository import Gio
22import os
23
24gsettings=Gio.Settings(schema="org.compiz.core", path="/org/compiz/profiles/mate/plugins/core/")
25plugins_list = gsettings.get_strv("active-plugins")
26
27# Remove unityshell the default profile if present (case of new install and first session startup)
28try:
29 plugins_list.remove('unityshell')
30except ValueError:
31 pass
32try:
33 plugins_list.remove('unitymtgrabhandles')
34except ValueError:
35 pass
36# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
37#gsettings.set_strv("active-plugins", plugins_list)
38from subprocess import Popen, PIPE, STDOUT
39p = Popen(['dconf', 'load', '/org/compiz/profiles/mate/plugins/core/'], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
40p.communicate(input="[/]\nactive-plugins=%s" % plugins_list)
41
42# remove the eventually existing local config file which can prevent the default profile to use gsettings for quantal users before this fix
43try:
44 os.remove(os.path.join(os.path.expanduser('~'), '.config', 'compiz-1', 'compizconfig', 'config'))
45except OSError:
46 pass
47
480
=== modified file 'debian/compiz-gnome.migrations'
--- debian/compiz-gnome.migrations 2014-12-08 20:58:07 +0000
+++ debian/compiz-gnome.migrations 2015-03-13 18:09:41 +0000
@@ -1,4 +1,3 @@
1debian/00_remove_unityshell_in_gnome_session.py
2debian/00_remove_decor_in_unity_session.py1debian/00_remove_decor_in_unity_session.py
3debian/00_remove_scalefilter_in_unity_session.py2debian/00_remove_scalefilter_in_unity_session.py
4debian/00_remove_gnomecompat_in_unity_session.py3debian/00_remove_gnomecompat_in_unity_session.py
54
=== removed file 'debian/compiz-mate.migrations'
--- debian/compiz-mate.migrations 2015-02-04 22:20:18 +0000
+++ debian/compiz-mate.migrations 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1debian/00_remove_unityshell_in_mate_session.py
20
=== removed directory 'postinst/migration-scripts'
=== removed file 'postinst/migration-scripts/02_migrate_to_gsettings.py'
--- postinst/migration-scripts/02_migrate_to_gsettings.py 2012-07-23 10:56:23 +0000
+++ postinst/migration-scripts/02_migrate_to_gsettings.py 1970-01-01 00:00:00 +0000
@@ -1,69 +0,0 @@
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3# Copyright (C) 2012 Canonical
4#
5# Authors:
6# Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>
7# Didier Roche <didrocks@ubuntu.com>
8#
9# This program is free software; you can redistribute it and/or modify it under
10# the terms of the GNU General Public License as published by the Free Software
11# Foundation; version 3.
12#
13# This program is distributed in the hope that it will be useful, but WITHOUTa
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16# details.
17#
18# You should have received a copy of the GNU General Public License along with
19# this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
22import gconf
23import glib
24import subprocess
25import os.path
26
27# this should point to the directory where all the .convert files are stored
28CONVERT_PATH = "/usr/lib/compiz/migration/"
29
30def migrate_file(convert_file):
31 subprocess.Popen(["gsettings-data-convert", "--file={}{}".format(CONVERT_PATH, convert_file)]).communicate()
32
33def migrate_gconf_to_gsettings():
34 client = gconf.client_get_default()
35
36 if not client:
37 print "WARNING: no gconf client found. No transitionning will be done"
38 return
39
40 # get current compiz profile to know if we need to switch or not
41 # as compiz is setting that as a default key schema each time you
42 # change the profile, the key isn't straightforward to get and set
43 # as compiz set a new schema instead of a value..
44 try:
45 current_profile_schema = client.get_schema("/apps/compizconfig-1/current_profile")
46 except (glib.GError, AttributeError):
47 print "No current profile set, no migration needed"
48 return
49
50 if current_profile_schema:
51 current_profile_gconfvalue = current_profile_schema.get_default_value()
52 current_profile_str = current_profile_gconfvalue.get_string()
53 else:
54 print "No current profile set, no migration needed"
55 return
56
57 # depending what current profile is set, migrate using specific .convert files
58 if current_profile_str == 'unity':
59 print "Will migrate 'unity' as the active profile"
60 migrate_file('compiz-profile-active-unity.convert')
61 migrate_file('compiz-profile-Default.convert')
62 else:
63 print "Will migrate 'Default' as the active profile"
64 migrate_file('compiz-profile-active-Default.convert')
65 if os.path.exists(CONVERT_PATH + 'compiz-profile-unity.convert'):
66 migrate_file('compiz-profile-unity.convert')
67
68if __name__ == '__main__':
69 migrate_gconf_to_gsettings ()
700
=== removed file 'postinst/migration-scripts/03_migrate_profile_independent.py'
--- postinst/migration-scripts/03_migrate_profile_independent.py 2012-09-11 08:12:14 +0000
+++ postinst/migration-scripts/03_migrate_profile_independent.py 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3# Copyright (C) 2012 Canonical
4#
5# Authors:
6# Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>
7# Didier Roche <didrocks@ubuntu.com>
8#
9# This program is free software; you can redistribute it and/or modify it under
10# the terms of the GNU General Public License as published by the Free Software
11# Foundation; version 3.
12#
13# This program is distributed in the hope that it will be useful, but WITHOUTa
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16# details.
17#
18# You should have received a copy of the GNU General Public License along with
19# this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
22import gconf
23import glib
24import subprocess
25import os.path
26
27# this should point to the directory where all the .convert files are stored
28CONVERT_PATH = "/usr/lib/compiz/migration/"
29
30def migrate_file(convert_file):
31 subprocess.Popen(["gsettings-data-convert", "--file={}{}".format(CONVERT_PATH, convert_file)]).communicate()
32
33def migrate_gconf_to_gsettings():
34 client = gconf.client_get_default()
35
36 if not client:
37 print "WARNING: no gconf client found. No transitionning will be done"
38 sys.exit(1)
39
40 print "Will migrate profile independent keys"
41 migrate_file('compiz-profile-independent-keys.convert')
42
43if __name__ == '__main__':
44 migrate_gconf_to_gsettings ()

Subscribers

People subscribed via source and target branches