Skip to content

Commit

Permalink
Merge pull request #2603 from OSInside/fix_default_excludes
Browse files Browse the repository at this point in the history
Do not exclude the .profile env file by default
  • Loading branch information
Conan-Kudo authored Jul 30, 2024
2 parents b24a461 + e86e542 commit a779548
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion kiwi/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def get_exclude_list_for_root_data_sync(no_tmpdirs: bool = True):
:rtype: list
"""
exclude_list = [
'image', '.profile', '.kconfig'
'image', '.kconfig'
]
if no_tmpdirs:
exclude_list += ['run/*', 'tmp/*']
Expand Down
4 changes: 2 additions & 2 deletions test/unit/builder/archive_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_create_tar(self, mock_tar):
)
archive.create_xz_compressed.assert_called_once_with(
'root_dir', exclude=[
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi'
], xz_options=None
)
Expand All @@ -89,7 +89,7 @@ def test_create_cpio(self, mock_cpio):
)
archive.create.assert_called_once_with(
'root_dir', exclude=[
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi'
]
)
Expand Down
10 changes: 5 additions & 5 deletions test/unit/builder/disk_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def test_create_disk_standard_root_with_kiwi_initrd(
call = filesystem.sync_data.call_args_list[0]
assert filesystem.sync_data.call_args_list[0] == \
call([
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi', 'boot/*', 'boot/.*',
'boot/efi/*', 'boot/efi/.*'
])
Expand Down Expand Up @@ -803,7 +803,7 @@ def test_create_disk_standard_root_with_dracut_initrd(

assert filesystem.__enter__.return_value \
.sync_data.call_args_list[2] == call([
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi', 'boot/*', 'boot/.*',
'boot/efi/*', 'boot/efi/.*'
])
Expand Down Expand Up @@ -963,7 +963,7 @@ def test_create_disk_standard_root_is_overlay(
assert squashfs.create_on_file.call_args_list == [
call(exclude=['var/cache/kiwi'], filename='kiwi-tempname'),
call(exclude=[
'.profile', '.kconfig', 'run/*', 'tmp/*',
'.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi',
'boot/*', 'boot/.*', 'boot/efi/*', 'boot/efi/.*', 'image/*'
], filename='kiwi-tempname')
Expand Down Expand Up @@ -1453,7 +1453,7 @@ def test_create_disk_volume_managed_root(
]
volume_manager.sync_data.assert_called_once_with(
[
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi',
'boot/*', 'boot/.*', 'boot/efi/*', 'boot/efi/.*'
]
Expand Down Expand Up @@ -1609,7 +1609,7 @@ def test_create_disk_spare_part_requested(
)
assert filesystem.sync_data.call_args_list.pop() == call(
[
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi', 'var/*', 'var/.*',
'boot/*', 'boot/.*', 'boot/efi/*', 'boot/efi/.*'
]
Expand Down
4 changes: 2 additions & 2 deletions test/unit/builder/filesystem_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_create_on_loop(
)
self.filesystem.create_on_device.assert_called_once_with(None)
self.filesystem.sync_data.assert_called_once_with([
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi'
])
self.setup.export_package_verification.assert_called_once_with(
Expand Down Expand Up @@ -153,7 +153,7 @@ def test_create_on_file(
self.filesystem.create_on_file.assert_called_once_with(
'target_dir/myimage.x86_64-1.2.3.squashfs', None,
[
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi'
]
)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/builder/live_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def side_effect():

filesystem.create_on_device.assert_called_once_with()
filesystem.sync_data.assert_called_once_with([
'image', '.profile', '.kconfig',
'image', '.kconfig',
'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi'
])

Expand Down
4 changes: 2 additions & 2 deletions test/unit/container/oci_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def test_create_oci_archive(self, mock_Compress, mock_cache, mock_OCI):
mock_oci.unpack.assert_called_once_with()
mock_oci.sync_rootfs.assert_called_once_with(
'root_dir', [
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi', 'dev/*', 'sys/*', 'proc/*'
]
)
Expand Down Expand Up @@ -199,7 +199,7 @@ def test_create_derived_docker_archive(
mock_oci.unpack.assert_called_once_with()
mock_oci.sync_rootfs.assert_called_once_with(
'root_dir', [
'image', '.profile', '.kconfig', 'run/*', 'tmp/*',
'image', '.kconfig', 'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi', 'dev/*', 'sys/*', 'proc/*'
]
)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/defaults_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ def test_get_exclude_list_from_custom_exclude_files_is_invalid(

def test_get_exclude_list_for_root_data_sync(self):
assert Defaults.get_exclude_list_for_root_data_sync() == [
'image', '.profile', '.kconfig',
'image', '.kconfig',
'run/*', 'tmp/*',
'.buildenv', 'var/cache/kiwi'
]
assert Defaults.get_exclude_list_for_root_data_sync(no_tmpdirs=False) == [
'image', '.profile', '.kconfig',
'image', '.kconfig',
'.buildenv', 'var/cache/kiwi'
]

Expand Down

0 comments on commit a779548

Please sign in to comment.