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 310
310
$_release = $release
311
311
}
312
312
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 {
314
319
warning (" For deb822 sources, 'repos' must be specified as an array. Converting to array." )
315
320
$_repos = split($repos , /\s+/)
316
321
} else {
Original file line number Diff line number Diff line change 480
480
it { is_expected . to contain_apt__setting ( "sources-#{ title } " ) . with_content ( %r{Trusted: yes} ) }
481
481
end
482
482
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
+
483
501
context '.list backwards compatibility' do
484
502
let :params do
485
503
super ( ) . merge (
Original file line number Diff line number Diff line change 3
3
Array[String] $types,
4
4
Array[String] $uris,
5
5
Array[String] $suites,
6
- Array[String] $components,
6
+ Optional[ Array[String]] $components = undef ,
7
7
Optional[Array] $architectures = undef,
8
8
Optional[Enum['yes','no']] $allow_insecure = undef,
9
9
Optional[Enum['yes','no']] $repo_trusted = undef,
@@ -15,7 +15,9 @@ Enabled: <%= $enabled %>
15
15
Types: <% $types.each |String $type| { -%> <%= $type %> <% } %>
16
16
URIs: <% $uris.each | String $uri | { -%> <%= $uri %> <% } %>
17
17
Suites: <% $suites.each | String $suite | { -%> <%= $suite %> <% } %>
18
+ <% if $components { -%>
18
19
Components: <% $components.each | String $component | { -%> <%= $component %> <% } %>
20
+ <%- } -%>
19
21
<% if $architectures { -%>
20
22
Architectures:<% $architectures.each | String $arch | { %> <%= $arch %><% } %>
21
23
<%- } -%>
You can’t perform that action at this time.
0 commit comments