From 7c2a3657fb4b6a1a8f5321e418a0a6baf10627e1 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Sat, 3 Oct 2020 15:38:35 +0300 Subject: db: make --repositories-file relative to host root It used to be relative to the --root specified root, but that causes issues with relative command line filenames and is unintuitive. Update documentation accordingly. Fixes #10702. --- doc/apk.8.scd | 6 +++--- src/database.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/apk.8.scd b/doc/apk.8.scd index 7c94409..4f087c6 100644 --- a/doc/apk.8.scd +++ b/doc/apk.8.scd @@ -155,9 +155,9 @@ The following options are available for all commands. packages from cache on cache clean. *--repositories-file* _REPOFILE_ - Override repositories file, see *apk-repositories*(8). This directory - is relative to _ROOT_. This can be used to override normal system - repositories. + Override system repositories, see *apk-repositories*(8). Specifying this + option override the normal repositories file and repositories.d directory + processing. *--wait* _TIME_ Wait for TIME seconds to get an exclusive repository lock before diff --git a/src/database.c b/src/database.c index 29e8ea9..e064ca5 100644 --- a/src/database.c +++ b/src/database.c @@ -1700,7 +1700,7 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts) apk_dir_foreach_file(openat(db->root_fd, "etc/apk/repositories.d", O_RDONLY | O_CLOEXEC), add_repos_from_file, db); } else { - add_repos_from_file(db, db->root_fd, dbopts->repositories_file); + add_repos_from_file(db, AT_FDCWD, dbopts->repositories_file); } if (db->repo_update_counter) -- cgit v1.2.3-70-g09d2