Skip to content

Commit

Permalink
xtask: Fix srpm generation
Browse files Browse the repository at this point in the history
Fixing the tagged generation broke the untagged case.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Oct 23, 2023
1 parent 7c16f46 commit 01c26df
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 01c26df

Please sign in to comment.