1 From 3bbc396c4ddc8a5e26f7776155bb366c8d47c440 Mon Sep 17 00:00:00 2001
2 From: Bob van der Linden <bobvanderlinden@gmail.com>
3 Date: Thu, 9 Feb 2023 16:55:00 +0100
4 Subject: [PATCH 2/2] remove dependency on git
7 librubyfmt/build.rs | 35 +++--------------------------------
8 1 file changed, 3 insertions(+), 32 deletions(-)
10 diff --git a/librubyfmt/build.rs b/librubyfmt/build.rs
11 index ef94c09..4668785 100644
12 --- a/librubyfmt/build.rs
13 +++ b/librubyfmt/build.rs
14 @@ -26,27 +26,9 @@ fn main() -> Output {
15 let path = std::env::current_dir()?;
16 let ruby_checkout_path = path.join("ruby_checkout");
18 - let old_checkout_sha = if ruby_checkout_path.join(ripper).exists() {
19 - Some(get_ruby_checkout_sha())
24 - let _ = Command::new("git")
25 - .args(&["submodule", "update", "--init"])
28 - let new_checkout_sha = get_ruby_checkout_sha();
30 - // Only rerun this build if the ruby_checkout has changed
31 - match old_checkout_sha {
32 - Some(old_sha) if old_sha == new_checkout_sha => {}
34 - make_configure(&ruby_checkout_path)?;
35 - run_configure(&ruby_checkout_path)?;
36 - build_ruby(&ruby_checkout_path)?;
39 + make_configure(&ruby_checkout_path)?;
40 + run_configure(&ruby_checkout_path)?;
41 + build_ruby(&ruby_checkout_path)?;
44 .file("src/rubyfmt.c")
45 @@ -152,14 +134,3 @@ fn check_process_success(command: &str, code: ExitStatus) -> Output {
49 -fn get_ruby_checkout_sha() -> String {
52 - .args(&["rev-parse", "HEAD"])
53 - .current_dir("./ruby_checkout")
55 - .expect("git rev-parse shouldn't fail")
58 - .expect("output should be valid utf8")