diff options
author | James Bowes <jbowes@redhat.com> | 2008-06-23 19:43:52 -0400 |
---|---|---|
committer | James Bowes <jbowes@redhat.com> | 2008-06-23 19:43:52 -0400 |
commit | b6de825d81947d3c0cd060c4a6eb24fa32027d59 (patch) | |
tree | 60535dfcd42b1dff0cbc6755a966c9e08349f23d /librazor | |
parent | 690f4c25c800b4dc42c17d72365711893d5bf376 (diff) |
Save all 3 repo files on razor_root_create
Diffstat (limited to 'librazor')
-rw-r--r-- | librazor/root.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/librazor/root.c b/librazor/root.c index c81f53f..e42362a 100644 --- a/librazor/root.c +++ b/librazor/root.c @@ -9,6 +9,9 @@ #include "razor-internal.h" static const char system_repo_filename[] = "system.repo"; +static const char system_repo_details_filename[] = "system-details.repo"; +static const char system_repo_files_filename[] = "system-files.repo"; + static const char next_repo_filename[] = "system-next.repo"; static const char razor_root_path[] = "/var/lib/razor"; @@ -25,7 +28,7 @@ razor_root_create(const char *root) { struct stat buf; struct razor_set *set; - char path[PATH_MAX]; + char path[PATH_MAX], details_path[PATH_MAX], files_path[PATH_MAX]; if (stat(root, &buf) < 0) { if (mkdir(root, 0777) < 0) { @@ -53,12 +56,18 @@ razor_root_create(const char *root) set = razor_set_create(); snprintf(path, sizeof 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); if (stat(path, &buf) == 0) { fprintf(stderr, "a razor install root is already initialized\n"); return -1; } - if (razor_set_write(set, path, RAZOR_REPO_FILE_MAIN) < 0) { + if (razor_set_write(set, path, RAZOR_REPO_FILE_MAIN) < 0 || + razor_set_write(set, details_path, RAZOR_REPO_FILE_DETAILS) < 0 || + razor_set_write(set, files_path, RAZOR_REPO_FILE_FILES) < 0 ) { fprintf(stderr, "could not write initial package set\n"); return -1; } |