core: new function _ostree_parse_delta_name
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
1 parent
e0da4db77c
commit
ae672c3c9f
4 files changed
+92
-1
No files matched your search
@@ -118,6 +118,11 @@ _ostree_get_commitpartial_path (const char *checksum)
|
||||
return g_strconcat ("state/", checksum, ".commitpartial", NULL);
|
||||
}
|
||||
|
||||
void
|
||||
_ostree_parse_delta_name (const char *delta_name,
|
||||
char **out_from,
|
||||
char **out_to);
|
||||
|
||||
void
|
||||
_ostree_loose_path (char *buf,
|
||||
const char *checksum,
|
||||
|
||||
@@ -1496,6 +1496,25 @@ _ostree_get_relative_static_delta_part_path (const char *from,
|
||||
return _ostree_get_relative_static_delta_path (from, to, partstr);
|
||||
}
|
||||
|
||||
void
|
||||
_ostree_parse_delta_name (const char *delta_name,
|
||||
char **out_from,
|
||||
char **out_to)
|
||||
{
|
||||
gs_strfreev char **parts = g_strsplit (delta_name, "-", 2);
|
||||
|
||||
*out_from = *out_to = NULL;
|
||||
if (parts[0] && parts[1])
|
||||
{
|
||||
ot_transfer_out_value (out_from, &parts[0]);
|
||||
ot_transfer_out_value (out_to, &parts[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ot_transfer_out_value (out_to, &parts[0]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* file_header_parse:
|
||||
* @metadata: A metadata variant of type %OSTREE_FILE_HEADER_GVARIANT_FORMAT
|
||||
|
||||
Reference in new issue
Block a user