d-read-beta-version-from-file
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Sat, 28 Aug 2021 09:48:11 +0000 (10:48 +0100)
committerXimin Luo <infinity0@debian.org>
Sat, 28 Aug 2021 09:48:11 +0000 (10:48 +0100)
===================================================================

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

src/bootstrap/lib.rs

index 890cd4e1d1459aa8877ad1f03a5981b595eb194b..6990a8921624b08c4f925392cad71e432919a1bd 100644 (file)
@@ -1025,15 +1025,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();