""", uuid,
)
- async def create(self, upload, distro=None):
+ async def create(self, upload, distro=None, commit=None):
"""
Creates a new package from an uploaded file
"""
suggests,
size,
supported_arches,
+ commit_id,
build_id,
build_host,
build_time,
(
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
- %s, %s, %s, %s, %s
+ %s, %s, %s, %s, %s, %s
)
RETURNING *""",
package.name,
package.suggests,
package.installsize,
[], # XXX supported arches
+ commit,
None, # package.build_id,
package.buildhost,
datetime.datetime.fromtimestamp(package.buildtime),
# Commit
- def get_commit(self):
+ @lazy_property
+ def commit(self):
if self.data.commit_id:
return self.backend.sources.get_commit_by_id(self.data.commit_id)
- def set_commit(self, commit):
- self._set_attribute("commit_id", commit.id)
-
- commit = lazy_property(get_commit, set_commit)
-
# Distro
@property
upload = await self.backend.uploads.create_from_local(file)
# Create the package
- # XXX reference the commit here?
- package = await self.backend.packages.create(upload)
+ package = await self.backend.packages.create(upload, commit=self.commit)
# Create a new build (without updating the repository immediately)
build = await self.backend.builds.create(