Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/systeminstall.py
blob: 53127c9cfb261a2f663e5d03e94565372d4bc468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 S. Daniel Francis <francis@sugarlabs.org>
#
# 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; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT 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.

import sys
import os
import pwd
sys.path.append(os.path.abspath('./'))
os.environ['INFO_L10N'] = '0'
import info
user = pwd.getpwuid(os.getuid()).pw_name

if user == 'root':
    os.system('cp makescripts/command.py /usr/bin/%s' % info.lower_name)
    try:
        os.mkdir('/usr/share/%s' % info.lower_name)
        os.mkdir('/usr/share/%s/icons' % info.lower_name)
    except:
        pass
    os.system('cp -R desktop/sweetener /usr/share/%s/sweetener' %\
                  info.lower_name)
    os.system('cp data/* /usr/share/%s/' % info.lower_name)
    os.system('cp *.py /usr/share/%s/' % info.lower_name)
    os.system('cp desktop/icons/*.svg /usr/share/%s/icons' %\
                  info.lower_name)
    os.system('cp %s.png /usr/share/%s/' % (info.lower_name,
                                                 info.lower_name))
    for i in os.listdir('locale'):
        if not os.path.exists(os.path.join('/usr/share/locale', i)):
            os.mkdir(os.path.join('/usr/share/locale', i))
        if not os.path.exists(os.path.join('/usr/share/locale', i,
                                           'LC_MESSAGES')):
            os.mkdir(os.path.join('/usr/share/locale', i,
                                           'LC_MESSAGES'))
        os.system(
   'cp locale/%n%/LC_MESSAGES/*.mo /usr/share/locale/%n%/LC_MESSAGES/'.replace(
                '%n%', i))