Пример #1
0
 def _build_rpm(self, path_to_specfile):
     """
     Build single srpm with mock.
     """
     path_to_srpm = self.make_srpm(path_to_specfile)
     srpm = os.path.basename(path_to_srpm)
     logger.info("Starting build of {0}".format(srpm))
     with open("/dev/null", "w") as devnull:
         code = subprocess.call(
             [
                 "mock",
                 "-r",
                 self.mock_config.name,
                 "--configdir",
                 self.mock_config.config_dir,
                 "--resultdir",
                 self.mock_config.result_dir,
                 path_to_srpm,
             ],
             stdout=devnull,
             stderr=devnull,
         )
     if not code:
         logger.info("Package {0} was built successfully".format(srpm))
         createrepo(self.mock_config.result_dir)
         logger.info("Updating repository")
     else:
         logger.info("{0} build failed".format(srpm))
     rename_logs(path_to_srpm, self.mock_config.result_dir)
     return code
Пример #2
0
 def mock_config(self):
     if not hasattr(self, '_mock_config'):
         self._mock_config = cfg.prepare(self.config_name, self.local_scl)
         createrepo(self._mock_config.result_dir)
         logger.info('Creating repo at {0}'.format(
             self._mock_config.result_dir))
     return self._mock_config
Пример #3
0
 def _build_rpm(self, path_to_specfile):
     """
     Build single srpm with mock.
     """
     path_to_srpm = self.make_srpm(path_to_specfile)
     srpm = os.path.basename(path_to_srpm)
     logger.info('Starting build of {0}'.format(srpm))
     with open('/dev/null', 'w') as devnull:
         code = subprocess.call([
             'mock', '-r', self.mock_config.name, '--configdir',
             self.mock_config.config_dir, '--resultdir',
             self.mock_config.result_dir, path_to_srpm
         ],
                                stdout=devnull,
                                stderr=devnull)
     if not code:
         logger.info('Package {0} was built successfully'.format(srpm))
         createrepo(self.mock_config.result_dir)
         logger.info('Updating repository')
     else:
         logger.info('{0} build failed'.format(srpm))
     rename_logs(path_to_srpm, self.mock_config.result_dir)
     return code
Пример #4
0
 def mock_config(self):
     if not hasattr(self, "_mock_config"):
         self._mock_config = cfg.prepare(self.config_name, self.local_scl)
         createrepo(self._mock_config.result_dir)
         logger.info("Creating repo at {0}".format(self._mock_config.result_dir))
     return self._mock_config