Create rpms dir on demand.
1.1 --- a/main.c Mon Apr 07 12:38:21 2008 -0400
1.2 +++ b/main.c Mon Apr 07 21:29:21 2008 -0400
1.3 @@ -9,6 +9,7 @@
1.4 #include <dirent.h>
1.5 #include <curl/curl.h>
1.6 #include <fnmatch.h>
1.7 +#include <errno.h>
1.8 #include "razor.h"
1.9 #include "razor-internal.h"
1.10
1.11 @@ -597,6 +598,11 @@
1.12 razor_set_write_to_fd(next, fd);
1.13 printf("wrote %s\n", new_path);
1.14
1.15 + if (mkdir("rpms", 0777) && errno != EEXIST) {
1.16 + fprintf(stderr, "failed to create rpms directory.\n");
1.17 + return 1;
1.18 + }
1.19 +
1.20 razor_set_diff(system, next, download_package, &errors);
1.21 if (errors > 0) {
1.22 fprintf(stderr, "failed to download %d packages\n", errors);
1.23 @@ -669,6 +675,11 @@
1.24 char url[256], file[256];
1.25 int matches = 0;
1.26
1.27 + if (mkdir("rpms", 0777) && errno != EEXIST) {
1.28 + fprintf(stderr, "failed to create rpms directory.\n");
1.29 + return 1;
1.30 + }
1.31 +
1.32 set = razor_set_open(rawhide_repo_filename);
1.33 pi = razor_package_iterator_create(set);
1.34 while (razor_package_iterator_next(pi, &package,