|
|
@ -1,9 +1,9 @@
|
|
|
|
|
|
|
|
/// Igloo Manifest is a subproject responsible for working with manifests.
|
|
|
|
|
|
|
|
/// Manifests are anything from config files to giant lists or ... manifests.
|
|
|
|
|
|
|
|
/// For now, all functionality is going to sit in this lib.rs until I figure out
|
|
|
|
|
|
|
|
/// how I want to structure manifests
|
|
|
|
extern crate config;
|
|
|
|
extern crate config;
|
|
|
|
|
|
|
|
|
|
|
|
use igloo_base::*;
|
|
|
|
|
|
|
|
use igloo_base::IglooErrType::*;
|
|
|
|
|
|
|
|
use config::Config;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
mod tests {
|
|
|
|
#[test]
|
|
|
|
#[test]
|
|
|
@ -12,46 +12,12 @@ mod tests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Igloo Manifest -- Responsible for all lookups in manifest files
|
|
|
|
pub mod IglooManifest
|
|
|
|
pub fn get_master_make_manifest(man: &mut Config) -> IglooErrType
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut ret: IglooErrType = ErrNone;
|
|
|
|
use igloo_base::*;
|
|
|
|
match man.merge(
|
|
|
|
use igloo_base::IglooErrType::*;
|
|
|
|
config::File::with_name(
|
|
|
|
use config::Config;
|
|
|
|
IglooEnvInfo::get_env_info().esfd.join("manifest/make-manifest.toml")
|
|
|
|
|
|
|
|
.to_str()
|
|
|
|
|
|
|
|
.unwrap()))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Ok(_v) => (),
|
|
|
|
|
|
|
|
Err(e) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
println!("Error: {:?}", e);
|
|
|
|
|
|
|
|
ret = FailedToLoadMasterMakeManifest;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn get_master_target_manifest(man: &mut Config) -> IglooErrType
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let mut ret: IglooErrType = ErrNone;
|
|
|
|
|
|
|
|
match man.merge(
|
|
|
|
|
|
|
|
config::File::with_name(
|
|
|
|
|
|
|
|
IglooEnvInfo::get_env_info().esfd.join("manifest/target-manifest.toml")
|
|
|
|
|
|
|
|
.to_str()
|
|
|
|
|
|
|
|
.unwrap()))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Ok(_v) => (),
|
|
|
|
|
|
|
|
Err(e) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
println!("Error: {:?}", e);
|
|
|
|
|
|
|
|
ret = FailedToLoadMasterTargetManifest;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/// master_mm -- Master Make Manifest
|
|
|
|
/// master_mm -- Master Make Manifest
|
|
|
|
/// master_tm -- Master Target Manifest
|
|
|
|
/// master_tm -- Master Target Manifest
|
|
|
|
/// name -- name of target
|
|
|
|
/// name -- name of target
|
|
|
@ -64,6 +30,7 @@ pub fn target_is_valid(master_mm: &Config, master_tm: &Config, name: &str)
|
|
|
|
return Err(InvalidTarget)
|
|
|
|
return Err(InvalidTarget)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let mut target_make_name: String = String::default();
|
|
|
|
match master_tm.get_table("target.make")
|
|
|
|
match master_tm.get_table("target.make")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Ok(v) =>
|
|
|
|
Ok(v) =>
|
|
|
@ -73,6 +40,8 @@ pub fn target_is_valid(master_mm: &Config, master_tm: &Config, name: &str)
|
|
|
|
Some(v) =>
|
|
|
|
Some(v) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
println!("target.make entry for \"{}\" exists!", v);
|
|
|
|
println!("target.make entry for \"{}\" exists!", v);
|
|
|
|
|
|
|
|
target_make_name = v.to_string();
|
|
|
|
|
|
|
|
println!("v.to_string() = {}", target_make_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
None =>
|
|
|
|
None =>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -118,5 +87,49 @@ pub fn target_is_valid(master_mm: &Config, master_tm: &Config, name: &str)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ok(ret)
|
|
|
|
Ok(ret)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Igloo Manifest -- Responsible for all lookups in manifest files
|
|
|
|
|
|
|
|
pub fn get_master_make_manifest(man: &mut Config) -> IglooErrType
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let mut ret: IglooErrType = ErrNone;
|
|
|
|
|
|
|
|
match man.merge(
|
|
|
|
|
|
|
|
config::File::with_name(
|
|
|
|
|
|
|
|
IglooEnvInfo::get_env_info().esfd.join("manifest/make-manifest.toml")
|
|
|
|
|
|
|
|
.to_str()
|
|
|
|
|
|
|
|
.unwrap()))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Ok(_v) => (),
|
|
|
|
|
|
|
|
Err(e) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
println!("Error: {:?}", e);
|
|
|
|
|
|
|
|
ret = FailedToLoadMasterMakeManifest;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn get_master_target_manifest(man: &mut Config) -> IglooErrType
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let mut ret: IglooErrType = ErrNone;
|
|
|
|
|
|
|
|
match man.merge(
|
|
|
|
|
|
|
|
config::File::with_name(
|
|
|
|
|
|
|
|
IglooEnvInfo::get_env_info().esfd.join("manifest/target-manifest.toml")
|
|
|
|
|
|
|
|
.to_str()
|
|
|
|
|
|
|
|
.unwrap()))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Ok(_v) => (),
|
|
|
|
|
|
|
|
Err(e) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
println!("Error: {:?}", e);
|
|
|
|
|
|
|
|
ret = FailedToLoadMasterTargetManifest;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|