From 0024aae6a967e1e006f594172c3e8cae5fc220ba Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Tue, 21 Jun 2022 11:06:16 +0100 Subject: [PATCH] d-bootstrap-read-beta-version-from-file Gbp-Pq: Name d-bootstrap-read-beta-version-from-file.patch --- src/bootstrap/lib.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 8569089f70..930fefd132 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -1155,15 +1155,13 @@ impl Build { return s; } - // Figure out how many merge commits happened since we branched off master. - // That's our beta number! - // (Note that we use a `..` range, not the `...` symmetric difference.) + // Debian: read beta number from "version" file, this is only available + // in the rustc upstream tarballs and not their git let count = output( - Command::new("git") - .arg("rev-list") - .arg("--count") - .arg("--merges") - .arg("refs/remotes/origin/master..HEAD") + Command::new("sed") + .arg("-re") + .arg(r"s/[0-9]+.[0-9]+.[0-9]+-beta.([0-9]+) \(.*\)/\1/g") + .arg("version") .current_dir(&self.src), ); let n = count.trim().parse().unwrap(); -- 2.30.2