core: s/pack/archived/
This completes the rename from the previous commit.
This commit is contained in:
parent
d6ceb91c35
commit
f6117de8d3
|
|
@ -556,13 +556,13 @@ ostree_get_relative_object_path (const char *checksum,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ostree_pack_file_for_input (GOutputStream *output,
|
ostree_archive_file_for_input (GOutputStream *output,
|
||||||
GFileInfo *finfo,
|
GFileInfo *finfo,
|
||||||
GInputStream *instream,
|
GInputStream *instream,
|
||||||
GVariant *xattrs,
|
GVariant *xattrs,
|
||||||
GChecksum **out_checksum,
|
GChecksum **out_checksum,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
guint32 uid, gid, mode;
|
guint32 uid, gid, mode;
|
||||||
|
|
@ -580,7 +580,7 @@ ostree_pack_file_for_input (GOutputStream *output,
|
||||||
gid = g_file_info_get_attribute_uint32 (finfo, G_FILE_ATTRIBUTE_UNIX_GID);
|
gid = g_file_info_get_attribute_uint32 (finfo, G_FILE_ATTRIBUTE_UNIX_GID);
|
||||||
mode = g_file_info_get_attribute_uint32 (finfo, G_FILE_ATTRIBUTE_UNIX_MODE);
|
mode = g_file_info_get_attribute_uint32 (finfo, G_FILE_ATTRIBUTE_UNIX_MODE);
|
||||||
|
|
||||||
g_variant_builder_init (&pack_builder, G_VARIANT_TYPE (OSTREE_PACK_FILE_VARIANT_FORMAT));
|
g_variant_builder_init (&pack_builder, G_VARIANT_TYPE (OSTREE_ARCHIVED_FILE_VARIANT_FORMAT));
|
||||||
pack_builder_initialized = TRUE;
|
pack_builder_initialized = TRUE;
|
||||||
g_variant_builder_add (&pack_builder, "u", GUINT32_TO_BE (0));
|
g_variant_builder_add (&pack_builder, "u", GUINT32_TO_BE (0));
|
||||||
g_variant_builder_add (&pack_builder, "u", GUINT32_TO_BE (uid));
|
g_variant_builder_add (&pack_builder, "u", GUINT32_TO_BE (uid));
|
||||||
|
|
@ -687,12 +687,12 @@ ostree_pack_file_for_input (GOutputStream *output,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ostree_parse_packed_file (GFile *file,
|
ostree_parse_archived_file (GFile *file,
|
||||||
GFileInfo **out_file_info,
|
GFileInfo **out_file_info,
|
||||||
GVariant **out_xattrs,
|
GVariant **out_xattrs,
|
||||||
GInputStream **out_content,
|
GInputStream **out_content,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
char *metadata_buf = NULL;
|
char *metadata_buf = NULL;
|
||||||
|
|
@ -737,7 +737,7 @@ ostree_parse_packed_file (GFile *file,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
metadata = g_variant_new_from_data (G_VARIANT_TYPE (OSTREE_PACK_FILE_VARIANT_FORMAT),
|
metadata = g_variant_new_from_data (G_VARIANT_TYPE (OSTREE_ARCHIVED_FILE_VARIANT_FORMAT),
|
||||||
metadata_buf, metadata_len, FALSE,
|
metadata_buf, metadata_len, FALSE,
|
||||||
(GDestroyNotify)g_free,
|
(GDestroyNotify)g_free,
|
||||||
metadata_buf);
|
metadata_buf);
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ gboolean ostree_checksum_file_async_finish (GFile *f,
|
||||||
GVariant *ostree_create_directory_metadata (GFileInfo *dir_info,
|
GVariant *ostree_create_directory_metadata (GFileInfo *dir_info,
|
||||||
GVariant *xattrs);
|
GVariant *xattrs);
|
||||||
|
|
||||||
/* Packed files:
|
/* Archived files:
|
||||||
*
|
*
|
||||||
* guint32 metadata_length [metadata gvariant] [content]
|
* guint32 metadata_length [metadata gvariant] [content]
|
||||||
*
|
*
|
||||||
|
|
@ -155,20 +155,15 @@ GVariant *ostree_create_directory_metadata (GFileInfo *dir_info,
|
||||||
* symlink, then this is the target; if device, then device ID as
|
* symlink, then this is the target; if device, then device ID as
|
||||||
* network byte order uint32.
|
* network byte order uint32.
|
||||||
*/
|
*/
|
||||||
#define OSTREE_PACK_FILE_VARIANT_FORMAT "(uuuua(ayay)t)"
|
#define OSTREE_ARCHIVED_FILE_VARIANT_FORMAT "(uuuua(ayay)t)"
|
||||||
|
|
||||||
gboolean ostree_pack_file (GOutputStream *output,
|
gboolean ostree_archive_file_for_input (GOutputStream *output,
|
||||||
GFile *file,
|
GFileInfo *finfo,
|
||||||
GCancellable *cancellable,
|
GInputStream *input,
|
||||||
GError **error);
|
GVariant *xattrs,
|
||||||
|
GChecksum **out_checksum,
|
||||||
gboolean ostree_pack_file_for_input (GOutputStream *output,
|
GCancellable *cancellable,
|
||||||
GFileInfo *finfo,
|
GError **error);
|
||||||
GInputStream *input,
|
|
||||||
GVariant *xattrs,
|
|
||||||
GChecksum **out_checksum,
|
|
||||||
GCancellable *cancellable,
|
|
||||||
GError **error);
|
|
||||||
|
|
||||||
gboolean ostree_create_file_from_input (GFile *file,
|
gboolean ostree_create_file_from_input (GFile *file,
|
||||||
GFileInfo *finfo,
|
GFileInfo *finfo,
|
||||||
|
|
@ -199,12 +194,12 @@ gboolean ostree_create_temp_regular_file (GFile *dir,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
gboolean ostree_parse_packed_file (GFile *file,
|
gboolean ostree_parse_archived_file (GFile *file,
|
||||||
GFileInfo **out_file_info,
|
GFileInfo **out_file_info,
|
||||||
GVariant **out_xattrs,
|
GVariant **out_xattrs,
|
||||||
GInputStream **out_content,
|
GInputStream **out_content,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
gboolean ostree_unpack_object (GFile *file,
|
gboolean ostree_unpack_object (GFile *file,
|
||||||
OstreeObjectType objtype,
|
OstreeObjectType objtype,
|
||||||
|
|
|
||||||
|
|
@ -317,7 +317,7 @@ _ostree_repo_file_get_xattrs (OstreeRepoFile *self,
|
||||||
else if (ostree_repo_get_mode (self->repo) == OSTREE_REPO_MODE_ARCHIVE)
|
else if (ostree_repo_get_mode (self->repo) == OSTREE_REPO_MODE_ARCHIVE)
|
||||||
{
|
{
|
||||||
local_file = _ostree_repo_file_nontree_get_local (self);
|
local_file = _ostree_repo_file_nontree_get_local (self);
|
||||||
if (!ostree_parse_packed_file (local_file, NULL, &ret_xattrs, NULL, cancellable, error))
|
if (!ostree_parse_archived_file (local_file, NULL, &ret_xattrs, NULL, cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1037,7 +1037,7 @@ _ostree_repo_file_tree_query_child (OstreeRepoFile *self,
|
||||||
|
|
||||||
if (ostree_repo_get_mode (self->repo) == OSTREE_REPO_MODE_ARCHIVE)
|
if (ostree_repo_get_mode (self->repo) == OSTREE_REPO_MODE_ARCHIVE)
|
||||||
{
|
{
|
||||||
if (!ostree_parse_packed_file (local_child, &ret_info, NULL, NULL, cancellable, error))
|
if (!ostree_parse_archived_file (local_child, &ret_info, NULL, NULL, cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -671,8 +671,8 @@ ostree_repo_stage_object (OstreeRepo *self,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!ostree_pack_file_for_input (temp_out, file_info, input, xattrs,
|
if (!ostree_archive_file_for_input (temp_out, file_info, input, xattrs,
|
||||||
&ret_checksum, cancellable, error))
|
&ret_checksum, cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!g_output_stream_close (temp_out, cancellable, error))
|
if (!g_output_stream_close (temp_out, cancellable, error))
|
||||||
|
|
@ -995,12 +995,12 @@ ostree_repo_store_object_trusted (OstreeRepo *self,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ostree_repo_store_packfile (OstreeRepo *self,
|
ostree_repo_store_archived_file (OstreeRepo *self,
|
||||||
const char *expected_checksum,
|
const char *expected_checksum,
|
||||||
const char *path,
|
const char *path,
|
||||||
OstreeObjectType objtype,
|
OstreeObjectType objtype,
|
||||||
gboolean *did_exist,
|
gboolean *did_exist,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
GChecksum *checksum = NULL;
|
GChecksum *checksum = NULL;
|
||||||
|
|
@ -1020,7 +1020,7 @@ ostree_repo_store_packfile (OstreeRepo *self,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!ostree_parse_packed_file (src, &file_info, &xattrs, &input, NULL, error))
|
if (!ostree_parse_archived_file (src, &file_info, &xattrs, &input, NULL, error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2141,8 +2141,8 @@ checkout_tree (OstreeRepo *self,
|
||||||
|
|
||||||
if (priv->mode == OSTREE_REPO_MODE_ARCHIVE)
|
if (priv->mode == OSTREE_REPO_MODE_ARCHIVE)
|
||||||
{
|
{
|
||||||
if (!ostree_parse_packed_file (object_path, NULL, &xattrs, &packed_input,
|
if (!ostree_parse_archived_file (object_path, NULL, &xattrs, &packed_input,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!checkout_file_from_input (dest_path, mode, file_info, xattrs,
|
if (!checkout_file_from_input (dest_path, mode, file_info, xattrs,
|
||||||
|
|
|
||||||
|
|
@ -76,12 +76,12 @@ GFile * ostree_repo_get_object_path (OstreeRepo *self,
|
||||||
const char *object,
|
const char *object,
|
||||||
OstreeObjectType type);
|
OstreeObjectType type);
|
||||||
|
|
||||||
gboolean ostree_repo_store_packfile (OstreeRepo *self,
|
gboolean ostree_repo_store_archived_file (OstreeRepo *self,
|
||||||
const char *expected_checksum,
|
const char *expected_checksum,
|
||||||
const char *path,
|
const char *path,
|
||||||
OstreeObjectType objtype,
|
OstreeObjectType objtype,
|
||||||
gboolean *did_exist,
|
gboolean *did_exist,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
gboolean ostree_repo_store_object_trusted (OstreeRepo *self,
|
gboolean ostree_repo_store_object_trusted (OstreeRepo *self,
|
||||||
GFile *file,
|
GFile *file,
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ store_object (OstreeRepo *repo,
|
||||||
if (!fetch_uri (repo, soup, obj_uri, &filename, error))
|
if (!fetch_uri (repo, soup, obj_uri, &filename, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!ostree_repo_store_packfile (repo, object, filename, objtype, did_exist, error))
|
if (!ostree_repo_store_archived_file (repo, object, filename, objtype, did_exist, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,10 @@ typedef struct {
|
||||||
} OtFsckData;
|
} OtFsckData;
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
checksum_packed_file (OtFsckData *data,
|
checksum_archived_file (OtFsckData *data,
|
||||||
GFile *file,
|
GFile *file,
|
||||||
GChecksum **out_checksum,
|
GChecksum **out_checksum,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
GChecksum *ret_checksum = NULL;
|
GChecksum *ret_checksum = NULL;
|
||||||
|
|
@ -71,7 +71,7 @@ checksum_packed_file (OtFsckData *data,
|
||||||
if (!g_input_stream_read_all ((GInputStream*)in, metadata_buf, metadata_len, &bytes_read, NULL, error))
|
if (!g_input_stream_read_all ((GInputStream*)in, metadata_buf, metadata_len, &bytes_read, NULL, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
metadata = g_variant_new_from_data (G_VARIANT_TYPE (OSTREE_PACK_FILE_VARIANT_FORMAT),
|
metadata = g_variant_new_from_data (G_VARIANT_TYPE (OSTREE_ARCHIVED_FILE_VARIANT_FORMAT),
|
||||||
metadata_buf, metadata_len, FALSE, NULL, NULL);
|
metadata_buf, metadata_len, FALSE, NULL, NULL);
|
||||||
|
|
||||||
g_variant_get (metadata, "(uuuu@a(ayay)t)",
|
g_variant_get (metadata, "(uuuu@a(ayay)t)",
|
||||||
|
|
@ -136,7 +136,7 @@ object_iter_callback (OstreeRepo *repo,
|
||||||
path);
|
path);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (!checksum_packed_file (data, objf, &real_checksum, &error))
|
if (!checksum_archived_file (data, objf, &real_checksum, &error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -99,11 +99,11 @@ object_iter_callback (OstreeRepo *repo,
|
||||||
|
|
||||||
if (ostree_repo_get_mode (data->src_repo) == OSTREE_REPO_MODE_ARCHIVE)
|
if (ostree_repo_get_mode (data->src_repo) == OSTREE_REPO_MODE_ARCHIVE)
|
||||||
{
|
{
|
||||||
if (!ostree_repo_store_packfile (data->dest_repo, checksum,
|
if (!ostree_repo_store_archived_file (data->dest_repo, checksum,
|
||||||
ot_gfile_get_path_cached (objfile),
|
ot_gfile_get_path_cached (objfile),
|
||||||
objtype,
|
objtype,
|
||||||
&did_exist,
|
&did_exist,
|
||||||
&error))
|
&error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue