1
# Copyright (C) 2013 Canonical Ltd.
2
# Author: Colin Watson <cjwatson@ubuntu.com>
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.
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.
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/>.
16
"""Set project-specific environment variables."""
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).
32
"ubuntu-desktop-next": "Ubuntu-Desktop-Next",
33
"ubuntu-zh_CN": "Ubuntu Chinese Edition",
35
"kubuntu-active": "Kubuntu-Active",
36
"kubuntu-plasma5": "Kubuntu-Plasma-5",
37
"edubuntu": "Edubuntu",
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",
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",
61
def setenv_for_project(project):
62
full_project = project
63
locale = os.environ.get("UBUNTU_DEFAULTS_LOCALE", None)
65
full_project = "-".join([full_project, locale])
66
if full_project not in project_map:
68
os.environ["PROJECT"] = project
69
os.environ["CAPPROJECT"] = project_map[full_project]