Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtask: Fix srpm generation #156

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading