Skip to content

Commit d87aff8

Browse files
authored
Merge pull request #156 from cgwalters/package-srpm-fix
xtask: Fix srpm generation
2 parents 7c16f46 + 01c26df commit d87aff8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

xtask/src/xtask.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,15 @@ fn gitrev(sh: &Shell) -> Result<String> {
6464
{
6565
Ok(gitrev_to_version(&rev))
6666
} else {
67-
let mut desc = cmd!(sh, "git describe --tags --always").read()?;
68-
desc.insert_str(0, "0.");
67+
// Grab the abbreviated commit
68+
let abbrev_commit = cmd!(sh, "git rev-parse HEAD")
69+
.read()?
70+
.chars()
71+
.take(10)
72+
.collect::<String>();
6973
let timestamp = git_timestamp(sh)?;
7074
// We always inject the timestamp first to ensure that newer is better.
71-
Ok(format!("{timestamp}.{desc}"))
75+
Ok(format!("{timestamp}.g{abbrev_commit}"))
7276
}
7377
}
7478

0 commit comments

Comments
 (0)