d-bootstrap-read-beta-version-from-file
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Thu, 14 Jul 2022 11:17:38 +0000 (13:17 +0200)
committerFabian Gruenbichler <debian@fabian.gruenbichler.email>
Mon, 10 Oct 2022 18:19:05 +0000 (19:19 +0100)
===================================================================

Gbp-Pq: Name d-bootstrap-read-beta-version-from-file.patch

src/bootstrap/lib.rs

index 570a61742bcf3deea8220abf009d02b420f8188f..6853feae6cf09b52f4cf1d1211aa309145c17e92 100644 (file)
@@ -1230,15 +1230,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();