~jocave/snapcraft/plainbox-provider-plugin

« back to all changes in this revision

Viewing changes to snapcraft/plugin.py

  • Committer: Snappy Tarmac
  • Author(s): Michael Terry
  • Date: 2015-07-10 16:01:36 UTC
  • mfrom: (71.2.2 lifecycle-fixes2)
  • Revision ID: snappy_tarmac-20150710160136-wd4yjn8f8ye5aisv
Add collision detection before staging, fix ordering of parts to be more reliable, and only export the environment of dependent parts when building each part. by mterry approved by rsalveti

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
        self.code = None
31
31
        self.config = None
32
32
        self.partNames = []
 
33
        self.deps = []
33
34
 
34
35
        self.sourcedir = os.path.join(os.getcwd(), "parts", partName, "src")
35
36
        self.builddir = os.path.join(os.getcwd(), "parts", partName, "build")
73
74
        self.partNames.append(partName)
74
75
        self.valid = True
75
76
 
 
77
    def __str__(self):
 
78
        return self.partNames[0]
 
79
 
 
80
    def __repr__(self):
 
81
        return self.partNames[0]
 
82
 
76
83
    def makedirs(self):
77
84
        try:
78
85
            os.makedirs(self.sourcedir)
151
158
        if not self.code:
152
159
            return True
153
160
 
154
 
        # FIXME: First check to make sure there are no conflicts
155
 
 
156
161
        self.notifyStage("Staging")
157
162
        snapcraft.common.run(['cp', '-arT', self.installdir, self.stagedir])
158
163
        self.markDone('stage')