summaryrefslogtreecommitdiffstats
path: root/debian/patches/d-bootstrap-read-beta-version-from-file.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/d-bootstrap-read-beta-version-from-file.patch')
-rw-r--r--debian/patches/d-bootstrap-read-beta-version-from-file.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/debian/patches/d-bootstrap-read-beta-version-from-file.patch b/debian/patches/d-bootstrap-read-beta-version-from-file.patch
new file mode 100644
index 000000000..a5b385d13
--- /dev/null
+++ b/debian/patches/d-bootstrap-read-beta-version-from-file.patch
@@ -0,0 +1,37 @@
+From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+Date: Thu, 14 Jul 2022 13:17:38 +0200
+Subject: d-bootstrap-read-beta-version-from-file
+
+===================================================================
+---
+ 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 68d387b..ddc92ba 100644
+--- a/src/bootstrap/lib.rs
++++ b/src/bootstrap/lib.rs
+@@ -1266,14 +1266,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