From 1b5372b8b32ccd04f3a2f9d9ba827b0687562a00 Mon Sep 17 00:00:00 2001 From: Yury Bushmelev Date: Mon, 5 Oct 2026 16:50:21 +0800 Subject: [PATCH] Add --with_appstream option support This commit adds `with_appstream` option to mirror_create bolt task and to aptly_mirror provider. Signed-off-by: Yury Bushmelev --- REFERENCE.md | 12 ++++++++++++ lib/puppet/provider/aptly_mirror/aptly_mirror.rb | 2 ++ lib/puppet/type/aptly_mirror.rb | 4 ++++ lib/puppet_x/voxpupuli/aptly/cli_helper.rb | 2 ++ spec/unit/cli_helper_spec.rb | 5 ++++- spec/unit/provider/aptly_mirror_spec.rb | 8 ++++++++ tasks/mirror_create.json | 4 ++++ 7 files changed, 36 insertions(+), 1 deletion(-) diff --git a/REFERENCE.md b/REFERENCE.md index 2c4fbb6..af11c97 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -538,6 +538,12 @@ Data type: `Stdlib::HTTPUrl` Archive URL +##### `with_appstream` + +Data type: `Optional[Boolean]` + +Download AppStream (DEP-11) metadata + ##### `with_installer` Data type: `Optional[Boolean]` @@ -709,6 +715,12 @@ Data type: `Optional[Integer[0]]` Max download tries till process fails with download error +##### `with_appstream` + +Data type: `Optional[Boolean]` + +Download AppStream (DEP-11) metadata + ##### `with_installer` Data type: `Optional[Boolean]` diff --git a/lib/puppet/provider/aptly_mirror/aptly_mirror.rb b/lib/puppet/provider/aptly_mirror/aptly_mirror.rb index 563dcd7..4448002 100644 --- a/lib/puppet/provider/aptly_mirror/aptly_mirror.rb +++ b/lib/puppet/provider/aptly_mirror/aptly_mirror.rb @@ -19,6 +19,7 @@ def get(context) filter_with_deps: mirror['FilterWithDeps'], force_architectures: mirror['SkipArchitectureCheck'], force_components: mirror['SkipComponentCheck'], + with_appstream: mirror['DownloadAppStream'], with_installer: mirror['DownloadInstaller'], with_sources: mirror['DownloadSources'], with_udebs: mirror['DownloadUdebs'], @@ -70,6 +71,7 @@ def create(context, name, should, noop: false) force_components: should[:force_components], ignore_signatures: should[:ignore_signatures], max_tries: should[:max_tries], + with_appstream: should[:with_appstream], with_installer: should[:with_installer], with_sources: should[:with_sources], with_udebs: should[:with_udebs], diff --git a/lib/puppet/type/aptly_mirror.rb b/lib/puppet/type/aptly_mirror.rb index 1a721b0..10c08cc 100644 --- a/lib/puppet/type/aptly_mirror.rb +++ b/lib/puppet/type/aptly_mirror.rb @@ -89,6 +89,10 @@ type: 'Optional[Integer[0]]', behaviour: :parameter, }, + with_appstream: { + desc: 'Download AppStream (DEP-11) metadata', + type: 'Optional[Boolean]', + }, with_installer: { desc: 'Download additional not packaged installer files', type: 'Optional[Boolean]', diff --git a/lib/puppet_x/voxpupuli/aptly/cli_helper.rb b/lib/puppet_x/voxpupuli/aptly/cli_helper.rb index 5f2faf0..c321271 100644 --- a/lib/puppet_x/voxpupuli/aptly/cli_helper.rb +++ b/lib/puppet_x/voxpupuli/aptly/cli_helper.rb @@ -33,6 +33,7 @@ def self.mirror_create(name, url, distribution, options = {}) cmd << '-ignore-signatures' if options[:ignore_signatures] cmd += Array(options[:keyring]).map { |x| "-keyring=#{x}" } cmd << "-max-tries=#{options[:max_tries]}" if options[:max_tries] + cmd << '-with-appstream' if options[:with_appstream] cmd << '-with-installer' if options[:with_installer] cmd << '-with-sources' if options[:with_sources] cmd << '-with-udebs' if options[:with_udebs] @@ -77,6 +78,7 @@ def self.mirror_edit(name, options = {}) cmd << '-filter-with-deps' if options[:filter_with_deps] cmd << '-ignore-signatures' if options[:ignore_signatures] cmd += Array(options[:keyring]).map { |x| "-keyring=#{x}" } + cmd << '-with-appstream' if options[:with_appstream] cmd << '-with-installer' if options[:with_installer] cmd << '-with-sources' if options[:with_sources] cmd << '-with-udebs' if options[:with_udebs] diff --git a/spec/unit/cli_helper_spec.rb b/spec/unit/cli_helper_spec.rb index 5ed2ab0..cc606c6 100644 --- a/spec/unit/cli_helper_spec.rb +++ b/spec/unit/cli_helper_spec.rb @@ -71,6 +71,7 @@ ignore_signatures: true, keyring: '/home/aptly/keyring.gpg', max_tries: 5, + with_appstream: true, with_installer: true, with_sources: true, with_udebs: true, @@ -83,7 +84,7 @@ -config=/home/test/aptly.conf -dep-follow-all-variants -dep-follow-recommends -dep-follow-source -dep-follow-suggests -filter=foo -filter-with-deps -ignore-signatures - -keyring=/home/aptly/keyring.gpg -max-tries=5 -with-installer + -keyring=/home/aptly/keyring.gpg -max-tries=5 -with-appstream -with-installer -with-sources -with-udebs bookworm-main http://deb.debian.org/debian/ bookworm main updates ] @@ -193,6 +194,7 @@ filter_with_deps: true, ignore_signatures: true, keyring: ['/home/aptly/example_keyring1.gpg', '/home/aptly/example_keyring2.gpg'], + with_appstream: true, with_installer: true, with_sources: true, with_udebs: true, @@ -207,6 +209,7 @@ -filter=foo -filter-with-deps -ignore-signatures -keyring=/home/aptly/example_keyring1.gpg -keyring=/home/aptly/example_keyring2.gpg + -with-appstream -with-installer -with-sources -with-udebs bookworm-main ] diff --git a/spec/unit/provider/aptly_mirror_spec.rb b/spec/unit/provider/aptly_mirror_spec.rb index 5ee1b44..c593edd 100644 --- a/spec/unit/provider/aptly_mirror_spec.rb +++ b/spec/unit/provider/aptly_mirror_spec.rb @@ -35,6 +35,7 @@ module Puppet::Provider::AptlyMirror; end 'DownloadSources' => true, 'DownloadUdebs' => true, 'DownloadInstaller' => true, + 'DownloadAppStream' => true, }, { 'Name' => 'bullseye-main', @@ -53,6 +54,7 @@ module Puppet::Provider::AptlyMirror; end 'DownloadSources' => false, 'DownloadUdebs' => false, 'DownloadInstaller' => false, + 'DownloadAppStream' => false, }, ] end @@ -79,6 +81,7 @@ module Puppet::Provider::AptlyMirror; end force_components: false, name: 'bookworm-main', url: 'http://deb.debian.org/debian/', + with_appstream: true, with_installer: true, with_sources: true, with_udebs: true, @@ -94,6 +97,7 @@ module Puppet::Provider::AptlyMirror; end force_components: false, name: 'bullseye-main', url: 'http://deb.debian.org/debian/', + with_appstream: false, with_installer: false, with_sources: false, with_udebs: false, @@ -124,6 +128,7 @@ module Puppet::Provider::AptlyMirror; end force_components: false, name: name, url: 'https://apt.voxpupuli.org', + with_appstream: false, with_installer: false, with_sources: false, with_udebs: false, @@ -211,6 +216,7 @@ module Puppet::Provider::AptlyMirror; end max_tries: 3, name: name, url: 'https://apt.voxpupuli.org', + with_appstream: false, with_installer: false, with_sources: false, with_udebs: false, @@ -259,6 +265,7 @@ module Puppet::Provider::AptlyMirror; end force_components: false, name: name, url: 'http://deb.debian.org/debian/', + with_appstream: true, with_installer: true, with_sources: false, with_udebs: true, @@ -301,6 +308,7 @@ module Puppet::Provider::AptlyMirror; end max_tries: nil, name: name, url: 'http://deb.debian.org/debian/', + with_appstream: true, with_installer: true, with_sources: false, with_udebs: true, diff --git a/tasks/mirror_create.json b/tasks/mirror_create.json index 1b98a88..23c8082 100644 --- a/tasks/mirror_create.json +++ b/tasks/mirror_create.json @@ -58,6 +58,10 @@ "description": "Max download tries till process fails with download error", "type": "Optional[Integer[0]]" }, + "with_appstream": { + "description": "Download AppStream (DEP-11) metadata", + "type": "Optional[Boolean]" + }, "with_installer": { "description": "Download additional not packaged installer files", "type": "Optional[Boolean]"