Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pencilcaseman committed May 30, 2024
1 parent 53af04c commit 28a3ba0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/builders/cmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ impl CMake {

if let Some(flags) = &self.configure_flags {
for flag in flags {
// cmake.arg(flag);
cmake_cmd.push_str(&format!(" {flag}"));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/flavours.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn generate(module: &Module) -> Result<Vec<(Vec<Module>, usize)>, String> {
.map(|name| {
modules
.iter()
.find(|m| &m.identifier() == name)
.find(|m| (&m.identifier() == name) || (&m.mod_name() == name))
.ok_or(format!(
"Failed to find module matching dependency '{name}'"
))
Expand Down
19 changes: 18 additions & 1 deletion src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl Module {
/// - modules: module names necessary for installation
pub fn parse(&self, flavour: &(&[Module], usize)) -> (String, String, String, Vec<String>) {
// Generate extension to build path based on flavour
let conf = config::read().unwrap();
let mut flavour_str = format!("{PATH_SEP}1{PATH_SEP}"); // '/1/' for revision

// If no class modules are required, install into `default` flavour
Expand All @@ -85,10 +86,22 @@ impl Module {
let build_path = self.build_path.clone() + &flavour_str;
let install_path = self.install_path.clone() + &flavour_str;

// let modules: Vec<String> = flavour
// .0
// .iter()
// .map(|flav| format!("{}/{}/{}", flav.class, flav.name, flav.version))
// .collect();

// List of modulefiles
let modules: Vec<String> = flavour
.0
.iter()
.map(|flav| format!("{}/{}/{}", flav.class, flav.name, flav.version))
.map(|flav| {
format!(
"{}/{}/{}/{}",
conf.modulefile_root, flav.class, flav.name, flav.version
)
})
.collect();

(flavour_str, build_path, install_path, modules)
Expand All @@ -98,6 +111,10 @@ impl Module {
format!("{}/{}/{}", self.class, self.name, self.version)
}

pub fn mod_name(&self) -> String {
format!("{}/{}", self.name, self.version)
}

/// Download the source code for the module, based on its [`Downloader`].
///
/// # Errors
Expand Down

0 comments on commit 28a3ba0

Please sign in to comment.