impl<'a> Rules<'a> {
fn new(build: &'a Build) -> Rules<'a> {
+ let target_env = ::std::env::var("DEB_HOST_RUST_TYPE").unwrap();
+ // rust forces us to do this dance because of lifetimes :/
+ let hosts = &build.config.host;
+ let target = match hosts.iter().position(|x| x == target_env.as_str()) {
+ None => &build.config.build,
+ Some(tidx) => hosts[tidx].as_str()
+ };
Rules {
build: build,
sbuild: Step {
stage: build.flags.stage.unwrap_or(2),
- target: &build.config.build,
+ target: target,
host: &build.config.build,
name: "",
},