"""
Perform dependency check
"""
- log.info("Performing dependency check for %s" % self)
+ log.info("Performing dependency check for %s (%s)" % (self, self.uuid))
with self.db.transaction():
return await asyncio.to_thread(self._depcheck)
def _depcheck(self):
# Create a Pakfire instance
with self.pakfire() as p:
- # Try to install the source package
+ # Fetch the commandline repository
+ repo = p.get_repo("@commandline")
+
+ # Open the archive
+ archive = p.open(self.pkg.path)
+
+ # Fetch the package
+ package = archive.get_package(repo)
+
+ # Perform the installcheck
try:
- p.install([self.pkg.path], dryrun=True)
+ package.installcheck()
- # XXX Pakfire should throw a better exception
- except Exception as e:
+ # Store any dependency errors
+ except DependencyError as e:
self._set_attribute("depcheck_succeeded", False)
# Store the message
self._set_attribute("message", "%s" % e)
+ # Raise any other exceptions
+ except Exception as e:
+ raise e
+
# Everything OK
else:
self._set_attribute("depcheck_succeeded", True)