| |
@@ -545,18 +545,24 @@
|
| |
@patch('pyrpkg.Commands._run_command')
|
| |
def test_prep_with_options(self, _run_command):
|
| |
builddir = os.path.join(self.cloned_repo_path, 'builddir')
|
| |
+ buildrootdir = os.path.join(self.cloned_repo_path, 'buildrootdir')
|
| |
|
| |
- cli_cmd = ['rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6', '-q',
|
| |
- 'compile', '--arch', 'i686', '--builddir', builddir]
|
| |
+ cli_cmd = [
|
| |
+ 'rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6',
|
| |
+ '-q', 'compile', '--arch', 'i686', '--builddir', builddir,
|
| |
+ '--buildrootdir', buildrootdir
|
| |
+ ]
|
| |
|
| |
with patch('sys.argv', new=cli_cmd):
|
| |
cli = self.new_cli()
|
| |
cli.prep()
|
| |
|
| |
spec = os.path.join(cli.cmd.path, cli.cmd.spec)
|
| |
- rpmbuild = ['rpmbuild'] + cli.cmd.rpmdefines + \
|
| |
- ["--define '_builddir %s'" % builddir, '--target', 'i686', '--quiet', '--nodeps',
|
| |
- '-bp', spec]
|
| |
+ rpmbuild = ['rpmbuild'] + cli.cmd.rpmdefines + [
|
| |
+ "--define '_builddir %s'" % builddir, '--target', 'i686',
|
| |
+ '--quiet', "--define '_buildrootdir %s'" % buildrootdir,
|
| |
+ '--nodeps', '-bp', spec
|
| |
+ ]
|
| |
_run_command.assert_called_once_with(rpmbuild, shell=True)
|
| |
|
| |
|
| |
@@ -580,18 +586,25 @@
|
| |
@patch('pyrpkg.Commands._run_command')
|
| |
def test_install_with_options(self, _run_command):
|
| |
builddir = os.path.join(self.cloned_repo_path, 'builddir')
|
| |
+ buildrootdir = os.path.join(self.cloned_repo_path, 'buildrootdir')
|
| |
|
| |
- cli_cmd = ['rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6', '-q',
|
| |
- 'install', '--nocheck', '--arch', 'i686', '--builddir', builddir]
|
| |
+ cli_cmd = [
|
| |
+ 'rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6',
|
| |
+ '-q', 'install', '--nocheck', '--arch', 'i686',
|
| |
+ '--builddir', builddir, '--buildrootdir', buildrootdir
|
| |
+ ]
|
| |
|
| |
with patch('sys.argv', new=cli_cmd):
|
| |
cli = self.new_cli()
|
| |
cli.install()
|
| |
|
| |
spec = os.path.join(cli.cmd.path, cli.cmd.spec)
|
| |
- rpmbuild = ['rpmbuild'] + cli.cmd.rpmdefines + \
|
| |
- ["--define '_builddir %s'" % builddir, '--target', 'i686', '--nocheck', '--quiet',
|
| |
- '-bi', spec]
|
| |
+ rpmbuild = ['rpmbuild'] + cli.cmd.rpmdefines + [
|
| |
+ "--define '_builddir %s'" % builddir, '--target', 'i686',
|
| |
+ '--nocheck', '--quiet',
|
| |
+ "--define '_buildrootdir %s'" % buildrootdir,
|
| |
+ '-bi', spec
|
| |
+ ]
|
| |
|
| |
_run_command.assert_called_once_with(rpmbuild, shell=True)
|
| |
|
| |
@@ -619,18 +632,25 @@
|
| |
@patch('pyrpkg.subprocess.check_call')
|
| |
def test_local_with_options(self, check_call):
|
| |
builddir = os.path.join(self.cloned_repo_path, 'this-builddir')
|
| |
+ buildrootdir = os.path.join(self.cloned_repo_path, 'this-buildrootdir')
|
| |
|
| |
- cli_cmd = ['rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6', '-q', 'local',
|
| |
- '--builddir', builddir, '--arch', 'i686', '--with', 'a', '--without', 'b']
|
| |
+ cli_cmd = [
|
| |
+ 'rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6',
|
| |
+ '-q', 'local', '--builddir', builddir, '--arch', 'i686',
|
| |
+ '--with', 'a', '--without', 'b', '--buildrootdir', buildrootdir]
|
| |
|
| |
with patch('sys.argv', new=cli_cmd):
|
| |
cli = self.new_cli()
|
| |
cli.local()
|
| |
|
| |
spec = os.path.join(cli.cmd.path, cli.cmd.spec)
|
| |
- rpmbuild = ['rpmbuild'] + cli.cmd.rpmdefines + \
|
| |
- ['--with', 'a', '--without', 'b', "--define '_builddir %s'" % builddir,
|
| |
- '--target', 'i686', '--quiet', '-ba', spec]
|
| |
+ rpmbuild = ['rpmbuild'] + cli.cmd.rpmdefines + [
|
| |
+ '--with', 'a', '--without', 'b',
|
| |
+ "--define '_builddir %s'" % builddir,
|
| |
+ '--target', 'i686', '--quiet',
|
| |
+ "--define '_buildrootdir %s'" % buildrootdir,
|
| |
+ '-ba', spec
|
| |
+ ]
|
| |
tee = ['tee', '.build-%s-%s.log' % (cli.cmd.ver, cli.cmd.rel)]
|
| |
|
| |
cmd = '%s | %s; exit "${PIPESTATUS[0]} ${pipestatus[1]}"' % (
|
| |
@@ -659,17 +679,24 @@
|
| |
@patch('pyrpkg.Commands._run_command')
|
| |
def test_verify_files_with_options(self, _run_command):
|
| |
builddir = os.path.join(self.cloned_repo_path, 'this-builddir')
|
| |
+ buildrootdir = os.path.join(self.cloned_repo_path, 'this-buildrootdir')
|
| |
|
| |
- cli_cmd = ['rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6', '-q',
|
| |
- 'verify-files', '--builddir', builddir]
|
| |
+ cli_cmd = [
|
| |
+ 'rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6',
|
| |
+ '-q', 'verify-files', '--builddir', builddir,
|
| |
+ '--buildrootdir', buildrootdir
|
| |
+ ]
|
| |
|
| |
with patch('sys.argv', new=cli_cmd):
|
| |
cli = self.new_cli()
|
| |
cli.verify_files()
|
| |
|
| |
spec = os.path.join(cli.cmd.path, cli.cmd.spec)
|
| |
- rpmbuild = ['rpmbuild'] + cli.cmd.rpmdefines + \
|
| |
- ["--define '_builddir %s'" % builddir, '--quiet', '-bl', spec]
|
| |
+ rpmbuild = ['rpmbuild'] + cli.cmd.rpmdefines + [
|
| |
+ "--define '_builddir %s'" % builddir,
|
| |
+ "--define '_buildrootdir %s'" % buildrootdir,
|
| |
+ '--quiet', '-bl', spec
|
| |
+ ]
|
| |
_run_command.assert_called_once_with(rpmbuild, shell=True)
|
| |
|
| |
|
| |
This new option is for command local, prep, install and verify-files to
allow not to assemble the rpm in ~/rpmbuild/BUILDROOT/.
Resolves: rhbz#1583822
Signed-off-by: Chenxiong Qi cqi@redhat.com
Fixes #324