We're not installing filesystem deps in-target anymore (xfs_info not found):
Ideally the per-config dict of package mapping to config types is
what the deps/ stuff should be using; the fstype needs to check a second value
in the config to determine which filesystem was used.
Additionally, the current deps/__init__.py:install_deps doesn't expose target
which is available in the underlying util.install_packages, so in curthooks where
we really want to re-use deps.install_deps(), we want to pass it in target and
the custom config.
But the following allows test_mdadm_bcache.py to pass now.
+ format_configs = {
+ 'xfsprogs': ['xfs'],
+ 'e2fsprogs': ['ext2', 'ext3', 'ext4'],
+ 'brtfs-tools': ['btrfs'],
+ }
+
needed_packages = []
installed_packages = get_installed_packages(target)
for cust_cfg, pkg_reqs in custom_configs.items():
@@ -606,6 +612,15 @@
pkg not in installed_packages: needed_packages.append(pkg)
+ format_types = set(
+ [operation['fstype']
+ for operation in cfg[cust_cfg]['config']
+ if operation['type'] == 'format'])
+ for pkg, fstypes in format_configs.items():
+ if set(fstypes).intersection(format_types) and \
+ pkg not in installed_packages:
+ needed_packages.append(pkg)
+
if needed_packages: util.install_packages(needed_packages, target=target)
We're not installing filesystem deps in-target anymore (xfs_info not found):
Ideally the per-config dict of package mapping to config types is
what the deps/ stuff should be using; the fstype needs to check a second value
in the config to determine which filesystem was used.
Additionally, the current deps/__ init__. py:install_ deps doesn't expose target packages, so in curthooks where deps(), we want to pass it in target and
which is available in the underlying util.install_
we really want to re-use deps.install_
the custom config.
But the following allows test_mdadm_ bcache. py to pass now.
% bzr diff curtin/ commands/ curthooks. py commands/ curthooks. py' commands/ curthooks. py 2015-11-17 19:10:43 +0000 commands/ curthooks. py 2015-11-18 03:30:19 +0000
' bridge- utils': ['bridge']},
=== modified file 'curtin/
--- curtin/
+++ curtin/
@@ -591,6 +591,12 @@
}
+ format_configs = { packages = [] packages = get_installed_ packages( target) configs. items() :
needed_ packages. append( pkg)
+ 'xfsprogs': ['xfs'],
+ 'e2fsprogs': ['ext2', 'ext3', 'ext4'],
+ 'brtfs-tools': ['btrfs'],
+ }
+
needed_
installed_
for cust_cfg, pkg_reqs in custom_
@@ -606,6 +612,15 @@
pkg not in installed_packages:
+ format_types = set( 'fstype' ] cfg]['config' ] configs. items() : .intersection( format_ types) and \ packages. append( pkg)
util. install_ packages( needed_ packages, target=target)
+ [operation[
+ for operation in cfg[cust_
+ if operation['type'] == 'format'])
+ for pkg, fstypes in format_
+ if set(fstypes)
+ pkg not in installed_packages:
+ needed_
+
if needed_packages: