diff --git a/doc/flatpak-manifest.xml b/doc/flatpak-manifest.xml index 39e11041..0796e4a6 100644 --- a/doc/flatpak-manifest.xml +++ b/doc/flatpak-manifest.xml @@ -471,7 +471,7 @@ Additionally the standard flatpak extension properties are supported, and put directly into the metadata file: autodelete, no-autodownload, subdirectories, - add-ld-path, download-if, enable-if, merge-dirs, + add-ld-path, download-if, enable-if, autoprune-unless, merge-dirs, subdirectory-suffix, locale-subset, version, versions. See the flatpak metadata documentation for more information on these. diff --git a/src/builder-extension.c b/src/builder-extension.c index a2bd8186..411c27fe 100644 --- a/src/builder-extension.c +++ b/src/builder-extension.c @@ -49,6 +49,7 @@ struct BuilderExtension char *add_ld_path; char *download_if; char *enable_if; + char *autoprune_unless; char *merge_dirs; char *subdirectory_suffix; char *version; @@ -71,6 +72,7 @@ enum { PROP_ADD_LD_PATH, PROP_DOWNLOAD_IF, PROP_ENABLE_IF, + PROP_AUTOPRUNE_UNLESS, PROP_MERGE_DIRS, PROP_NO_AUTODOWNLOAD, PROP_LOCALE_SUBSET, @@ -92,6 +94,7 @@ builder_extension_finalize (GObject *object) g_free (self->add_ld_path); g_free (self->download_if); g_free (self->enable_if); + g_free (self->autoprune_unless); g_free (self->merge_dirs); g_free (self->subdirectory_suffix); g_free (self->version); @@ -150,6 +153,10 @@ builder_extension_get_property (GObject *object, g_value_set_string (value, self->enable_if); break; + case PROP_AUTOPRUNE_UNLESS: + g_value_set_string (value, self->autoprune_unless); + break; + case PROP_MERGE_DIRS: g_value_set_string (value, self->merge_dirs); break; @@ -225,6 +232,11 @@ builder_extension_set_property (GObject *object, self->enable_if = g_value_dup_string (value); break; + case PROP_AUTOPRUNE_UNLESS: + g_clear_pointer (&self->autoprune_unless, g_free); + self->autoprune_unless = g_value_dup_string (value); + break; + case PROP_MERGE_DIRS: g_clear_pointer (&self->merge_dirs, g_free); self->merge_dirs = g_value_dup_string (value); @@ -329,6 +341,13 @@ builder_extension_class_init (BuilderExtensionClass *klass) "", NULL, G_PARAM_READWRITE)); + g_object_class_install_property (object_class, + PROP_AUTOPRUNE_UNLESS, + g_param_spec_string ("autoprune-unless", + "", + "", + NULL, + G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_MERGE_DIRS, g_param_spec_string ("merge-dirs", @@ -445,6 +464,7 @@ builder_extension_add_finish_args (BuilderExtension *self, add_arg (self, args, FLATPAK_METADATA_KEY_ADD_LD_PATH, self->add_ld_path); add_arg (self, args, FLATPAK_METADATA_KEY_DOWNLOAD_IF, self->download_if); add_arg (self, args, FLATPAK_METADATA_KEY_ENABLE_IF, self->enable_if); + add_arg (self, args, FLATPAK_METADATA_KEY_AUTOPRUNE_UNLESS, self->autoprune_unless); add_arg (self, args, FLATPAK_METADATA_KEY_MERGE_DIRS, self->merge_dirs); add_arg (self, args, FLATPAK_METADATA_KEY_SUBDIRECTORY_SUFFIX, self->subdirectory_suffix); add_arg (self, args, FLATPAK_METADATA_KEY_VERSION, self->version); @@ -467,6 +487,7 @@ builder_extension_checksum (BuilderExtension *self, builder_cache_checksum_str (cache, self->add_ld_path); builder_cache_checksum_str (cache, self->download_if); builder_cache_checksum_str (cache, self->enable_if); + builder_cache_checksum_str (cache, self->autoprune_unless); builder_cache_checksum_str (cache, self->merge_dirs); builder_cache_checksum_str (cache, self->subdirectory_suffix); builder_cache_checksum_str (cache, self->version); diff --git a/src/builder-flatpak-utils.h b/src/builder-flatpak-utils.h index dc3865cf..5f44f114 100644 --- a/src/builder-flatpak-utils.h +++ b/src/builder-flatpak-utils.h @@ -45,6 +45,7 @@ typedef void (*FlatpakLoadUriProgress) (guint64 downloaded_bytes, #define FLATPAK_METADATA_KEY_DIRECTORY "directory" #define FLATPAK_METADATA_KEY_DOWNLOAD_IF "download-if" #define FLATPAK_METADATA_KEY_ENABLE_IF "enable-if" +#define FLATPAK_METADATA_KEY_AUTOPRUNE_UNLESS "autoprune-unless" #define FLATPAK_METADATA_KEY_MERGE_DIRS "merge-dirs" #define FLATPAK_METADATA_KEY_NO_AUTODOWNLOAD "no-autodownload" #define FLATPAK_METADATA_KEY_LOCALE_SUBSET "locale-subset"