Skip to content

Commit 8592cde

Browse files
committed
Show error message on when building from git master.
1 parent 8aa10e6 commit 8592cde

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/SConscript

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,25 @@ env['cctbxobjs'] = []
4848
env['objcrystobjs'] = []
4949
env['lib_includes'] = []
5050

51+
# Check if we are in makesdist-only master branch
52+
53+
MY_GIT_MASTER_ERROR_MSG = """
54+
Source files missing. We may be in the master git branch, which,
55+
has only scripts for fetching upstream sources. Checkout one of
56+
the release tags, e.g.,
57+
58+
git checkout v1.9.8b
59+
"""
60+
skip_source_check = GetOption('clean') or GetOption('help')
61+
sources_exist = all([File(f).exists() for f in '''
62+
ObjCryst/ObjCryst/Crystal.h
63+
newmat/newmat.h
64+
cctbx/include/cctbx/coordinates.h
65+
'''.split()])
66+
if not (skip_source_check or sources_exist):
67+
print MY_GIT_MASTER_ERROR_MSG
68+
Exit(1)
69+
5170
# Subsidiary SConscripts -----------------------------------------------------
5271

5372
# These will create the built objects and header file lists.

0 commit comments

Comments
 (0)