File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 310310 $_release = $release
311311 }
312312
313- if $repos !~ Array {
313+ # The deb822 format requires that if the Suite ($release) is a path (contains a /) that
314+ # the Components field be absent. Check the original
315+ $_releasefilter = $_release.any |$item | { $item .index(' /' ) != undef }
316+ if $_releasefilter {
317+ $_repos = undef
318+ } elsif $repos !~ Array {
314319 warning (" For deb822 sources, 'repos' must be specified as an array. Converting to array." )
315320 $_repos = split($repos , /\s+/)
316321 } else {
Original file line number Diff line number Diff line change 480480 it { is_expected . to contain_apt__setting ( "sources-#{ title } " ) . with_content ( %r{Trusted: yes} ) }
481481 end
482482
483+ context 'path based deb822 source' do
484+ let :params do
485+ super ( ) . merge (
486+ {
487+ location : [ 'http://fr.debian.org/debian' , 'http://de.debian.org/debian' ] ,
488+ release : [ './' ] ,
489+ allow_unsigned : true ,
490+ } ,
491+ )
492+ end
493+
494+ it { is_expected . to contain_apt__setting ( "sources-#{ title } " ) . with_content ( %r{Enabled: yes} ) }
495+ it { is_expected . to contain_apt__setting ( "sources-#{ title } " ) . with_content ( %r{URIs: http://fr.debian.org/debian http://de.debian.org/debian} ) }
496+ it { is_expected . to contain_apt__setting ( "sources-#{ title } " ) . with_content ( %r{Suites: ./} ) }
497+ it { is_expected . to contain_apt__setting ( "sources-#{ title } " ) . without_content ( %r{Components:} ) }
498+ it { is_expected . to contain_apt__setting ( "sources-#{ title } " ) . with_content ( %r{Trusted: yes} ) }
499+ end
500+
483501 context '.list backwards compatibility' do
484502 let :params do
485503 super ( ) . merge (
Original file line number Diff line number Diff line change 33 Array[String] $types,
44 Array[String] $uris,
55 Array[String] $suites,
6- Array[String] $components,
6+ Optional[ Array[String]] $components = undef ,
77 Optional[Array] $architectures = undef,
88 Optional[Enum['yes','no']] $allow_insecure = undef,
99 Optional[Enum['yes','no']] $repo_trusted = undef,
@@ -15,7 +15,9 @@ Enabled: <%= $enabled %>
1515Types: <% $types.each |String $type| { -%> <%= $type %> <% } %>
1616URIs: <% $uris.each | String $uri | { -%> <%= $uri %> <% } %>
1717Suites: <% $suites.each | String $suite | { -%> <%= $suite %> <% } %>
18+ <% if $components { -%>
1819Components: <% $components.each | String $component | { -%> <%= $component %> <% } %>
20+ <%- } -%>
1921<% if $architectures { -%>
2022Architectures:<% $architectures.each | String $arch | { %> <%= $arch %><% } %>
2123<%- } -%>
You can’t perform that action at this time.
0 commit comments