Skip to content

Commit

Permalink
Merge pull request #44 from zuma-array/legacy-overrides
Browse files Browse the repository at this point in the history
Add CLI switch for legacy overrides
  • Loading branch information
cardoe authored Jan 18, 2022
2 parents cd58984 + 5f07ba3 commit 3851a2d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ struct Args {
/// Reproducible mode: Output exact git references for git projects
#[structopt(short = "R")]
reproducible: bool,

/// Legacy Overrides: Use legacy override syntax
#[structopt(short = "l", long = "--legacy-overrides")]
legacy_overrides: bool,
}

#[derive(StructOpt, Debug)]
Expand Down Expand Up @@ -356,9 +360,14 @@ fn real_main(options: Args, config: &mut Config) -> CliResult {
// if this is not a tag we need to include some data about the version in PV so that
// the sstate cache remains valid
let git_srcpv = if !project_repo.tag && project_repo.rev.len() > 10 {
let mut pv_append_key = "PV:append";
// Override PV override with legacy syntax if flagged
if options.legacy_overrides {
pv_append_key = "PV_append";
}
// we should be using ${SRCPV} here but due to a bitbake bug we cannot. see:
// https://github.com/meta-rust/meta-rust/issues/136
format!("PV:append = \".AUTOINC+{}\"", &project_repo.rev[..10])
format!("{} = \".AUTOINC+{}\"", pv_append_key, &project_repo.rev[..10])
} else {
// its a tag so nothing needed
"".into()
Expand Down

0 comments on commit 3851a2d

Please # to comment.