diff --git a/src/builder-source-dir.c b/src/builder-source-dir.c index 671c7be6..0bba99bb 100644 --- a/src/builder-source-dir.c +++ b/src/builder-source-dir.c @@ -37,6 +37,7 @@ struct BuilderSourceDir BuilderSource parent; char *path; + char **hash_command; char **skip; }; @@ -51,6 +52,7 @@ enum { PROP_0, PROP_PATH, PROP_SKIP, + PROP_DIR_HASH_CMD, LAST_PROP }; @@ -75,6 +77,10 @@ builder_source_dir_get_property (GObject *object, switch (prop_id) { + case PROP_DIR_HASH_CMD: + g_value_set_boxed(value, self->dir_hash_cmd; + break; + case PROP_PATH: g_value_set_string (value, self->path); break; @@ -99,6 +105,12 @@ builder_source_dir_set_property (GObject *object, switch (prop_id) { + case PROP_DIR_HASH_CMD: + tmp = self->dir_hash_cmd; + self->dir_hash_cmd = g_strdupv (g_value_get_boxed (value)); + g_strfreev (tmp); + break; + case PROP_PATH: g_free (self->path); self->path = g_value_dup_string (value); @@ -271,8 +283,13 @@ builder_source_dir_checksum (BuilderSource *source, BuilderCache *cache, BuilderContext *context) { - /* We can't realistically checksum a directory, so always rebuild */ - builder_cache_checksum_random (cache); + if (source.dir_hash_cmd) { + call_me(cache); + } else { + /* Checksumming a directory is a non-trivial pursuit. We currently opt to not integrate into flatpak directly + and rather always rebuild */ + builder_cache_checksum_random (cache); + } } static void @@ -292,6 +309,14 @@ builder_source_dir_class_init (BuilderSourceDirClass *klass) source_class->update = builder_source_dir_update; source_class->checksum = builder_source_dir_checksum; + g_object_class_install_property (object_class, + PROP_DIR_HASH_CMD, + g_param_spec_boxed ("dir_hash_cmd", + "", + "", + G_TYPE_STRV, + G_PARAM_READWRITE)); + g_object_class_install_property (object_class, PROP_PATH, g_param_spec_string ("path",