From ae903bb76f83dfc66b4c0cc5d1f678081ee39d90 Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Sun, 16 Dec 2018 22:34:44 +0000 Subject: [PATCH] d-read-beta-version-from-file Gbp-Pq: Name d-read-beta-version-from-file.patch --- src/bootstrap/lib.rs | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index ab3d0b5137..bfedf832a2 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -949,41 +949,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(); -- 2.30.2