|
123 | 123 | Optional[Array[String]] $uris = undef, # deb822 |
124 | 124 | Boolean $enabled = true, # deb822 |
125 | 125 | Enum['present', 'absent'] $ensure = present, |
126 | | - Optional[Variant[String[0], Array[String[0]]]] $release = undef, |
| 126 | + Optional[String[0]] $release = undef, |
127 | 127 | Optional[Array[String]] $suites = undef, # deb822 |
128 | | - Variant[String[1], Array[String[1]]] $repos = 'main', |
| 128 | + String[1] $repos = 'main', |
129 | 129 | Optional[Array[String]] $components = undef, # deb822 |
130 | 130 | Hash $include = {}, |
131 | 131 | Optional[Variant[String[1], 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[1]] $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