Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/commands/check-system
blob: 6d14978306a8348ce9d21b9f1a65eebda70e1d46 (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
#!/usr/bin/python -u

import argparse
import os

import common

from devbot import system
from devbot import config
from devbot import distro

common.setup()

parser = argparse.ArgumentParser(description='Check the system')
parser.add_argument("--update", action="store_true",
                    help="first of all update the system")
parser.add_argument("--remove", action="store_true",
                    help="remove all the unnecessary packages")
parser.add_argument("--test", action="store_true",
                    help="don't add or remove packages, test only")
args = parser.parse_args()

def apply_ubuntu_tweaks():
    wrapper_config = open("/etc/X11/Xwrapper.config").read()
    if "allowed_users=anybody" not in wrapper_config:
        print "\nWe are going to allow anybody to run the X server"

        ubuntu_tweaks = os.path.join(config.commands_dir,
                                     "helpers", "ubuntu-tweaks")

        command.run_with_sudo([ubuntu_tweaks])

if distro.get_distro_name() == "ubuntu":
    apply_ubuntu_tweaks()

interactive = "SUGAR_BUILDBOT" not in os.environ

system.check(update=args.update,
             remove=args.remove,
             test=args.test,
             interactive=interactive)