From: Debian Rust Maintainers Date: Thu, 14 Jul 2022 11:17:38 +0000 (+0200) Subject: d-bootstrap-read-beta-version-from-file X-Git-Tag: archive/raspbian/1.70.0+dfsg1-2+rpi1^2~19 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cb6a74bb36156bec912b37cdff3b4b2c05327755;p=rustc.git d-bootstrap-read-beta-version-from-file =================================================================== Gbp-Pq: Name d-bootstrap-read-beta-version-from-file.patch --- diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 419bcbc63c..98af151d84 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -1264,14 +1264,15 @@ 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.) - let count = - output(self.config.git().arg("rev-list").arg("--count").arg("--merges").arg(format!( - "refs/remotes/origin/{}..HEAD", - self.config.stage0_metadata.config.nightly_branch - ))); + // 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("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(); self.prerelease_version.set(Some(n)); n