summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-07-08 21:59:36 -0400
committerKristian Høgsberg <krh@redhat.com>2008-07-08 21:59:36 -0400
commit5e777955178cbb1eb37ca9c95ec9c04ff90be939 (patch)
treeebcfe95747db49695a5482ad009d5ce2e8d1701c
parentd255e6c8c6c8a2282e35b8b43c1bd8e12e7a6906 (diff)
Always open all three rzdb files when we're merging package sets.
-rw-r--r--librazor/root.c10
-rw-r--r--src/main.c17
2 files changed, 25 insertions, 2 deletions
diff --git a/librazor/root.c b/librazor/root.c
index 6457dcf..579553c 100644
--- a/librazor/root.c
+++ b/librazor/root.c
@@ -103,6 +103,7 @@ RAZOR_EXPORT struct razor_root *
razor_root_open(const char *root)
{
struct razor_root *image;
+ char details_path[PATH_MAX], files_path[PATH_MAX];
assert (root != NULL);
@@ -130,8 +131,15 @@ razor_root_open(const char *root)
snprintf(image->path, sizeof image->path,
"%s%s/%s", root, razor_root_path, system_repo_filename);
+ snprintf(details_path, sizeof details_path,
+ "%s%s/%s", root, razor_root_path, system_repo_details_filename);
+ snprintf(files_path, sizeof files_path,
+ "%s%s/%s", root, razor_root_path, system_repo_files_filename);
+
image->system = razor_set_open(image->path);
- if (image->system == NULL) {
+ if (image->system == NULL ||
+ razor_set_open_details(image->system, details_path) ||
+ razor_set_open_files(image->system, files_path)) {
unlink(image->new_path);
close(image->fd);
free(image);
diff --git a/src/main.c b/src/main.c
index 9f8122f..73e2b48 100644
--- a/src/main.c
+++ b/src/main.c
@@ -497,8 +497,15 @@ command_update(int argc, const char *argv[])
int i, errors;
set = razor_set_open(repo_filename);
+ if (set == NULL ||
+ razor_set_open_details(set, "system-details.rzdb") ||
+ razor_set_open_files(set, "system-files.rzdb"))
+ return 1;
+
upstream = razor_set_open(rawhide_repo_filename);
- if (set == NULL || upstream == NULL)
+ if (upstream == NULL ||
+ razor_set_open_details(upstream, "rawhide-details.rzdb") ||
+ razor_set_open_files(upstream, "rawhide-files.rzdb"))
return 1;
trans = razor_transaction_create(set, upstream);
@@ -763,6 +770,14 @@ command_install(int argc, const char *argv[])
system = razor_root_get_system_set(root);
upstream = razor_set_open(rawhide_repo_filename);
+ if (upstream == NULL ||
+ razor_set_open_details(upstream, "rawhide-details.rzdb") ||
+ razor_set_open_files(upstream, "rawhide-files.rzdb")) {
+ fprintf(stderr, "couldn't open rawhide repo\n");
+ razor_root_close(root);
+ return 1;
+ }
+
trans = razor_transaction_create(system, upstream);
for (; i < argc; i++) {