From 091465f660b675d28cf6175ebf231b5e9e5700fb Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 17 Apr 2026 11:46:05 +0200 Subject: [PATCH] Skip XDG base directories --- Cargo.lock | 7 ------- Cargo.toml | 1 - upki/Cargo.toml | 7 +------ upki/src/lib.rs | 21 --------------------- 4 files changed, 1 insertion(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d0bbf801..8158ec7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2675,7 +2675,6 @@ dependencies = [ "toml 1.1.2+spec-1.1.0", "tracing", "tracing-subscriber", - "xdg", ] [[package]] @@ -3378,12 +3377,6 @@ dependencies = [ "time", ] -[[package]] -name = "xdg" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fb433233f2df9344722454bc7e96465c9d03bff9d77c248f9e7523fe79585b5" - [[package]] name = "yasna" version = "0.5.2" diff --git a/Cargo.toml b/Cargo.toml index 6594d9c4..fa334d5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,6 @@ toml = "1" tracing = "0.1" tracing-subscriber = "0.3" x509-parser = "0.18" -xdg = "3.0.0" cbindgen = "0.29" webpki-ccadb = "0.2.1" webpki-roots = "1" diff --git a/upki/Cargo.toml b/upki/Cargo.toml index 43ab623d..56d1ec9a 100644 --- a/upki/Cargo.toml +++ b/upki/Cargo.toml @@ -14,6 +14,7 @@ base64.workspace = true chrono.workspace = true clap.workspace = true clubcard-crlite.workspace = true +directories.workspace = true eyre.workspace = true hex.workspace = true reqwest.workspace = true @@ -27,12 +28,6 @@ toml.workspace = true tracing.workspace = true tracing-subscriber.workspace = true -[target.'cfg(target_os = "linux")'.dependencies] -xdg.workspace = true - -[target.'cfg(not(target_os = "linux"))'.dependencies] -directories.workspace = true - [dev-dependencies] insta.workspace = true insta-cmd.workspace = true diff --git a/upki/src/lib.rs b/upki/src/lib.rs index a1d22979..50a561e8 100644 --- a/upki/src/lib.rs +++ b/upki/src/lib.rs @@ -95,27 +95,6 @@ impl AsRef for ConfigPath { } } -#[cfg(target_os = "linux")] -mod platform { - use xdg::BaseDirectories; - - use super::*; - - pub(super) fn find_config_file() -> Result { - let bd = BaseDirectories::with_prefix(PREFIX); - bd.find_config_file(CONFIG_FILE) - .or_else(|| bd.get_config_file(CONFIG_FILE)) - .ok_or(Error::NoConfigDirectoryFound) - } - - pub(super) fn default_cache_dir() -> Result { - BaseDirectories::with_prefix(PREFIX) - .get_cache_home() - .ok_or(Error::NoCacheDirectoryFound) - } -} - -#[cfg(not(target_os = "linux"))] mod platform { use directories::ProjectDirs;