From: Debian Rust Maintainers Date: Sat, 28 Aug 2021 09:48:11 +0000 (+0100) Subject: d-read-beta-version-from-file X-Git-Tag: archive/raspbian/1.49.0+dfsg1-1+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2712ac9c4ba267ee30b5a972ba44e4549bf726f7;p=rustc.git d-read-beta-version-from-file =================================================================== Gbp-Pq: Name d-read-beta-version-from-file.patch --- diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 890cd4e1d1..6990a89216 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -1025,15 +1025,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();