core: INCOMPATIBLE CHANGE: Rename .packfile to .archive

It's too confusing that we call the mode "archive" but the actual
files ".packfile".  Also, git already has a "packfile" that serves a
totally different purpose.
This commit is contained in:
Colin Walters 2011-12-08 17:15:59 -05:00
parent 30c53a967c
commit 35fa68a74c
3 changed files with 9 additions and 9 deletions

View File

@ -541,7 +541,7 @@ ostree_get_relative_object_path (const char *checksum,
{ {
case OSTREE_OBJECT_TYPE_FILE: case OSTREE_OBJECT_TYPE_FILE:
if (archive) if (archive)
type_string = ".packfile"; type_string = ".archive";
else else
type_string = ".file"; type_string = ".file";
break; break;
@ -714,7 +714,7 @@ ostree_parse_packed_file (GFile *file,
if (bytes_read != 4) if (bytes_read != 4)
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Corrupted packfile; too short while reading metadata length"); "Corrupted archive file; too short while reading metadata length");
goto out; goto out;
} }
@ -722,7 +722,7 @@ ostree_parse_packed_file (GFile *file,
if (metadata_len > OSTREE_MAX_METADATA_SIZE) if (metadata_len > OSTREE_MAX_METADATA_SIZE)
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Corrupted packfile; metadata length %u is larger than maximum %u", "Corrupted archive file; metadata length %u is larger than maximum %u",
metadata_len, OSTREE_MAX_METADATA_SIZE); metadata_len, OSTREE_MAX_METADATA_SIZE);
goto out; goto out;
} }
@ -733,7 +733,7 @@ ostree_parse_packed_file (GFile *file,
if (bytes_read != metadata_len) if (bytes_read != metadata_len)
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Corrupted packfile; too short while reading metadata"); "Corrupted archive file; too short while reading metadata");
goto out; goto out;
} }
@ -785,7 +785,7 @@ ostree_parse_packed_file (GFile *file,
if (bytes_read != 4) if (bytes_read != 4)
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Corrupted packfile; too short while reading device id"); "Corrupted archive file; too short while reading device id");
goto out; goto out;
} }
dev = GUINT32_FROM_BE (dev); dev = GUINT32_FROM_BE (dev);
@ -801,7 +801,7 @@ ostree_parse_packed_file (GFile *file,
else else
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Corrupted packfile; invalid mode %u", mode); "Corrupted archive file; invalid mode %u", mode);
goto out; goto out;
} }

View File

@ -1919,7 +1919,7 @@ iter_object_dir (OstreeRepo *self,
if (g_str_has_suffix (name, ".meta")) if (g_str_has_suffix (name, ".meta"))
objtype = OSTREE_OBJECT_TYPE_META; objtype = OSTREE_OBJECT_TYPE_META;
else if (g_str_has_suffix (name, ".file") else if (g_str_has_suffix (name, ".file")
|| g_str_has_suffix (name, ".packfile")) || g_str_has_suffix (name, ".archive"))
objtype = OSTREE_OBJECT_TYPE_FILE; objtype = OSTREE_OBJECT_TYPE_FILE;
else else
goto loop_out; goto loop_out;

View File

@ -129,10 +129,10 @@ object_iter_callback (OstreeRepo *repo,
if (ostree_repo_get_mode (repo) == OSTREE_REPO_MODE_ARCHIVE if (ostree_repo_get_mode (repo) == OSTREE_REPO_MODE_ARCHIVE
&& objtype == OSTREE_OBJECT_TYPE_FILE) && objtype == OSTREE_OBJECT_TYPE_FILE)
{ {
if (!g_str_has_suffix (path, ".packfile")) if (!g_str_has_suffix (path, ".archive"))
{ {
g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Invalid unpacked filename '%s'", "Invalid archive filename '%s'",
path); path);
goto out; goto out;
} }