core: Re-unify on one OSTREE_OBJECT_TYPE_FILE
Having the archived vs not distinction in the object system wasn't useful in light of pack files. In fact, we should probably move towards generating a pack file per commit by default.
This commit is contained in:
1 parent
f15c184584
commit
38ef75e6e0
22 files changed
+1062
-805
No files matched your search
@@ -228,6 +228,36 @@ ot_gfile_get_basename_cached (GFile *file)
|
||||
return name;
|
||||
}
|
||||
|
||||
gboolean
|
||||
ot_gio_write_update_checksum (GOutputStream *out,
|
||||
gconstpointer data,
|
||||
gsize len,
|
||||
gsize *out_bytes_written,
|
||||
GChecksum *checksum,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
|
||||
if (out)
|
||||
{
|
||||
if (!g_output_stream_write_all (out, data, len, out_bytes_written,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
}
|
||||
else if (out_bytes_written)
|
||||
{
|
||||
*out_bytes_written = len;
|
||||
}
|
||||
|
||||
if (checksum)
|
||||
g_checksum_update (checksum, data, len);
|
||||
|
||||
ret = TRUE;
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
gboolean
|
||||
ot_gio_splice_update_checksum (GOutputStream *out,
|
||||
GInputStream *in,
|
||||
@@ -247,12 +277,9 @@ ot_gio_splice_update_checksum (GOutputStream *out,
|
||||
{
|
||||
if (!g_input_stream_read_all (in, buf, sizeof(buf), &bytes_read, cancellable, error))
|
||||
goto out;
|
||||
g_checksum_update (checksum, (guint8*)buf, bytes_read);
|
||||
if (out)
|
||||
{
|
||||
if (!g_output_stream_write_all (out, buf, bytes_read, &bytes_written, cancellable, error))
|
||||
goto out;
|
||||
}
|
||||
if (!ot_gio_write_update_checksum (out, buf, bytes_read, &bytes_written, checksum,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
}
|
||||
while (bytes_read > 0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user