Skip to content

Commit

Permalink
Add support for -force-components flag
Browse files Browse the repository at this point in the history
Closes: #29
  • Loading branch information
mdechiaro committed Jun 25, 2024
1 parent 3c31a2e commit 8398891
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ The following parameters are available in the `aptly::mirror` defined type:
* [`filter_with_deps`](#-aptly--mirror--filter_with_deps)
* [`environment`](#-aptly--mirror--environment)
* [`keyring`](#-aptly--mirror--keyring)
* [`force_components`](#-aptly--mirror--force_components)

##### <a name="-aptly--mirror--location"></a>`location`

Expand Down Expand Up @@ -298,6 +299,14 @@ path to the keyring used by aptly

Default value: `'/etc/apt/trusted.gpg'`

##### <a name="-aptly--mirror--force_components"></a>`force_components`

Data type: `Boolean`

Boolean to control whether Aptly should force download of components.

Default value: `false`

### <a name="aptly--repo"></a>`aptly::repo`

aptly::repo
Expand Down
10 changes: 9 additions & 1 deletion manifests/mirror.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# @param filter_with_deps Boolean to control whether when filtering to include dependencies of matching packages as well
# @param environment Optional environment variables to pass to the exec. Example: ['http_proxy=http://127.0.0.2:3128']
# @param keyring path to the keyring used by aptly
# @param force_components Boolean to control whether Aptly should force download of components.
#
define aptly::mirror (
String $location,
Expand All @@ -33,6 +34,7 @@
Boolean $with_udebs = false,
Boolean $filter_with_deps = false,
Array $environment = [],
Boolean $force_components = false,
) {
include aptly

Expand Down Expand Up @@ -106,8 +108,14 @@
]
}

if $force_components {
$force_components_arg = ' -force-components'
} else {
$force_components_arg = ''
}

exec { "aptly_mirror_create-${title}":
command => "${aptly_cmd} create ${architectures_arg} -with-sources=${with_sources} -with-udebs=${with_udebs}${filter_arg}${filter_with_deps_arg} ${title} ${location} ${release}${components_arg}",
command => "${aptly_cmd} create ${architectures_arg} -with-sources=${with_sources} -with-udebs=${with_udebs}${filter_arg}${filter_with_deps_arg} ${force_components_arg} ${title} ${location} ${release}${components_arg}",
unless => "${aptly_cmd} show ${title} >/dev/null",
user => $aptly::user,
require => $exec_aptly_mirror_create_require,
Expand Down

0 comments on commit 8398891

Please sign in to comment.