~danyspin97/initrz

9e446db96a1636009224eb95b31e623953c7e86f — Danilo Spinella 5 months ago 2b4770b
initrz: Reverse the order of module dependencies

The correct order is from right to left, so reverse the
dependencies read from modules.dep.
1 files changed, 4 insertions(+), 2 deletions(-)

M src/initrz/src/module_loader.rs
M src/initrz/src/module_loader.rs => src/initrz/src/module_loader.rs +4 -2
@@ 60,6 60,8 @@ pub fn parse_module_dep(filename: &Path) -> Result<HashMap<String, Module>> {
                        warn!("{} is not a valid module name", dep);
                    }
                }

                deps.reverse();
            }
            Ok((
                module,


@@ 210,9 212,9 @@ mod tests {
        let mut expected_map = HashMap::new();

        let mut mhi_deps: Vec<String> = Vec::new();
        mhi_deps.push("qrtr".to_string());
        mhi_deps.push("ns".to_string());
        mhi_deps.push("mhi".to_string());
        mhi_deps.push("ns".to_string());
        mhi_deps.push("qrtr".to_string());
        expected_map.insert(
            "qrtr-mhi".to_string(),
            Module {