builder: Add builder_cache_checksum_compat_strv

This lets us add strv:s without invalidating old caches
if the empty strv means same as before
This commit is contained in:
Alexander Larsson
2017-02-22 09:42:13 +01:00
parent 359d4fa96b
commit 67dc4a153f
2 changed files with 15 additions and 0 deletions

View File

@@ -1088,6 +1088,19 @@ builder_cache_checksum_str (BuilderCache *self,
g_checksum_update (self->checksum, (const guchar *) "\1", 1);
}
/* Only add to cache if non-empty. This means we can add
these things compatibly without invalidating the cache.
This is useful if empty means no change from what was
before */
void
builder_cache_checksum_compat_strv (BuilderCache *self,
char **strv)
{
if (strv != NULL && strv[0] != NULL)
builder_cache_checksum_strv (self, strv);
}
void
builder_cache_checksum_strv (BuilderCache *self,
char **strv)

View File

@@ -65,6 +65,8 @@ void builder_cache_checksum_str (BuilderCache *self,
const char *str);
void builder_cache_checksum_strv (BuilderCache *self,
char **strv);
void builder_cache_checksum_compat_strv (BuilderCache *self,
char **strv);
void builder_cache_checksum_boolean (BuilderCache *self,
gboolean val);
void builder_cache_checksum_uint32 (BuilderCache *self,