mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-28 15:39:08 +00:00
trivial: Move the metadata directory
This moves the cached metadata location from /var/lib/fwupd/remotes.d to /var/lib/fwupd/metadata The former was a bad name as it wasn't a list of remotes, and .d is the suffix for directories the user can install files into, rather than for binary content managed entirely by the daemon.
This commit is contained in:
parent
20a1b12afe
commit
1669f532be
@ -1281,6 +1281,13 @@ fu_common_get_path(FuPathKind path_kind)
|
||||
return g_build_filename(tmp, NULL);
|
||||
basedir = fu_common_get_path(FU_PATH_KIND_LOCALSTATEDIR_PKG);
|
||||
return g_build_filename(basedir, "quirks.d", NULL);
|
||||
/* /var/lib/fwupd/metadata */
|
||||
case FU_PATH_KIND_LOCALSTATEDIR_METADATA:
|
||||
tmp = g_getenv("FWUPD_LOCALSTATEDIR_METADATA");
|
||||
if (tmp != NULL)
|
||||
return g_build_filename(tmp, NULL);
|
||||
basedir = fu_common_get_path(FU_PATH_KIND_LOCALSTATEDIR_PKG);
|
||||
return g_build_filename(basedir, "metadata", NULL);
|
||||
/* /var/cache/fwupd */
|
||||
case FU_PATH_KIND_CACHEDIR_PKG:
|
||||
tmp = g_getenv("CACHE_DIRECTORY");
|
||||
|
@ -78,6 +78,8 @@ typedef guint FuEndianType;
|
||||
* @FU_PATH_KIND_DATADIR_QUIRKS: The quirks data store (IE /usr/share/fwupd/quirks.d)
|
||||
* @FU_PATH_KIND_LOCALSTATEDIR_QUIRKS: The local state directory for quirks (IE
|
||||
* /var/lib/fwupd/quirks.d)
|
||||
* @FU_PATH_KIND_LOCALSTATEDIR_METADATA: The local state directory for metadata (IE
|
||||
* /var/lib/fwupd/metadata)
|
||||
*
|
||||
* Path types to use when dynamically determining a path at runtime
|
||||
**/
|
||||
@ -103,6 +105,7 @@ typedef enum {
|
||||
FU_PATH_KIND_FIRMWARE_SEARCH,
|
||||
FU_PATH_KIND_DATADIR_QUIRKS,
|
||||
FU_PATH_KIND_LOCALSTATEDIR_QUIRKS,
|
||||
FU_PATH_KIND_LOCALSTATEDIR_METADATA,
|
||||
/*< private >*/
|
||||
FU_PATH_KIND_LAST
|
||||
} FuPathKind;
|
||||
|
@ -6594,6 +6594,7 @@ static gboolean
|
||||
fu_engine_ensure_paths_exist(GError **error)
|
||||
{
|
||||
FuPathKind path_kinds[] = {FU_PATH_KIND_LOCALSTATEDIR_QUIRKS,
|
||||
FU_PATH_KIND_LOCALSTATEDIR_METADATA,
|
||||
FU_PATH_KIND_CACHEDIR_PKG,
|
||||
FU_PATH_KIND_LAST};
|
||||
for (guint i = 0; path_kinds[i] != FU_PATH_KIND_LAST; i++) {
|
||||
|
@ -169,7 +169,6 @@ fu_remote_list_add_for_path(FuRemoteList *self, const gchar *path, GError **erro
|
||||
while ((tmp = g_dir_read_name(dir)) != NULL) {
|
||||
g_autofree gchar *filename = g_build_filename(path_remotes, tmp, NULL);
|
||||
g_autoptr(FwupdRemote) remote = fwupd_remote_new();
|
||||
g_autofree gchar *localstatedir = NULL;
|
||||
g_autofree gchar *remotesdir = NULL;
|
||||
|
||||
/* skip invalid files */
|
||||
@ -179,8 +178,7 @@ fu_remote_list_add_for_path(FuRemoteList *self, const gchar *path, GError **erro
|
||||
}
|
||||
|
||||
/* set directory to store data */
|
||||
localstatedir = fu_common_get_path(FU_PATH_KIND_LOCALSTATEDIR_PKG);
|
||||
remotesdir = g_build_filename(localstatedir, "remotes.d", NULL);
|
||||
remotesdir = fu_common_get_path(FU_PATH_KIND_LOCALSTATEDIR_METADATA);
|
||||
fwupd_remote_set_remotes_dir(remote, remotesdir);
|
||||
|
||||
/* load from keyfile */
|
||||
|
Loading…
Reference in New Issue
Block a user