return build
- async def create_from_source_package(self, filename, distro, commit=None, type="release",
- arches=None, check_for_duplicates=True, owner=None):
- assert distro
-
- # Open the package file to read some basic information.
- pkg = pakfire.packages.open(None, None, filename)
-
- if check_for_duplicates:
- if distro.has_package(pkg.name, pkg.epoch, pkg.version, pkg.release):
- log.warning("Duplicate package detected: %s. Skipping." % pkg)
- return
-
- # Open the package and add it to the database
- pkg = await self.backend.packages.create(filename)
-
- # Associate the package to the processed commit
- if commit:
- pkg.commit = commit
-
- # Create a new build object from the package
- build = self.create(pkg, type=type, owner=owner, distro=distro)
-
- if commit:
- # Import any fixed bugs
- for bug in commit.fixed_bugs:
- build.add_bug(bug)
-
- # Upvote the build for the testers
- for tester in commit.testers:
- build.upvote(tester)
-
- # Create all automatic jobs
- build.create_autojobs(arches=arches)
-
- return build
-
# Comments
@lazy_property