From aed1d59007702f0d9b7bff263c769e43a7f5082d Mon Sep 17 00:00:00 2001 From: Dominik Rumian Date: Jan 26 2022 11:55:15 +0000 Subject: Fix: *pkg now takes into account --path parameter while building SRPM Fixes fail during `*pkg --path build --srpm --scratch` command execution. The SRPM was correctly created but *pkg was unable to locate it when uploading to Koji. JIRA: RHELCMP-6875 Fixes: https://pagure.io/rpkg/issue/580 Signed-off-by: Dominik Rumian --- diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index da563b8..8efb841 100644 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -1872,6 +1872,7 @@ class cliClient(object): self.log.debug('Generating an srpm') self.srpm() self.args.srpm = '%s.src.rpm' % self.cmd.nvr + self.args.srpm = os.path.join(self.args.path, self.args.srpm) return self._upload_file_for_build(self.args.srpm) def _watch_build_tasks(self, task_ids): diff --git a/tests/test_cli.py b/tests/test_cli.py index e7545bf..0304a11 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -3519,7 +3519,8 @@ class TestBuildPackage(FakeKojiCreds, CliTestCase): srpm_file, unique_path = args if expected_srpm_file is None: - self.assertEqual('{0}.src.rpm'.format(cli.cmd.nvr), srpm_file) + self.assertEqual('{0}.src.rpm'.format(os.path.join(cli.cmd.path, cli.cmd.nvr)), + srpm_file) else: self.assertEqual(expected_srpm_file, srpm_file) six.assertRegex(self, unique_path, r'^cli-build/\d+\.\d+\.[a-zA-Z]+$')