appveyor: add MSI 1.7 to any Base 3.14 dependency
- add test for patch being applied
This commit is contained in:
+9
-2
@@ -228,8 +228,8 @@ class TestAddDependencyOptions(unittest.TestCase):
|
|||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
os.environ['SETUP_PATH'] = '.:appveyor'
|
os.environ['SETUP_PATH'] = '.:appveyor'
|
||||||
if os.path.exists(self.location):
|
if os.path.exists(do.cachedir):
|
||||||
shutil.rmtree(self.location, onerror=do.remove_readonly)
|
shutil.rmtree(do.cachedir, onerror=do.remove_readonly)
|
||||||
do.clear_lists()
|
do.clear_lists()
|
||||||
do.source_set('defaults')
|
do.source_set('defaults')
|
||||||
do.complete_setup('MCoreUtils')
|
do.complete_setup('MCoreUtils')
|
||||||
@@ -258,6 +258,13 @@ class TestAddDependencyOptions(unittest.TestCase):
|
|||||||
self.assertTrue(is_shallow_repo(self.location),
|
self.assertTrue(is_shallow_repo(self.location),
|
||||||
'Module not checked out shallow (requested: default=5)')
|
'Module not checked out shallow (requested: default=5)')
|
||||||
|
|
||||||
|
def test_AddMsiTo314(self):
|
||||||
|
do.complete_setup('BASE')
|
||||||
|
do.setup['BASE'] = 'R3.14.12.1'
|
||||||
|
msifile = os.path.join(do.cachedir, 'base-R3.14.12.1', 'src', 'dbtools', 'msi.c')
|
||||||
|
do.add_dependency('BASE')
|
||||||
|
self.assertTrue(os.path.exists(msifile), 'MSI was not added to Base 3.14')
|
||||||
|
|
||||||
def repo_access(dep):
|
def repo_access(dep):
|
||||||
do.set_setup_from_env(dep)
|
do.set_setup_from_env(dep)
|
||||||
do.setup.setdefault(dep + "_DIRNAME", dep.lower())
|
do.setup.setdefault(dep + "_DIRNAME", dep.lower())
|
||||||
|
|||||||
+16
-2
@@ -41,6 +41,10 @@ else:
|
|||||||
if 'CACHEDIR' in os.environ:
|
if 'CACHEDIR' in os.environ:
|
||||||
cachedir = os.environ['CACHEDIR']
|
cachedir = os.environ['CACHEDIR']
|
||||||
|
|
||||||
|
ciscriptsdir = os.path.abspath(os.path.dirname(sys.argv[0]))
|
||||||
|
if os.path.basename(ciscriptsdir) == 'appveyor':
|
||||||
|
ciscriptsdir = ciscriptsdir.rstrip(os.pathsep+'appveyor')
|
||||||
|
|
||||||
def modlist():
|
def modlist():
|
||||||
for var in ['ADD_MODULES', 'MODULES']:
|
for var in ['ADD_MODULES', 'MODULES']:
|
||||||
setup.setdefault(var, '')
|
setup.setdefault(var, '')
|
||||||
@@ -298,8 +302,18 @@ def add_dependency(dep):
|
|||||||
sp.check_call(['git', 'log', '-n1'], cwd=place)
|
sp.check_call(['git', 'log', '-n1'], cwd=place)
|
||||||
modules_to_compile.append(place)
|
modules_to_compile.append(place)
|
||||||
|
|
||||||
# force including RELEASE.local for non-base modules by overwriting their configure/RELEASE
|
if dep == 'BASE':
|
||||||
if dep != 'BASE':
|
# add MSI 1.7 to Base 3.14
|
||||||
|
versionfile = os.path.join(place, 'configure', 'CONFIG_BASE_VERSION')
|
||||||
|
if os.path.exists(versionfile):
|
||||||
|
with open(versionfile) as f:
|
||||||
|
if 'BASE_3_14=YES' in f.read():
|
||||||
|
print('Adding MSI 1.7 to {0}'.format(place))
|
||||||
|
sys.stdout.flush()
|
||||||
|
sp.check_call(['patch', '-p0', '-i', os.path.join(ciscriptsdir, 'add-msi-to-314.patch')],
|
||||||
|
cwd=place)
|
||||||
|
else:
|
||||||
|
# force including RELEASE.local for non-base modules by overwriting their configure/RELEASE
|
||||||
release = os.path.join(place, "configure", "RELEASE")
|
release = os.path.join(place, "configure", "RELEASE")
|
||||||
if os.path.exists(release):
|
if os.path.exists(release):
|
||||||
with open(release, 'w') as fout:
|
with open(release, 'w') as fout:
|
||||||
|
|||||||
Reference in New Issue
Block a user