Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fish support on ostree #711

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/planner/ostree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ use super::{
ShellProfileLocations,
};

// Fedora's ostree's fish package creates `/etc/fish` but fish doesn't read from it.
// Its fish does read from /usr/local/share/fish/, but the directory doesn't exist --
// so we ignore it.
//
// We use this const to forcefully create this directory and add it to shell locations
// to think about updating.
//
// This may not be suitable for all possible ostree based distros, but it'll fix
// a good number of selftest failures we're seeing.
//
// See: #707
grahamc marked this conversation as resolved.
Show resolved Hide resolved
pub const OSTREE_FISH_PROFILE_LOCATION: &str = "/usr/local/share/fish/";

/// A planner suitable for immutable systems using ostree, such as Fedora Silverblue
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "cli", derive(clap::Parser))]
Expand Down Expand Up @@ -183,6 +196,16 @@ impl Planner for Ostree {
.map_err(PlannerError::Action)?
.boxed(),
);

if Path::new("/etc/fish").is_directory() {
plan.push(
CreateDirectory::plan(&OSTREE_FISH_PROFILE_LOCATION, None, None, 0o0755, true)
grahamc marked this conversation as resolved.
Show resolved Hide resolved
grahamc marked this conversation as resolved.
Show resolved Hide resolved
.await
.map_err(PlannerError::Action)?
.boxed(),
);
}

plan.push(
ConfigureNix::plan(shell_profile_locations, &self.settings)
.await
Expand Down
Loading