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)
committerEmilio Pozuelo Monfort <pochu@debian.org>
Fri, 28 Jul 2023 11:44:06 +0000 (12:44 +0100)
===================================================================

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

src/bootstrap/lib.rs

index 4ac857b470e806b772c3d598d01892456cc65b02..de57140a75bb5d470739bf89b6660ac61a877aac 100644 (file)
@@ -1267,15 +1267,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();