Skip to content

Commit

Permalink
Use --config instead of -c for DNF and Micro DNF
Browse files Browse the repository at this point in the history
The -c option is not supported in Micro DNF, but --config is, and
it is supported with DNF as well.
  • Loading branch information
Conan-Kudo committed Nov 13, 2020
1 parent e811d79 commit a0912d5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion kiwi/repository/dnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def post_init(self, custom_args=None):
)

self.dnf_args = [
'-c', self.runtime_dnf_config_file.name, '-y'
'--config', self.runtime_dnf_config_file.name, '-y'
] + self.custom_args

self.command_env = self._create_dnf_runtime_environment()
Expand Down
16 changes: 8 additions & 8 deletions test/unit/package_manager/dnf_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def setup(self):

repository.runtime_config = mock.Mock(
return_value={
'dnf_args': ['-c', '/root-dir/dnf.conf', '-y'],
'dnf_args': ['--config', '/root-dir/dnf.conf', '-y'],
'command_env': ['env']
}
)
Expand Down Expand Up @@ -43,14 +43,14 @@ def test_process_install_requests_bootstrap(self, mock_run, mock_call):
self.manager.request_collection('collection')
self.manager.process_install_requests_bootstrap()
mock_run.assert_called_once_with(
['dnf', '-c', '/root-dir/dnf.conf', '-y', 'makecache']
['dnf', '--config', '/root-dir/dnf.conf', '-y', 'makecache']
)
mock_call.assert_called_once_with(
[
'bash', '-c',
'dnf -c /root-dir/dnf.conf -y '
'dnf --config /root-dir/dnf.conf -y '
'--installroot /root-dir install vim && '
'dnf -c /root-dir/dnf.conf -y '
'dnf --config /root-dir/dnf.conf -y '
'--installroot /root-dir group install '
'"collection"'
], ['env']
Expand All @@ -65,9 +65,9 @@ def test_process_install_requests(self, mock_call):
mock_call.assert_called_once_with(
[
'bash', '-c',
'chroot /root-dir dnf -c /dnf.conf -y '
'chroot /root-dir dnf --config /dnf.conf -y '
'--exclude=skipme install vim && '
'chroot /root-dir dnf -c /dnf.conf -y '
'chroot /root-dir dnf --config /dnf.conf -y '
'--exclude=skipme group install '
'"collection"'
], ['env']
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_process_delete_requests_no_force(self, mock_run, mock_call):
mock_call.assert_called_once_with(
[
'chroot', '/root-dir', 'dnf',
'-c', '/dnf.conf', '-y', 'autoremove', 'vim'
'--config', '/dnf.conf', '-y', 'autoremove', 'vim'
],
['env']
)
Expand All @@ -120,7 +120,7 @@ def test_update(self, mock_call):
mock_call.assert_called_once_with(
[
'chroot', '/root-dir', 'dnf',
'-c', '/dnf.conf', '-y', 'upgrade'
'--config', '/dnf.conf', '-y', 'upgrade'
], ['env']
)

Expand Down
10 changes: 5 additions & 5 deletions test/unit/package_manager/microdnf_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def setup(self):

repository.runtime_config = mock.Mock(
return_value={
'dnf_args': ['-c', '/root-dir/dnf.conf', '-y'],
'dnf_args': ['--config', '/root-dir/dnf.conf', '-y'],
'command_env': ['env']
}
)
Expand Down Expand Up @@ -45,7 +45,7 @@ def test_process_install_requests_bootstrap(self, mock_run, mock_call):
mock_call.assert_called_once_with(
[
'bash', '-c',
'microdnf --refresh -c /root-dir/dnf.conf -y '
'microdnf --refresh --config /root-dir/dnf.conf -y '
'--installroot /root-dir install vim'
], ['env']
)
Expand All @@ -59,7 +59,7 @@ def test_process_install_requests(self, mock_call):
mock_call.assert_called_once_with(
[
'bash', '-c',
'chroot /root-dir microdnf -c /dnf.conf -y '
'chroot /root-dir microdnf --config /dnf.conf -y '
'--exclude=skipme install vim'
], ['env']
)
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_process_delete_requests_no_force(self, mock_run, mock_call):
mock_call.assert_called_once_with(
[
'chroot', '/root-dir', 'microdnf',
'-c', '/dnf.conf', '-y', 'remove', 'vim'
'--config', '/dnf.conf', '-y', 'remove', 'vim'
],
['env']
)
Expand All @@ -111,7 +111,7 @@ def test_update(self, mock_call):
mock_call.assert_called_once_with(
[
'chroot', '/root-dir', 'microdnf',
'-c', '/dnf.conf', '-y', 'upgrade'
'--config', '/dnf.conf', '-y', 'upgrade'
], ['env']
)

Expand Down

0 comments on commit a0912d5

Please sign in to comment.