Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/commands/common.py
blob: ac39dafa83d69877eccf22640edf7e93bb3a2173 (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
import os
import sys

base_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

sys.path.append(base_dir)

from devbot import config
from devbot import command
from devbot import git


def setup(log_name=None):
    git.set_root_path(base_dir)

    args = {"config_dir": os.path.join(base_dir, "config"),
            "install_dir": os.path.join(base_dir, "install"),
            "source_dir": os.path.join(base_dir, "source"),
            "build_dir": os.path.join(base_dir, "build"),
            "state_dir": os.path.join(base_dir, "state"),
            "prefs_path": os.path.join(base_dir, "prefs"),
            "logs_dir": os.path.join(base_dir, "logs")}

    if log_name:
        args["log_name"] = log_name

    if "SUGAR_BUILDBOT" in os.environ:
        args["relocatable"] = True

    config.setup(**args)