diff --git a/bundles/apt/items.py b/bundles/apt/items.py index 497ece9..e388aaf 100644 --- a/bundles/apt/items.py +++ b/bundles/apt/items.py @@ -70,5 +70,16 @@ for host, sources in hosts.items(): } -for package, options in node.metadata.get('apt/packages', {}).items(): +for package, options in node.metadata.get('apt/packages', {}).items(): pkg_apt[package] = options + + if options.get('backports', None): + pkg_apt[package].pop('backports') + + files[f'/etc/apt/preferences.d/{package}'] = { + 'content': '\n'.join([ + f"Package: {package}", + f"Pin: release a={node.metadata.get('os_release')}-backports", + f"Pin-Priority: 900", + ]), + } diff --git a/bundles/zfs/metadata.py b/bundles/zfs/metadata.py index b7a24de..eae1f17 100644 --- a/bundles/zfs/metadata.py +++ b/bundles/zfs/metadata.py @@ -15,12 +15,14 @@ defaults = { }, }, 'zfs-dkms': { + 'backports': True, 'needed_by': { 'pkg_apt:zfs-zed', 'pkg_apt:zfsutils-linux', }, }, 'zfs-zed': { + 'backports': True, 'needed_by': { 'zfs_dataset:', 'zfs_pool:',