summaryrefslogtreecommitdiff
path: root/metadata
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-06-22 15:45:14 +0200
committerAlexander Larsson <alexl@redhat.com>2009-06-23 15:10:28 +0200
commitdca2435679ca45199379867d1ec28f3bdfdeb1c8 (patch)
tree28fbb5112f36a48c8860635840a9ffdf171e919b /metadata
parentb51d263264abde22d038936cd443b6c8c7c04ac6 (diff)
downloadgvfs-dca2435679ca45199379867d1ec28f3bdfdeb1c8.tar.gz
Finish the TODOs in the journal apply code
Diffstat (limited to 'metadata')
-rw-r--r--metadata/metatree.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 8131b9a8..6adca598 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -1963,6 +1963,7 @@ apply_journal_to_builder (MetaTree *tree,
MetaJournal *journal;
MetaJournalEntry *entry;
guint32 *sizep;
+ guint64 mtime;
char *journal_path, *journal_key, *source_path;
char *value;
char **strv;
@@ -1974,6 +1975,7 @@ apply_journal_to_builder (MetaTree *tree,
entry = journal->first_entry;
while (entry < journal->last_entry)
{
+ mtime = GUINT64_FROM_BE (entry->mtime);
journal_path = &entry->path[0];
switch (entry->entry_type)
@@ -1985,6 +1987,7 @@ apply_journal_to_builder (MetaTree *tree,
metafile_key_set_value (file,
journal_key,
value);
+ metafile_set_mtime (file, mtime);
break;
case JOURNAL_OP_SETV_KEY:
journal_key = get_next_arg (journal_path);
@@ -1997,17 +2000,28 @@ apply_journal_to_builder (MetaTree *tree,
metafile_key_list_add (file, journal_key, strv[i]);
g_free (strv);
+ metafile_set_mtime (file, mtime);
break;
case JOURNAL_OP_UNSET_KEY:
journal_key = get_next_arg (journal_path);
- /* TODO */
+ file = meta_builder_lookup (builder, journal_path, FALSE);
+ if (file)
+ {
+ metafile_key_unset (file, journal_key);
+ metafile_set_mtime (file, mtime);
+ }
break;
case JOURNAL_OP_COPY_PATH:
source_path = get_next_arg (journal_path);
- /* TODO */
+ meta_builder_copy (builder,
+ source_path,
+ journal_path,
+ mtime);
break;
case JOURNAL_OP_REMOVE_PATH:
- /* TODO */
+ meta_builder_remove (builder,
+ journal_path,
+ mtime);
break;
default:
break;