From 255a498f50604b0cbd7abf223d3cd459f59fdbe9 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Sun, 9 Jan 2022 23:51:55 +0100 Subject: [PATCH] Omit empty options in source.list template to fix MODULES-11174 Empty `[name= ...]` options in a soures list lead to Apt parsing errors. This change skips such empty options, resolving https://tickets.puppetlabs.com/browse/MODULES-11174. --- templates/source.list.epp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/source.list.epp b/templates/source.list.epp index 5924c8f84c..2b8dd6e57d 100644 --- a/templates/source.list.epp +++ b/templates/source.list.epp @@ -1,8 +1,8 @@ <%- | String $comment, Hash $includes, Hash $options, $location, $release, String $repos | -%> # <%= $comment %> <%- if $includes['deb'] { -%> -deb <% if !$options.empty() { -%>[<%= $options.map |$key, $value| { "${key}=${value}" }.join(" ") %>] <% } -%> <%= $location %> <%= $release %> <%= $repos %> +deb <% if !$options.empty() { -%>[<%= $options.map |$key, $value| { if !$value.empty() { "${key}=${value}" } }.join(" ") %>] <% } -%> <%= $location %> <%= $release %> <%= $repos %> <%- } -%> <%- if $includes['src'] { -%> -deb-src <% if !$options.empty() { -%>[<%= $options.map |$key, $value| { "${key}=${value}" }.join(" ") %>] <% } -%> <%= $location %> <%= $release %> <%= $repos %> +deb-src <% if !$options.empty() { -%>[<%= $options.map |$key, $value| { if !$value.empty() { "${key}=${value}" } }.join(" ") %>] <% } -%> <%= $location %> <%= $release %> <%= $repos %> <%- } -%>