deltas: Add _ostree_get_relative_static_delta_index_path()
This gets the subpath for a delta index file, which is of the form "delta-indexes/$commit.index", that contains all the deltas going to the particular commit.
This commit is contained in:
parent
f8f6464580
commit
87e564eeaa
|
|
@ -135,6 +135,9 @@ _ostree_get_relative_static_delta_part_path (const char *from,
|
||||||
const char *to,
|
const char *to,
|
||||||
guint i);
|
guint i);
|
||||||
|
|
||||||
|
char *
|
||||||
|
_ostree_get_relative_static_delta_index_path (const char *to);
|
||||||
|
|
||||||
static inline char * _ostree_get_commitpartial_path (const char *checksum)
|
static inline char * _ostree_get_commitpartial_path (const char *checksum)
|
||||||
{
|
{
|
||||||
return g_strconcat ("state/", checksum, ".commitpartial", NULL);
|
return g_strconcat ("state/", checksum, ".commitpartial", NULL);
|
||||||
|
|
|
||||||
|
|
@ -1814,15 +1814,15 @@ _ostree_get_relative_object_path (const char *checksum,
|
||||||
return g_string_free (path, FALSE);
|
return g_string_free (path, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
static GString *
|
||||||
_ostree_get_relative_static_delta_path (const char *from,
|
static_delta_path_base (const char *dir,
|
||||||
const char *to,
|
const char *from,
|
||||||
const char *target)
|
const char *to)
|
||||||
{
|
{
|
||||||
guint8 csum_to[OSTREE_SHA256_DIGEST_LEN];
|
guint8 csum_to[OSTREE_SHA256_DIGEST_LEN];
|
||||||
char to_b64[44];
|
char to_b64[44];
|
||||||
guint8 csum_to_copy[OSTREE_SHA256_DIGEST_LEN];
|
guint8 csum_to_copy[OSTREE_SHA256_DIGEST_LEN];
|
||||||
GString *ret = g_string_new ("deltas/");
|
GString *ret = g_string_new (dir);
|
||||||
|
|
||||||
ostree_checksum_inplace_to_bytes (to, csum_to);
|
ostree_checksum_inplace_to_bytes (to, csum_to);
|
||||||
ostree_checksum_b64_inplace_from_bytes (csum_to, to_b64);
|
ostree_checksum_b64_inplace_from_bytes (csum_to, to_b64);
|
||||||
|
|
@ -1851,6 +1851,16 @@ _ostree_get_relative_static_delta_path (const char *from,
|
||||||
g_string_append_c (ret, '/');
|
g_string_append_c (ret, '/');
|
||||||
g_string_append (ret, to_b64 + 2);
|
g_string_append (ret, to_b64 + 2);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
_ostree_get_relative_static_delta_path (const char *from,
|
||||||
|
const char *to,
|
||||||
|
const char *target)
|
||||||
|
{
|
||||||
|
GString *ret = static_delta_path_base ("deltas/", from, to);
|
||||||
|
|
||||||
if (target != NULL)
|
if (target != NULL)
|
||||||
{
|
{
|
||||||
g_string_append_c (ret, '/');
|
g_string_append_c (ret, '/');
|
||||||
|
|
@ -1883,6 +1893,16 @@ _ostree_get_relative_static_delta_part_path (const char *from,
|
||||||
return _ostree_get_relative_static_delta_path (from, to, partstr);
|
return _ostree_get_relative_static_delta_path (from, to, partstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
_ostree_get_relative_static_delta_index_path (const char *to)
|
||||||
|
{
|
||||||
|
GString *ret = static_delta_path_base ("delta-indexes/", NULL, to);
|
||||||
|
|
||||||
|
g_string_append (ret, ".index");
|
||||||
|
|
||||||
|
return g_string_free (ret, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_ostree_parse_delta_name (const char *delta_name,
|
_ostree_parse_delta_name (const char *delta_name,
|
||||||
char **out_from,
|
char **out_from,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue