From 7db8a6a1d1d687a1ff09f4c0373e898639bec3c7 Mon Sep 17 00:00:00 2001 From: Boris Ranto Date: Wed, 8 Jul 2015 17:13:14 +0200 Subject: [PATCH] Remove git build-time dependency The git command is currently only needed in the src/make_version script. However, we can simply avoid it by assuming that if the git command is not installed then the current dir is not a git repo. Signed-off-by: Boris Ranto --- ceph.spec.in | 1 - src/make_version | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index 47a42dd4bbe8..ca976c5ccf49 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -57,7 +57,6 @@ Requires: systemd BuildRequires: sharutils %endif BuildRequires: gcc-c++ -BuildRequires: git BuildRequires: boost-devel BuildRequires: cryptsetup BuildRequires: gdbm diff --git a/src/make_version b/src/make_version index db7a58bdaf66..4834579d4b29 100755 --- a/src/make_version +++ b/src/make_version @@ -5,7 +5,11 @@ CEPH_VER_HEADER= NO_VERSION=0 is_git() { - type git > /dev/null 2>&1 || { echo "Could not find git command. Please install. Aborting."; exit 1; } + type git > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "Could not find git command. Assuming this is not a git repository, not updating .git_version" + return 1 + fi git status > /dev/zero 2>&1; if [ $? -ne 0 ]; then echo "This is no git repository, not updating .git_version" -- 2.47.3