From: Debian Rust Maintainers Date: Thu, 30 May 2019 04:52:37 +0000 (+0100) Subject: d-read-beta-version-from-file X-Git-Tag: archive/raspbian/1.34.2+dfsg1-1+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=200ce4f34a66c8ac18ae34a19d399edbc6c532d9;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 7e6fbdff12..ff3aae1d5e 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -930,41 +930,13 @@ impl Build { return s } - let beta = output( - Command::new("git") - .arg("ls-remote") - .arg("origin") - .arg("beta") - .current_dir(&self.src) - ); - let beta = beta.trim().split_whitespace().next().unwrap(); - let master = output( - Command::new("git") - .arg("ls-remote") - .arg("origin") - .arg("master") - .current_dir(&self.src) - ); - let master = master.trim().split_whitespace().next().unwrap(); - - // Figure out where the current beta branch started. - let base = output( - Command::new("git") - .arg("merge-base") - .arg(beta) - .arg(master) - .current_dir(&self.src), - ); - let base = base.trim(); - - // Next figure out how many merge commits happened since we branched off - // beta. That's our beta number! + // 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(format!("{}...HEAD", base)) + 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();