d-bootstrap-read-beta-version-from-file
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Tue, 8 Mar 2022 10:51:18 +0000 (10:51 +0000)
committerXimin Luo <infinity0@debian.org>
Tue, 8 Mar 2022 10:51:18 +0000 (10:51 +0000)
Gbp-Pq: Name d-bootstrap-read-beta-version-from-file.patch

src/bootstrap/lib.rs

index 2d4e15278972469bacd9de44c1b11b34fcaf39f5..2f435601c5e42c4c9ded381202731d18ad3091d6 100644 (file)
@@ -1161,15 +1161,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();