#include <assert.h>
#include <dirent.h>
#include <ctype.h>
+#include <errno.h>
#include "pool.h"
#include "repo.h"
char *fullpath;
struct parsedata pd;
+ if (!dirpath)
+ dirpath = "/etc";
+ if (flags & REPO_USE_ROOTDIR)
+ dirpath = pool_prepend_rootdir(repo->pool, dirpath);
dir = opendir(dirpath);
if (!dir)
- return 0;
+ {
+ if (flags & REPO_USE_ROOTDIR)
+ solv_free((char *)dirpath);
+ return 0;
+ }
memset(&pd, 0, sizeof(pd));
pd.repo = repo;
fullpath = join2(&pd.jd, dirpath, "/", entry->d_name);
if ((fp = fopen(fullpath, "r")) == 0)
{
- perror(fullpath);
+ pool_error(repo->pool, 0, "%s: %s", fullpath, strerror(errno));
continue;
}
add_releasefile_product(&pd, fp);
}
closedir(dir);
join_freemem(&pd.jd);
+ if (flags & REPO_USE_ROOTDIR)
+ solv_free((char *)dirpath);
if (!(flags & REPO_NO_INTERNALIZE) && (flags & REPO_REUSE_REPODATA) != 0)
repodata_internalize(repo_last_repodata(repo));