Skip to content

Commit

Permalink
Add CLI switch for legacy overrides
Browse files Browse the repository at this point in the history
Add CLI switch to maintain compatability with legacy override
syntax via use of flag (-l, --legacy-overrides).

The first implemented example is to swtich from PV:append to PV_append.
  • Loading branch information
cph-w committed Jan 18, 2022
1 parent cd58984 commit 5f07ba3
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 5f07ba3

Please # to comment.