[pitivi] build: Do not run git unconditionally



commit fa177a2ddb9ecf2c2a228fffa971a6b169cf1cf0
Author: Thibault Saunier <tsaunier gnome org>
Date:   Tue Aug 9 11:09:25 2016 -0400

    build: Do not run git unconditionally
    
    When running from the tarballs, it might not be present.

 configure   |    2 +-
 meson.build |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/configure b/configure
index ef446b8..4843b3e 100755
--- a/configure
+++ b/configure
@@ -51,7 +51,7 @@ def install_pre_commit_hook():
                os.path.join(ROOTDIR, ".git", "pre-commit"))
     try:
         subprocess.check_call(["pre-commit", "install"])
-    except FileNotFoundError:
+    except (FileNotFoundError, subprocess.CalledProcessError):
         print("Please install pre-commit from http://pre-commit.com/ before"
               " proposing patches")
 
diff --git a/meson.build b/meson.build
index 5ddf5d4..872d1c8 100644
--- a/meson.build
+++ b/meson.build
@@ -15,7 +15,13 @@ gst_transcoder_dep = dependency('gst-transcoder-1.0', version : '>= 1.8.1',
 
 pkgdatadir = get_option('datadir') + '/pitivi'
 
-GITVERSION = run_command('git', 'describe', '--always').stdout().strip()
+git = find_program('git', required : false)
+if git.found()
+    GITVERSION = run_command(git, 'describe', '--always').stdout().strip()
+else
+    GITVERSION = ''
+endif
+
 cdata = configuration_data()
 cdata.set('CONFIGURED_PYTHONPATH', '')
 cdata.set('CONFIGURED_GI_TYPELIB_PATH', '')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]