diff --git a/NEWS b/NEWS index 19b8a966..ca3b5c7b 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,11 @@ xbps-0.9.1 (???): + * xbps-repo(8): the 'genindex' target creates required directories + in local repositories if it's necessary. Fixes issue #3 in + github.com/vanilla/xbps. + * xbps-repo(8): the 'search' target now matches patterns in - case insensitive mode. + case insensitive mode. Fixes issue #2 on github.com/vanilla/xbps. * A bug has been fixed while updating a package and another package providing a virtual package with a greater version was available diff --git a/bin/xbps-repo/index.c b/bin/xbps-repo/index.c index 3c7db16d..4893acf8 100644 --- a/bin/xbps-repo/index.c +++ b/bin/xbps-repo/index.c @@ -281,6 +281,18 @@ xbps_repo_genindex(const char *pkgdir) rv = errno; goto out; } + /* + * If repo/ does not exist, + * create it. + */ + if ((access(path, X_OK) == -1) && errno == ENOENT) { + if (xbps_mkpath(path, 0755) == -1) { + xbps_error_printf("xbps-repo: cannot " + "create %s directory: %s\n", + path, strerror(errno)); + return -1; + } + } dirp = opendir(path); if (dirp == NULL) {