Fix issue where multiple dist files were not being produced for comma separated formats value
This commit is contained in:
parent
39c751b94c
commit
cc54284885
|
@ -29,6 +29,7 @@ from mesonbuild import mlog, build
|
||||||
from .scripts.meson_exe import run_exe
|
from .scripts.meson_exe import run_exe
|
||||||
|
|
||||||
archive_choices = ['gztar', 'xztar', 'zip']
|
archive_choices = ['gztar', 'xztar', 'zip']
|
||||||
|
|
||||||
archive_extension = {'gztar': '.tar.gz',
|
archive_extension = {'gztar': '.tar.gz',
|
||||||
'xztar': '.tar.xz',
|
'xztar': '.tar.xz',
|
||||||
'zip': '.zip'}
|
'zip': '.zip'}
|
||||||
|
@ -36,8 +37,8 @@ archive_extension = {'gztar': '.tar.gz',
|
||||||
def add_arguments(parser):
|
def add_arguments(parser):
|
||||||
parser.add_argument('-C', default='.', dest='wd',
|
parser.add_argument('-C', default='.', dest='wd',
|
||||||
help='directory to cd into before running')
|
help='directory to cd into before running')
|
||||||
parser.add_argument('--formats', default='xztar', choices=archive_choices,
|
parser.add_argument('--formats', default='xztar',
|
||||||
help='Comma separated list of archive types to create.')
|
help='Comma separated list of archive types to create. Supports xztar (default), gztar, and zip.')
|
||||||
parser.add_argument('--include-subprojects', action='store_true',
|
parser.add_argument('--include-subprojects', action='store_true',
|
||||||
help='Include source code of subprojects that have been used for the build.')
|
help='Include source code of subprojects that have been used for the build.')
|
||||||
parser.add_argument('--no-tests', action='store_true',
|
parser.add_argument('--no-tests', action='store_true',
|
||||||
|
|
|
@ -3230,6 +3230,8 @@ class AllPlatformTests(BasePlatformTests):
|
||||||
'''))
|
'''))
|
||||||
xz_distfile = os.path.join(self.distdir, 'disttest-1.4.3.tar.xz')
|
xz_distfile = os.path.join(self.distdir, 'disttest-1.4.3.tar.xz')
|
||||||
xz_checksumfile = xz_distfile + '.sha256sum'
|
xz_checksumfile = xz_distfile + '.sha256sum'
|
||||||
|
gz_distfile = os.path.join(self.distdir, 'disttest-1.4.3.tar.gz')
|
||||||
|
gz_checksumfile = gz_distfile + '.sha256sum'
|
||||||
zip_distfile = os.path.join(self.distdir, 'disttest-1.4.3.zip')
|
zip_distfile = os.path.join(self.distdir, 'disttest-1.4.3.zip')
|
||||||
zip_checksumfile = zip_distfile + '.sha256sum'
|
zip_checksumfile = zip_distfile + '.sha256sum'
|
||||||
vcs_init(project_dir)
|
vcs_init(project_dir)
|
||||||
|
@ -3243,12 +3245,32 @@ class AllPlatformTests(BasePlatformTests):
|
||||||
self.build('dist')
|
self.build('dist')
|
||||||
self.assertPathExists(xz_distfile)
|
self.assertPathExists(xz_distfile)
|
||||||
self.assertPathExists(xz_checksumfile)
|
self.assertPathExists(xz_checksumfile)
|
||||||
|
self.assertPathDoesNotExist(gz_distfile)
|
||||||
|
self.assertPathDoesNotExist(gz_checksumfile)
|
||||||
self.assertPathDoesNotExist(zip_distfile)
|
self.assertPathDoesNotExist(zip_distfile)
|
||||||
self.assertPathDoesNotExist(zip_checksumfile)
|
self.assertPathDoesNotExist(zip_checksumfile)
|
||||||
|
self._run(self.meson_command + ['dist', '--formats', 'gztar'],
|
||||||
|
workdir=self.builddir)
|
||||||
|
self.assertPathExists(gz_distfile)
|
||||||
|
self.assertPathExists(gz_checksumfile)
|
||||||
self._run(self.meson_command + ['dist', '--formats', 'zip'],
|
self._run(self.meson_command + ['dist', '--formats', 'zip'],
|
||||||
workdir=self.builddir)
|
workdir=self.builddir)
|
||||||
self.assertPathExists(zip_distfile)
|
self.assertPathExists(zip_distfile)
|
||||||
self.assertPathExists(zip_checksumfile)
|
self.assertPathExists(zip_checksumfile)
|
||||||
|
os.remove(xz_distfile)
|
||||||
|
os.remove(xz_checksumfile)
|
||||||
|
os.remove(gz_distfile)
|
||||||
|
os.remove(gz_checksumfile)
|
||||||
|
os.remove(zip_distfile)
|
||||||
|
os.remove(zip_checksumfile)
|
||||||
|
self._run(self.meson_command + ['dist', '--formats', 'xztar,gztar,zip'],
|
||||||
|
workdir=self.builddir)
|
||||||
|
self.assertPathExists(xz_distfile)
|
||||||
|
self.assertPathExists(xz_checksumfile)
|
||||||
|
self.assertPathExists(gz_distfile)
|
||||||
|
self.assertPathExists(gz_checksumfile)
|
||||||
|
self.assertPathExists(zip_distfile)
|
||||||
|
self.assertPathExists(zip_checksumfile)
|
||||||
|
|
||||||
if include_subprojects:
|
if include_subprojects:
|
||||||
# Verify that without --include-subprojects we have files from
|
# Verify that without --include-subprojects we have files from
|
||||||
|
|
Loading…
Reference in New Issue