appveyor: add MSI 1.7 to any Base 3.14 dependency

- add test for patch being applied
This commit is contained in:
Ralph Lange
2020-04-08 14:43:45 +02:00
parent a3532d3c55
commit 22d3a9db15
2 changed files with 25 additions and 4 deletions

View File

@@ -228,8 +228,8 @@ class TestAddDependencyOptions(unittest.TestCase):
def setUp(self):
os.environ['SETUP_PATH'] = '.:appveyor'
if os.path.exists(self.location):
shutil.rmtree(self.location, onerror=do.remove_readonly)
if os.path.exists(do.cachedir):
shutil.rmtree(do.cachedir, onerror=do.remove_readonly)
do.clear_lists()
do.source_set('defaults')
do.complete_setup('MCoreUtils')
@@ -258,6 +258,13 @@ class TestAddDependencyOptions(unittest.TestCase):
self.assertTrue(is_shallow_repo(self.location),
'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):
do.set_setup_from_env(dep)
do.setup.setdefault(dep + "_DIRNAME", dep.lower())

View File

@@ -41,6 +41,10 @@ else:
if 'CACHEDIR' in os.environ:
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():
for var in ['ADD_MODULES', 'MODULES']:
setup.setdefault(var, '')
@@ -298,8 +302,18 @@ def add_dependency(dep):
sp.check_call(['git', 'log', '-n1'], cwd=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")
if os.path.exists(release):
with open(release, 'w') as fout: