Skip to content

Commit 57d70a7

Browse files
committed
Revert "Add forward-compatibility with deb822"
This reverts commit 9d88e93.
1 parent 2664ba8 commit 57d70a7

File tree

1 file changed

+9
-29
lines changed

1 file changed

+9
-29
lines changed

manifests/source.pp

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,23 @@
116116
# Specifies whether to check if the package release date is valid.
117117
#
118118
define apt::source (
119-
Enum['list', 'sources'] $source_format = 'list',
119+
Enum['list', 'sources'] $source_format = 'list',
120120
Array[Enum['deb','deb-src'], 1, 2] $types = ['deb'],
121-
Optional[Variant[String, Array[String]]] $location = undef,
121+
Optional[String] $location = undef,
122122
Optional[Array[String]] $uris = undef, # deb822
123123
Boolean $enabled = true, # deb822
124124
String $comment = $name,
125125
String $ensure = present,
126-
Optional[Variant[String, Array[String]]] $release = undef,
126+
Optional[String] $release = undef,
127127
Optional[Array[String]] $suites = undef, # deb822
128-
Variant[String, Array[String]] $repos = 'main',
128+
String $repos = 'main',
129129
Optional[Array[String]] $components = undef, # deb822
130130
Variant[Hash] $include = {},
131131
Optional[Variant[String, Hash]] $key = undef,
132132
Optional[Stdlib::AbsolutePath] $keyring = undef,
133133
Optional[Variant[Stdlib::AbsolutePath,Array[String]]] $signed_by = undef, # deb822
134134
Optional[Variant[Hash, Numeric, String]] $pin = undef,
135-
Optional[Variant[String, Array[String]]] $architecture = undef,
135+
Optional[String] $architecture = undef,
136136
Optional[Array[String]] $architectures = undef, # deb822
137137
Optional[Boolean] $allow_unsigned = undef,
138138
Optional[Boolean] $repo_trusted = undef, # deb822
@@ -156,40 +156,23 @@
156156
}
157157
} else {
158158
$_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
171159
}
172160

173161
if $release =~ Pattern[/\/$/] {
174162
$_components = $_release
175163
} else {
176-
$_components = "${_release} ${_repos}"
164+
$_components = "${_release} ${repos}"
177165
}
178166

179167
if $ensure == 'present' {
180168
if ! $location {
181169
fail('cannot create a source entry without specifying a location')
182170
}
171+
elsif ($apt::proxy['https_acng']) and ($location =~ /(?i:^https:\/\/)/) {
172+
$_location = regsubst($location, 'https://','http://HTTPS///')
173+
}
183174
else {
184175
$_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-
}
193176
}
194177
} else {
195178
$_location = undef
@@ -271,9 +254,6 @@
271254

272255
if $architecture {
273256
$_architecture = regsubst($architecture, '\baarch64\b', 'arm64')
274-
if (type($_architecture) =~ Array) {
275-
$_architecture = join($_architecture, ',')
276-
}
277257
} else {
278258
$_architecture = undef
279259
}

0 commit comments

Comments
 (0)