|
116 | 116 | # Specifies whether to check if the package release date is valid.
|
117 | 117 | #
|
118 | 118 | define apt::source (
|
119 |
| - Enum['list', 'sources'] $source_format = 'list', |
| 119 | + Enum['list', 'sources'] $source_format = 'list', |
120 | 120 | Array[Enum['deb','deb-src'], 1, 2] $types = ['deb'],
|
121 |
| - Optional[Variant[String, Array[String]]] $location = undef, |
| 121 | + Optional[String] $location = undef, |
122 | 122 | Optional[Array[String]] $uris = undef, # deb822
|
123 | 123 | Boolean $enabled = true, # deb822
|
124 | 124 | String $comment = $name,
|
125 | 125 | String $ensure = present,
|
126 |
| - Optional[Variant[String, Array[String]]] $release = undef, |
| 126 | + Optional[String] $release = undef, |
127 | 127 | Optional[Array[String]] $suites = undef, # deb822
|
128 |
| - Variant[String, Array[String]] $repos = 'main', |
| 128 | + String $repos = 'main', |
129 | 129 | Optional[Array[String]] $components = undef, # deb822
|
130 | 130 | Variant[Hash] $include = {},
|
131 | 131 | Optional[Variant[String, Hash]] $key = undef,
|
132 | 132 | Optional[Stdlib::AbsolutePath] $keyring = undef,
|
133 | 133 | Optional[Variant[Stdlib::AbsolutePath,Array[String]]] $signed_by = undef, # deb822
|
134 | 134 | Optional[Variant[Hash, Numeric, String]] $pin = undef,
|
135 |
| - Optional[Variant[String, Array[String]]] $architecture = undef, |
| 135 | + Optional[String] $architecture = undef, |
136 | 136 | Optional[Array[String]] $architectures = undef, # deb822
|
137 | 137 | Optional[Boolean] $allow_unsigned = undef,
|
138 | 138 | Optional[Boolean] $repo_trusted = undef, # deb822
|
|
156 | 156 | }
|
157 | 157 | } else {
|
158 | 158 | $_release = $release
|
159 |
| - # If the release is given as an array, use the first element only |
160 |
| - if (type($_release) =~ Array) { |
161 |
| - warning("Parameter, 'release', must be a string for 'list' format. Using the first array element instead.") |
162 |
| - $_release = $_release[0] |
163 |
| - } |
164 |
| - } |
165 |
| - |
166 |
| - if (type($repos =~ Array)) { |
167 |
| - $_repos = join($repos, ' ') |
168 |
| - } |
169 |
| - else { |
170 |
| - $_repos = $repos |
171 | 159 | }
|
172 | 160 |
|
173 | 161 | if $release =~ Pattern[/\/$/] {
|
174 | 162 | $_components = $_release
|
175 | 163 | } else {
|
176 |
| - $_components = "${_release} ${_repos}" |
| 164 | + $_components = "${_release} ${repos}" |
177 | 165 | }
|
178 | 166 |
|
179 | 167 | if $ensure == 'present' {
|
180 | 168 | if ! $location {
|
181 | 169 | fail('cannot create a source entry without specifying a location')
|
182 | 170 | }
|
| 171 | + elsif ($apt::proxy['https_acng']) and ($location =~ /(?i:^https:\/\/)/) { |
| 172 | + $_location = regsubst($location, 'https://','http://HTTPS///') |
| 173 | + } |
183 | 174 | else {
|
184 | 175 | $_location = $location
|
185 |
| - # If the location is given as an array, use the first element only |
186 |
| - if (type($_location) =~ Array) { |
187 |
| - warning("Parameter, 'location', must be a string for 'list' format. Using the first array element instead.") |
188 |
| - $_location = $_location[0] |
189 |
| - } |
190 |
| - if ($apt::proxy['https_acng']) and ($_location =~ /(?i:^https:\/\/)/) { |
191 |
| - $_location = regsubst($_location, 'https://','http://HTTPS///') |
192 |
| - } |
193 | 176 | }
|
194 | 177 | } else {
|
195 | 178 | $_location = undef
|
|
271 | 254 |
|
272 | 255 | if $architecture {
|
273 | 256 | $_architecture = regsubst($architecture, '\baarch64\b', 'arm64')
|
274 |
| - if (type($_architecture) =~ Array) { |
275 |
| - $_architecture = join($_architecture, ',') |
276 |
| - } |
277 | 257 | } else {
|
278 | 258 | $_architecture = undef
|
279 | 259 | }
|
|
0 commit comments