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

« back to all changes in this revision

Viewing changes to lib/cdimage/germinate.py

  • Committer: Sean Davis
  • Date: 2018-03-28 10:32:07 UTC
  • mfrom: (1559.1.156 ubuntu-cdimage)
  • Revision ID: smd.seandavis@gmail.com-20180328103207-o6s9d6h0hxxh8eqc
Merge lp:ubuntu-cdimage rev 1715

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
 
42
42
class Germination:
43
 
    def __init__(self, config, prefer_bzr=True):
 
43
    def __init__(self, config, prefer_vcs=True):
44
44
        self.config = config
45
45
        # Set to False to use old-style seed checkouts.
46
 
        self.prefer_bzr = prefer_bzr
 
46
        self.prefer_vcs = prefer_vcs
47
47
 
48
48
    @property
49
49
    def germinate_path(self):
67
67
    def seed_sources(self, project):
68
68
        if self.config["LOCAL_SEEDS"]:
69
69
            return [self.config["LOCAL_SEEDS"]]
70
 
        elif self.prefer_bzr:
71
 
            pattern = "http://bazaar.launchpad.net/~%s/ubuntu-seeds/"
 
70
        elif self.prefer_vcs:
 
71
            bzrpattern = "http://bazaar.launchpad.net/~%s/ubuntu-seeds/"
 
72
            gitpattern = "https://git.launchpad.net/~%s/ubuntu-seeds/+git/"
72
73
            series = self.config["DIST"]
73
 
            sources = [pattern % "ubuntu-core-dev"]
 
74
            sources = [bzrpattern % "ubuntu-core-dev"]
74
75
            if project in ("kubuntu", "kubuntu-active", "kubuntu-plasma5"):
75
76
                if series >= "oneiric":
76
 
                    sources.insert(0, pattern % "kubuntu-dev")
 
77
                    sources.insert(0, bzrpattern % "kubuntu-dev")
77
78
            elif project == "ubuntustudio":
78
 
                sources.insert(0, pattern % "ubuntustudio-dev")
 
79
                sources.insert(0, bzrpattern % "ubuntustudio-dev")
79
80
            elif project == "mythbuntu":
80
 
                sources.insert(0, pattern % "mythbuntu-dev")
 
81
                sources.insert(0, bzrpattern % "mythbuntu-dev")
81
82
            elif project in ("xubuntu", "xubuntu-base"):
82
83
                if series >= "intrepid":
83
 
                    sources.insert(0, pattern % "xubuntu-dev")
84
 
            elif project == "lubuntu":
85
 
                sources.insert(0, pattern % "lubuntu-dev")
 
84
                    sources.insert(0, bzrpattern % "xubuntu-dev")
 
85
            elif project in ("lubuntu", "lubuntu-next"):
 
86
                sources.insert(0, gitpattern % "lubuntu-dev")
86
87
            elif project == "ubuntu-gnome":
87
 
                sources.insert(0, pattern % "ubuntu-gnome-dev")
 
88
                sources.insert(0, bzrpattern % "ubuntu-gnome-dev")
 
89
            elif project == "ubuntu-budgie":
 
90
                sources.insert(0, bzrpattern % "ubuntubudgie-dev")
88
91
            elif project == "ubuntu-mate":
89
 
                sources.insert(0, pattern % "ubuntu-mate-dev")
 
92
                sources.insert(0, bzrpattern % "ubuntu-mate-dev")
90
93
            elif project == "ubuntu-moblin-remix":
91
 
                sources.insert(0, pattern % "moblin")
 
94
                sources.insert(0, bzrpattern % "moblin")
92
95
            elif project == "ubuntukylin":
93
96
                if series >= "utopic":
94
 
                    sources.insert(0, pattern % "ubuntukylin-members")
 
97
                    sources.insert(0, bzrpattern % "ubuntukylin-members")
95
98
            return sources
96
99
        else:
97
100
            return ["http://people.canonical.com/~ubuntu-archive/seeds/"]
98
101
 
99
102
    @property
100
 
    def use_bzr(self):
 
103
    def use_vcs(self):
101
104
        if self.config["LOCAL_SEEDS"]:
102
105
            # Local changes may well not be committed.
103
106
            return False
104
107
        else:
105
 
            return self.prefer_bzr
 
108
            return self.prefer_vcs
106
109
 
107
110
    def make_index(self, project, arch, rel_target, rel_paths):
108
111
        target = os.path.join(self.output_dir(project), rel_target)
147
150
            return "moblin.%s" % self.config.series
148
151
        elif project == "ubuntu-desktop-next":
149
152
            return "ubuntu-touch.%s" % self.config.series
 
153
        elif project == "lubuntu-next":
 
154
            return "lubuntu.%s" % self.config.series
150
155
        else:
151
156
            return "%s.%s" % (project, self.config.series)
152
157
 
196
201
            "--components", "main",
197
202
            "--no-rdepends",
198
203
        ]
199
 
        if self.use_bzr:
200
 
            command.append("--bzr")
 
204
        if self.use_vcs:
 
205
            command.append("--vcs=auto")
 
206
        if self.config.image_type == "source":
 
207
            command.append("--always-follow-build-depends")
201
208
        proxy_check_call(
202
 
            self.config, "germinate", command, cwd=arch_output_dir)
 
209
            self.config, "germinate", command, cwd=arch_output_dir,
 
210
            env=dict(os.environ, GIT_TERMINAL_PROMPT="0"))
203
211
        output_structure = os.path.join(self.output_dir(project), "STRUCTURE")
204
212
        shutil.copy2(
205
213
            os.path.join(arch_output_dir, "structure"), output_structure)
355
363
        elif mode == "ship-live":
356
364
            if project == "kubuntu-active":
357
365
                yield "ship-active-live"
 
366
            elif project == "lubuntu" and series >= "artful":
 
367
                yield "ship-live-gtk"
 
368
                yield "ship-live-share"
 
369
            elif project == "lubuntu-next" and series >= "artful":
 
370
                yield "ship-live-qt"
 
371
                yield "ship-live-share"
358
372
            else:
359
373
                if series >= "dapper":
360
374
                    yield "ship-live"
383
397
                elif project == "ubuntustudio" and series >= "precise":
384
398
                    # no inheritance; most of this goes on the live filesystem
385
399
                    yield "dvd"
 
400
                    if series >= "artful":
 
401
                        yield "ship-live"
386
402
                else:
387
403
                    for seed in self._inheritance("dvd"):
388
404
                        yield seed