Code review comment for lp:~smoser/curtin/merge-critical

Revision history for this message
Ryan Harper (raharper) wrote :

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.

% bzr diff curtin/commands/curthooks.py
=== modified file 'curtin/commands/curthooks.py'
--- curtin/commands/curthooks.py 2015-11-17 19:10:43 +0000
+++ curtin/commands/curthooks.py 2015-11-18 03:30:19 +0000
@@ -591,6 +591,12 @@
             'bridge-utils': ['bridge']},
     }

+ 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)

review: Needs Fixing

« Back to merge proposal