Skip to content

Commit

Permalink
Merge pull request #156 from cgwalters/package-srpm-fix
Browse files Browse the repository at this point in the history
xtask: Fix srpm generation
  • Loading branch information
cgwalters authored Oct 23, 2023
2 parents 7c16f46 + 01c26df commit d87aff8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions xtask/src/xtask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ fn gitrev(sh: &Shell) -> Result<String> {
{
Ok(gitrev_to_version(&rev))
} else {
let mut desc = cmd!(sh, "git describe --tags --always").read()?;
desc.insert_str(0, "0.");
// Grab the abbreviated commit
let abbrev_commit = cmd!(sh, "git rev-parse HEAD")
.read()?
.chars()
.take(10)
.collect::<String>();
let timestamp = git_timestamp(sh)?;
// We always inject the timestamp first to ensure that newer is better.
Ok(format!("{timestamp}.{desc}"))
Ok(format!("{timestamp}.g{abbrev_commit}"))
}
}

Expand Down

0 comments on commit d87aff8

Please sign in to comment.