~xubuntu-dev/ubuntu-cdimage/xubuntu-base

« back to all changes in this revision

Viewing changes to lib/cdimage/project.py

  • Committer: Adam Conrad
  • Date: 2015-08-06 08:04:06 UTC
  • Revision ID: adconrad@0c3.net-20150806080406-altjtz2xv5tubg80
Tidy up ALL_PROJECTS a bit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2013 Canonical Ltd.
 
2
# Author: Colin Watson <cjwatson@ubuntu.com>
 
3
 
 
4
# This program is free software: you can redistribute it and/or modify
 
5
# it under the terms of the GNU General Public License as published by
 
6
# the Free Software Foundation; version 3 of the License.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 
 
16
"""Set project-specific environment variables."""
 
17
 
 
18
import os
 
19
 
 
20
 
 
21
# Be careful about the values here; in most cases they are passed to
 
22
# debian-cd, which will get upset if they contain a space, hence all the
 
23
# odd-looking hyphens.  ubuntu-zh_CN and ubuntu-touch-preview are exceptions
 
24
# to this, because they do not use debian-cd.
 
25
# For projects that use debian-cd, it will construct an ISO9660 volume ID
 
26
# as "$(CAPPROJECT) $(DEBVERSION) $(ARCH)", e.g. "Ubuntu 14.10 amd64"; for
 
27
# powerpc, $(ARCH) is abbreviated to "ppc".  The volume ID is limited to 32
 
28
# characters.  This therefore imposes a limit on the length of project_map
 
29
# values of 25 - (length of longest relevant architecture name).
 
30
project_map = {
 
31
    "ubuntu": "Ubuntu",
 
32
    "ubuntu-desktop-next": "Ubuntu-Desktop-Next",
 
33
    "ubuntu-zh_CN": "Ubuntu Chinese Edition",
 
34
    "kubuntu": "Kubuntu",
 
35
    "kubuntu-active": "Kubuntu-Active",
 
36
    "kubuntu-plasma5": "Kubuntu-Plasma-5",
 
37
    "edubuntu": "Edubuntu",
 
38
    "xubuntu": "Xubuntu",
 
39
    "gobuntu": "Gobuntu",
 
40
    "ubuntu-server": "Ubuntu-Server",
 
41
    "jeos": "Ubuntu-JeOS",
 
42
    "ubuntu-mid": "Ubuntu-MID",
 
43
    "ubuntu-netbook": "Ubuntu-Netbook",
 
44
    "ubuntu-headless": "Ubuntu-Headless",
 
45
    "ubuntustudio": "Ubuntu-Studio",
 
46
    "mythbuntu": "Mythbuntu",
 
47
    "lubuntu": "Lubuntu",
 
48
    "ubuntukylin": "Ubuntu-Kylin",
 
49
    "ubuntu-gnome": "Ubuntu-GNOME",
 
50
    "ubuntu-mate": "Ubuntu-MATE",
 
51
    "ubuntu-moblin-remix": "Ubuntu-Moblin-Remix",
 
52
    "livecd-base": "LiveCD-Base",
 
53
    "ubuntu-core": "Ubuntu-Core",
 
54
    "ubuntu-touch-preview": "Ubuntu Touch Preview",
 
55
    "ubuntu-touch": "Ubuntu Touch",
 
56
    "tocd3": "TheOpenCDv3",
 
57
    "tocd3.1": "TheOpenCDv3.1",
 
58
}
 
59
 
 
60
 
 
61
def setenv_for_project(project):
 
62
    full_project = project
 
63
    locale = os.environ.get("UBUNTU_DEFAULTS_LOCALE", None)
 
64
    if locale:
 
65
        full_project = "-".join([full_project, locale])
 
66
    if full_project not in project_map:
 
67
        return False
 
68
    os.environ["PROJECT"] = project
 
69
    os.environ["CAPPROJECT"] = project_map[full_project]
 
70
    return True