bd0d41a
From 7c461e2c251f7c2998ad1e6d000e152b7987ccea Mon Sep 17 00:00:00 2001
4cd5da9
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
4cd5da9
Date: Wed, 11 Apr 2018 05:15:58 -0400
bd0d41a
Subject: [PATCH 1/2] Skip version checks.
4cd5da9
4cd5da9
We're building from a tarball, not a git repo, so we can't check if the
4cd5da9
script version matches the git version anyway.
4cd5da9
4cd5da9
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
4cd5da9
---
5182ee1
 Makefile     | 31 -------------------------------
907a6aa
 tests/cmd.py | 44 --------------------------------------------
907a6aa
 2 files changed, 75 deletions(-)
5182ee1
 delete mode 100644 tests/cmd.py
4cd5da9
3d1868c
diff --git a/Makefile b/Makefile
bd0d41a
index 32e3a36..6e3414d 100644
3d1868c
--- a/Makefile
3d1868c
+++ b/Makefile
bd0d41a
@@ -1,36 +1,5 @@
5182ee1
 SYSTEM = $(shell python2.7 -c 'import platform; print platform.system()')
5182ee1
 include helper/GIT-VERSION.mk
5182ee1
-ifeq ($(SYSTEM),Windows)
5182ee1
-GIT_REPO = https://github.com/git-for-windows/git
5182ee1
-GIT_VERSION := $(WINDOWS_GIT_VERSION)
5182ee1
-else
5182ee1
-GIT_REPO = $(shell sed -n 's/.*url = //p' .gitmodules)
5182ee1
-endif
5182ee1
-SUBMODULE_STATUS := $(shell git submodule status git-core 2> /dev/null || echo no)
5182ee1
-
5182ee1
-define exec
5182ee1
-$$(shell echo $1 >&2)
5182ee1
-ifeq (fail,$$(shell $1 >&2 || echo fail))
5182ee1
-$$(error failed)
5182ee1
-endif
5182ee1
-endef
5182ee1
-
3d1868c
-ifeq ($(SUBMODULE_STATUS),no)
3d1868c
-$(eval $(call exec,git clone -n $(GIT_REPO) git-core))
3d1868c
-$(eval $(call exec,git -C git-core checkout $(GIT_VERSION)))
3d1868c
-else
5182ee1
-ifneq ($(shell git -C git-core rev-parse HEAD),$(shell git -C git-core rev-parse --revs-only $(GIT_VERSION)^{commit}))
3d1868c
-$(eval $(call exec,git submodule update --init))
3d1868c
-ifeq ($(SYSTEM),Windows)
3d1868c
-$(eval $(call exec,git -C git-core remote add git4win $(GIT_REPO)))
5182ee1
-$(eval $(call exec,git -C git-core fetch git4win --tags))
3d1868c
-$(eval $(call exec,git -C git-core checkout $(GIT_VERSION)))
3d1868c
-endif
3d1868c
-endif
3d1868c
-endif
5182ee1
-ifneq ($(shell git -C git-core rev-parse HEAD),$(shell git -C git-core rev-parse --revs-only $(GIT_VERSION)^{commit}))
3d1868c
-$(error git-core is not checked out at $(GIT_VERSION))
3d1868c
-endif
5182ee1
 
a7e3994
 .PHONY: helper
3d1868c
 helper:
5182ee1
diff --git a/tests/cmd.py b/tests/cmd.py
5182ee1
deleted file mode 100644
907a6aa
index 5e98392..0000000
5182ee1
--- a/tests/cmd.py
5182ee1
+++ /dev/null
907a6aa
@@ -1,44 +0,0 @@
907a6aa
-from __future__ import absolute_import, unicode_literals
5182ee1
-import os
5182ee1
-import unittest
5182ee1
-from cinnabar.cmd.util import Version as CmdVersion
5182ee1
-from cinnabar.git import (
5182ee1
-    Git,
5182ee1
-    split_ls_tree,
5182ee1
-)
5182ee1
-from cinnabar.util import one
5182ee1
-from distutils.version import StrictVersion
5182ee1
-
5182ee1
-
5182ee1
-class Version(StrictVersion):
5182ee1
-    def __init__(self, v):
907a6aa
-        if isinstance(v, bytes):
907a6aa
-            v = v.decode('ascii')
5182ee1
-        if v.endswith('a'):
5182ee1
-            v += '0'
5182ee1
-        StrictVersion.__init__(self, v)
5182ee1
-
5182ee1
-
5182ee1
-class TestVersion(unittest.TestCase):
5182ee1
-    def test_cinnabar_version(self):
5182ee1
-        desc = one(Git.iter('describe', '--tags', 'HEAD'))
5182ee1
-        version = Version(CmdVersion.cinnabar_version())
907a6aa
-        if b'-' in desc:
907a6aa
-            last_tag, n, sha1 = desc.rsplit(b'-', 2)
5182ee1
-            self.assertGreater(version, Version(last_tag))
5182ee1
-        else:
5182ee1
-            self.assertEqual(version, Version(desc))
5182ee1
-
5182ee1
-    def test_module_version(self):
5182ee1
-        module = one(Git.iter(
5182ee1
-            'ls-tree', 'HEAD', 'cinnabar',
5182ee1
-            cwd=os.path.join(os.path.dirname(__file__), '..')))
5182ee1
-        self.assertEqual(CmdVersion.module_version(),
907a6aa
-                         split_ls_tree(module)[2].decode('ascii'))
5182ee1
-
5182ee1
-    def test_helper_version(self):
5182ee1
-        helper = one(Git.iter(
5182ee1
-            'ls-tree', 'HEAD', 'helper',
5182ee1
-            cwd=os.path.join(os.path.dirname(__file__), '..')))
5182ee1
-        self.assertEqual(CmdVersion.helper_version()[1],
907a6aa
-                         split_ls_tree(helper)[2].decode('ascii'))
4cd5da9
-- 
907a6aa
2.21.1
4cd5da9