config_paths: remove vestiges of installable builds

Commit 3dc49d9d93 (Allow installable builds to be installed into a
specific path (#10923), 2024-12-22) added some ifdefs to use installed
config paths for installable builds that have already been installed.

The "installable" feature has been superseded by "embed-data"
which no longer uses config paths to retrieve files,
so remove those code paths. Further cleanup to follow.
This commit is contained in:
Johannes Altmanninger
2025-09-06 12:13:49 +02:00
parent e9595d4817
commit f05ad46980

View File

@@ -23,8 +23,10 @@
}; };
let argv0 = argv0.canonicalize().unwrap_or(argv0); let argv0 = argv0.canonicalize().unwrap_or(argv0);
let mut paths = ConfigPaths::default(); let mut paths = ConfigPaths::default();
#[allow(unused_mut)]
let mut done = false; let mut done = false;
let exec_path = get_executable_path(&argv0); let exec_path = get_executable_path(&argv0);
#[cfg(not(feature = "embed-data"))]
if let Ok(exec_path) = exec_path.canonicalize() { if let Ok(exec_path) = exec_path.canonicalize() {
FLOG!( FLOG!(
config, config,
@@ -54,22 +56,12 @@
// The next check is that we are in a relocatable directory tree // The next check is that we are in a relocatable directory tree
if exec_path.ends_with("bin/fish") { if exec_path.ends_with("bin/fish") {
let base_path = exec_path.parent().unwrap().parent().unwrap(); let base_path = exec_path.parent().unwrap().parent().unwrap();
#[cfg(feature = "embed-data")]
let data_dir = base_path.join("share/fish/install");
#[cfg(not(feature = "embed-data"))]
let data_dir = base_path.join("share/fish");
let locale =
(!cfg!(feature = "embed-data")).then(|| base_path.join("share/locale"));
paths = ConfigPaths { paths = ConfigPaths {
// One obvious path is ~/.local (with fish in ~/.local/bin/). data: Some(base_path.join("share/fish")),
// If we picked ~/.local/share/fish as our data path,
// we would install there and erase history.
// So let's isolate us a bit more.
data: Some(data_dir),
sysconf: base_path.join("etc/fish"), sysconf: base_path.join("etc/fish"),
doc: base_path.join("share/doc/fish"), doc: base_path.join("share/doc/fish"),
bin: Some(base_path.join("bin")), bin: Some(base_path.join("bin")),
locale, locale: Some(base_path.join("share/locale")),
} }
} }