def run(args, build_function, blacklisted_package_names=None):
    if (blacklisted_package_names is None):
        blacklisted_package_names = []
    if args.force_ansi_color:
        force_color()
    info('run_ros2_batch called with args:')
    for arg in vars(args):
        info(sanitize('  - {0}={1}'.format(arg, getattr(args, arg))))
    job = None
    args.workspace = ('work space' if ('workspace' in args.white_space_in) else 'ws')
    platform_name = platform.platform().lower()
    if ((args.os == 'linux') or platform_name.startswith('linux')):
        args.os = 'linux'
        from .linux_batch import LinuxBatchJob
        job = LinuxBatchJob(args)
    elif ((args.os == 'osx') or platform_name.startswith('darwin') or platform_name.startswith('macos')):
        args.os = 'osx'
        from .osx_batch import OSXBatchJob
        job = OSXBatchJob(args)
    elif ((args.os == 'windows') or platform_name.startswith('windows')):
        args.os = 'windows'
        from .windows_batch import WindowsBatchJob
        job = WindowsBatchJob(args)
    if (args.do_venv and (args.os == 'windows')):
        sys.exit('--do-venv is not supported on windows')
    os.environ['TERM'] = os.environ.get('TERM', 'xterm-256color')
    if (args.os == 'windows'):
        os.environ['ConEmuANSI'] = 'ON'
    os.environ['GIT_AUTHOR_EMAIL'] = 'example@example.com'
    os.environ['GIT_AUTHOR_NAME'] = 'nobody'
    os.environ['GIT_COMMITTER_EMAIL'] = 'example@example.com'
    os.environ['GIT_COMMITTER_NAME'] = 'nobody'
    info('Using workspace: @!{0}', fargs=(args.workspace,))
    if args.src_mounted:
        remove_folder(os.path.join(args.workspace, 'build'))
        remove_folder(os.path.join(args.workspace, 'install'))
    else:
        remove_folder(args.workspace)
    if (not os.path.isdir(args.workspace)):
        os.makedirs(args.workspace)
    job.pre()
    if ('ROS_DOMAIN_ID' not in os.environ):
        raise KeyError('ROS_DOMAIN_ID environment variable must be set')
    job.show_env()
    colcon_script = None
    if args.do_venv:
        print('# BEGIN SUBSECTION: enter virtualenv')
        if (args.os != 'linux'):
            job.run([sys.executable, '-m', 'pip', 'install', '-U', 'virtualenv==16.7.9'])
        venv_subfolder = 'venv'
        remove_folder(venv_subfolder)
        job.run([sys.executable, '-m', 'virtualenv', '--system-site-packages', '-p', sys.executable, venv_subfolder])
        venv_path = os.path.abspath(os.path.join(os.getcwd(), venv_subfolder))
        (venv, venv_python) = generated_venv_vars(venv_path)
        job.push_run(venv)
        job.push_python(venv_python)
        job.show_env()
        print('# END SUBSECTION')
    with change_directory(args.workspace):
        print('# BEGIN SUBSECTION: install Python packages')
        job.run([('"%s"' % job.python), '-m', 'pip', 'install', '-U', 'pip', 'setuptools'], shell=True)
        job.run([('"%s"' % job.python), '-c', '"import setuptools; print(setuptools.__version__)"'], shell=True)
        job.run([('"%s"' % job.python), '-m', 'pip', '--version'], shell=True)
        pip_packages = list(pip_dependencies)

        def need_package_from_pipy(pkg_name):
            try:
                importlib.import_module(pkg_name)
            except ModuleNotFoundError:
                return True
            return False
        if need_package_from_pipy('mypy'):
            if (args.ros_distro in ['foxy', 'galactic']):
                pip_packages += ['mypy==0.761']
            else:
                pip_packages += ['mypy==0.931']
        if need_package_from_pipy('lark'):
            if (args.ros_distro in ['foxy', 'galactic']):
                pip_packages += ['lark-parser==0.8.1']
            else:
                pip_packages += ['lark==1.1.1']
        if (sys.platform == 'win32'):
            pip_packages += ['git+https://github.com/osrf/pyreadline']
            if (args.cmake_build_type == 'Debug'):
                pip_packages += ['https://github.com/ros2/ros2/releases/download/cryptography-archives/cffi-1.14.0-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/cryptography-archives/cryptography-2.9.2-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/lxml-archives/lxml-4.5.1-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/netifaces-archives/netifaces-0.10.9-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/numpy-archives/numpy-1.18.4-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/typed-ast-archives/typed_ast-1.4.1-cp38-cp38d-win_amd64.whl']
            else:
                pip_packages += [f'cryptography{pip_cryptography_version}', 'lxml', 'netifaces', 'numpy']
        if (not args.colcon_branch):
            pip_packages += colcon_packages
        if (sys.platform == 'win32'):
            job.run(([('"%s"' % job.python), '-m', 'pip', 'uninstall', '-y'] + colcon_packages), shell=True)
            job.run(([('"%s"' % job.python), '-m', 'pip', 'uninstall', '-y'] + [f'cryptography{pip_cryptography_version}', 'lxml', 'numpy']), shell=True)
        pip_cmd = [('"%s"' % job.python), '-m', 'pip', 'install', '-U']
        if (args.do_venv or (sys.platform == 'win32')):
            pip_cmd.append('--force-reinstall')
        job.run((pip_cmd + pip_packages), shell=True)
        if args.do_venv:
            vcs_cmd = [('"%s"' % job.python), ('"%s"' % os.path.join(venv_path, 'bin', 'vcs'))]
        else:
            vcs_cmd = ['vcs']
        if args.colcon_branch:
            os.makedirs('colcon', exist_ok=True)
            with open('colcon/colcon.repos', 'w') as h:
                h.write('repositories:\n')
                for name in colcon_packages:
                    h.write(('  %s:\n' % name))
                    h.write('    type: git\n')
                    h.write(('    url: https://github.com/colcon/%s.git\n' % name))
            job.run((vcs_cmd + ['import', 'colcon', '--force', '--retry', '5', '--input', 'colcon/colcon.repos']), shell=True)
            job.run((vcs_cmd + ['custom', 'colcon', '--args', 'checkout', '-b', args.colcon_branch, '--track', ('origin/' + args.colcon_branch)]), exit_on_error=False)
            job.run(([('"%s"' % job.python), '-m', 'pip', 'install', '-U'] + [('colcon/%s' % name) for name in colcon_packages]), shell=True)
        if (args.do_venv and (sys.platform != 'win32')):
            colcon_script = os.path.join(venv_path, 'bin', 'colcon')
        else:
            colcon_script = which('colcon')
        args.colcon_script = colcon_script
        job.run([('"%s"' % job.python), '-m', 'pip', 'freeze', '--all'], shell=True)
        print('# END SUBSECTION')
        if args.colcon_mixin_url:
            true_cmd = ('VER>NUL' if (sys.platform == 'win32') else 'true')
            job.run([args.colcon_script, 'mixin', 'remove', 'default', '||', true_cmd], shell=True)
            job.run([args.colcon_script, 'mixin', 'add', 'default', args.colcon_mixin_url], shell=True)
            job.run([args.colcon_script, 'mixin', 'update', 'default'], shell=True)
        if (not args.src_mounted):
            print('# BEGIN SUBSECTION: import repositories')
            repos_file_urls = [args.repo_file_url]
            if (args.supplemental_repo_file_url is not None):
                repos_file_urls.append(args.supplemental_repo_file_url)
            repos_filenames = []
            for (index, repos_file_url) in enumerate(repos_file_urls):
                repos_filename = '{0:02d}-{1}'.format(index, os.path.basename(repos_file_url))
                _fetch_repos_file(repos_file_url, repos_filename, job)
                repos_filenames.append(repos_filename)
            if (not os.path.exists(args.sourcespace)):
                os.makedirs(args.sourcespace)
            for filename in repos_filenames:
                job.run((vcs_cmd + ['import', ('"%s"' % args.sourcespace), '--force', '--retry', '5', '--input', filename]), shell=True)
            print('# END SUBSECTION')
            if (args.test_branch is not None):
                print('# BEGIN SUBSECTION: checkout custom branch')
                info('Attempting to create a well known branch name for all the default branches')
                job.run((vcs_cmd + ['custom', '.', '--git', '--args', 'checkout', '-b', '__ci_default']))
                info("Attempting to switch all repositories to the '{0}' branch".format(args.test_branch))
                vcs_custom_cmd = (vcs_cmd + ['custom', '.', '--args', 'checkout', '-b', args.test_branch, '--track', ('origin/' + args.test_branch)])
                ret = job.run(vcs_custom_cmd, exit_on_error=False)
                info("'{0}' returned exit code '{1}'", fargs=(' '.join(vcs_custom_cmd), ret))
                print()
                info("Attempting to merge all repositories to the '__ci_default' branch")
                vcs_custom_cmd = (vcs_cmd + ['custom', '.', '--git', '--args', 'merge', '__ci_default'])
                ret = job.run(vcs_custom_cmd)
                info("'{0}' returned exit code '{1}'", fargs=(' '.join(vcs_custom_cmd), ret))
                print()
                print('# END SUBSECTION')
            print('# BEGIN SUBSECTION: repository hashes')
            job.run((vcs_cmd + ['log', '-l1', ('"%s"' % args.sourcespace)]), shell=True)
            print('# END SUBSECTION')
            print('# BEGIN SUBSECTION: vcs export --exact')
            job.run((vcs_cmd + ['export', '--exact', ('"%s"' % args.sourcespace)]), shell=True, exit_on_error=False)
            print('# END SUBSECTION')
        if ('rmw_connext_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['rmw_connext_cpp', 'rosidl_typesupport_connext_c', 'rosidl_typesupport_connext_cpp']
        if ('rmw_connext_dynamic_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['rmw_connext_dynamic_cpp']
        if (('rmw_connext_cpp' in args.ignore_rmw) and ('rmw_connext_dynamic_cpp' in args.ignore_rmw)):
            blacklisted_package_names += ['connext_cmake_module', 'rmw_connext_shared_cpp']
        if ('rmw_connextdds' in args.ignore_rmw):
            blacklisted_package_names += ['rti_connext_dds_cmake_module', 'rmw_connextdds_common', 'rmw_connextdds', 'rmw_connextddsmicro']
        if ('rmw_cyclonedds_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['cyclonedds', 'cyclonedds_cmake_module', 'rmw_cyclonedds_cpp']
        if ('rmw_fastrtps_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['rmw_fastrtps_cpp']
        if (('rmw_fastrtps_cpp' in args.ignore_rmw) and ('rmw_connextdds' in args.ignore_rmw)):
            blacklisted_package_names += ['rosidl_typesupport_fastrtps_c', 'rosidl_typesupport_fastrtps_cpp']
        if ('rmw_fastrtps_dynamic_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['rmw_fastrtps_dynamic_cpp']
        if (('rmw_fastrtps_cpp' in args.ignore_rmw) and ('rmw_fastrtps_dynamic_cpp' in args.ignore_rmw) and ('rmw_connextdds' in args.ignore_rmw)):
            blacklisted_package_names += ['fastrtps', 'fastrtps_cmake_module']
        if (('rmw_fastrtps_cpp' in args.ignore_rmw) and ('rmw_fastrtps_dynamic_cpp' in args.ignore_rmw)):
            blacklisted_package_names += ['rmw_fastrtps_shared_cpp']
        job.setup_env()
        if blacklisted_package_names:
            print('# BEGIN SUBSECTION: ignored packages')
            print('Trying to ignore the following packages:')
            [print(('- ' + name)) for name in blacklisted_package_names]
            output = subprocess.check_output([colcon_script, 'list', '--base-paths', args.sourcespace])
            for line in output.decode().splitlines():
                (package_name, package_path, _) = line.split('\t', 2)
                if (package_name in blacklisted_package_names):
                    marker_file = os.path.join(package_path, 'COLCON_IGNORE')
                    print(('Create marker file: ' + marker_file))
                    with open(marker_file, 'w'):
                        pass
            print('# END SUBSECTION')
        rc = build_function(args, job)
    job.post()
    return rc
def run(args, build_function, blacklisted_package_names=None):
    if (blacklisted_package_names is None):
        blacklisted_package_names = []
    if args.force_ansi_color:
        force_color()
    info('run_ros2_batch called with args:')
    for arg in vars(args):
        info(sanitize('  - {0}={1}'.format(arg, getattr(args, arg))))
    job = None
    args.workspace = ('work space' if ('workspace' in args.white_space_in) else 'ws')
    platform_name = platform.platform().lower()
    if ((args.os == 'linux') or platform_name.startswith('linux')):
        args.os = 'linux'
        from .linux_batch import LinuxBatchJob
        job = LinuxBatchJob(args)
    elif ((args.os == 'osx') or platform_name.startswith('darwin') or platform_name.startswith('macos')):
        args.os = 'osx'
        from .osx_batch import OSXBatchJob
        job = OSXBatchJob(args)
    elif ((args.os == 'windows') or platform_name.startswith('windows')):
        args.os = 'windows'
        from .windows_batch import WindowsBatchJob
        job = WindowsBatchJob(args)
    if (args.do_venv and (args.os == 'windows')):
        sys.exit('--do-venv is not supported on windows')
    os.environ['TERM'] = os.environ.get('TERM', 'xterm-256color')
    if (args.os == 'windows'):
        os.environ['ConEmuANSI'] = 'ON'
    os.environ['GIT_AUTHOR_EMAIL'] = 'example@example.com'
    os.environ['GIT_AUTHOR_NAME'] = 'nobody'
    os.environ['GIT_COMMITTER_EMAIL'] = 'example@example.com'
    os.environ['GIT_COMMITTER_NAME'] = 'nobody'
    info('Using workspace: @!{0}', fargs=(args.workspace,))
    if args.src_mounted:
        remove_folder(os.path.join(args.workspace, 'build'))
        remove_folder(os.path.join(args.workspace, 'install'))
    else:
        remove_folder(args.workspace)
    if (not os.path.isdir(args.workspace)):
        os.makedirs(args.workspace)
    job.pre()
    if ('ROS_DOMAIN_ID' not in os.environ):
        raise KeyError('ROS_DOMAIN_ID environment variable must be set')
    job.show_env()
    colcon_script = None
    if args.do_venv:
        print('# BEGIN SUBSECTION: enter virtualenv')
        if (args.os != 'linux'):
            job.run([sys.executable, '-m', 'pip', 'install', '-U', 'virtualenv==16.7.9'])
        venv_subfolder = 'venv'
        remove_folder(venv_subfolder)
        job.run([sys.executable, '-m', 'virtualenv', '--system-site-packages', '-p', sys.executable, venv_subfolder])
        venv_path = os.path.abspath(os.path.join(os.getcwd(), venv_subfolder))
        (venv, venv_python) = generated_venv_vars(venv_path)
        job.push_run(venv)
        job.push_python(venv_python)
        job.show_env()
        print('# END SUBSECTION')
    with change_directory(args.workspace):
        print('# BEGIN SUBSECTION: install Python packages')
        job.run([('"%s"' % job.python), '-m', 'pip', 'install', '-U', 'pip', 'setuptools'], shell=True)
        job.run([('"%s"' % job.python), '-c', '"import setuptools; print(setuptools.__version__)"'], shell=True)
        job.run([('"%s"' % job.python), '-m', 'pip', '--version'], shell=True)
        pip_packages = list(pip_dependencies)

        def need_package_from_pipy(pkg_name):
            try:
                importlib.import_module(pkg_name)
            except ModuleNotFoundError:
                return True
            return False
        if need_package_from_pipy('mypy'):
            if (args.ros_distro in ['foxy', 'galactic']):
                pip_packages += ['mypy==0.761']
            else:
                pip_packages += ['mypy==0.931']
        if need_package_from_pipy('lark'):
            if (args.ros_distro in ['foxy', 'galactic']):
                pip_packages += ['lark-parser==0.8.1']
            else:
                pip_packages += ['lark==1.1.1']
        if (sys.platform == 'win32'):
            pip_packages += ['git+https://github.com/osrf/pyreadline']
            if (args.cmake_build_type == 'Debug'):
                pip_packages += ['https://github.com/ros2/ros2/releases/download/cryptography-archives/cffi-1.14.0-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/cryptography-archives/cryptography-2.9.2-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/lxml-archives/lxml-4.5.1-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/netifaces-archives/netifaces-0.10.9-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/numpy-archives/numpy-1.18.4-cp38-cp38d-win_amd64.whl', 'https://github.com/ros2/ros2/releases/download/typed-ast-archives/typed_ast-1.4.1-cp38-cp38d-win_amd64.whl']
            else:
                pip_packages += [f'cryptography{pip_cryptography_version}', 'lxml', 'netifaces', 'numpy']
        if (not args.colcon_branch):
            pip_packages += colcon_packages
        if (sys.platform == 'win32'):
            job.run(([('"%s"' % job.python), '-m', 'pip', 'uninstall', '-y'] + colcon_packages), shell=True)
            job.run(([('"%s"' % job.python), '-m', 'pip', 'uninstall', '-y'] + [f'cryptography{pip_cryptography_version}', 'lxml', 'numpy']), shell=True)
        pip_cmd = [('"%s"' % job.python), '-m', 'pip', 'install', '-U']
        if (args.do_venv or (sys.platform == 'win32')):
            pip_cmd.append('--force-reinstall')
        job.run((pip_cmd + pip_packages), shell=True)
        if args.do_venv:
            vcs_cmd = [('"%s"' % job.python), ('"%s"' % os.path.join(venv_path, 'bin', 'vcs'))]
        else:
            vcs_cmd = ['vcs']
        if args.colcon_branch:
            os.makedirs('colcon', exist_ok=True)
            with open('colcon/colcon.repos', 'w') as h:
                h.write('repositories:\n')
                for name in colcon_packages:
                    h.write(('  %s:\n' % name))
                    h.write('    type: git\n')
                    h.write(('    url: https://github.com/colcon/%s.git\n' % name))
            job.run((vcs_cmd + ['import', 'colcon', '--force', '--retry', '5', '--input', 'colcon/colcon.repos']), shell=True)
            job.run((vcs_cmd + ['custom', 'colcon', '--args', 'checkout', '-b', args.colcon_branch, '--track', ('origin/' + args.colcon_branch)]), exit_on_error=False)
            job.run(([('"%s"' % job.python), '-m', 'pip', 'install', '-U'] + [('colcon/%s' % name) for name in colcon_packages]), shell=True)
        if (args.do_venv and (sys.platform != 'win32')):
            colcon_script = os.path.join(venv_path, 'bin', 'colcon')
        else:
            colcon_script = which('colcon')
        args.colcon_script = colcon_script
        job.run([('"%s"' % job.python), '-m', 'pip', 'freeze', '--all'], shell=True)
        print('# END SUBSECTION')
        if args.colcon_mixin_url:
            true_cmd = ('VER>NUL' if (sys.platform == 'win32') else 'true')
            job.run([args.colcon_script, 'mixin', 'remove', 'default', '||', true_cmd], shell=True)
            job.run([args.colcon_script, 'mixin', 'add', 'default', args.colcon_mixin_url], shell=True)
            job.run([args.colcon_script, 'mixin', 'update', 'default'], shell=True)
        if (not args.src_mounted):
            print('# BEGIN SUBSECTION: import repositories')
            repos_file_urls = [args.repo_file_url]
            if (args.supplemental_repo_file_url is not None):
                repos_file_urls.append(args.supplemental_repo_file_url)
            repos_filenames = []
            for (index, repos_file_url) in enumerate(repos_file_urls):
                repos_filename = '{0:02d}-{1}'.format(index, os.path.basename(repos_file_url))
                _fetch_repos_file(repos_file_url, repos_filename, job)
                repos_filenames.append(repos_filename)
            if (not os.path.exists(args.sourcespace)):
                os.makedirs(args.sourcespace)
            for filename in repos_filenames:
                job.run((vcs_cmd + ['import', ('"%s"' % args.sourcespace), '--force', '--retry', '5', '--input', filename]), shell=True)
            print('# END SUBSECTION')
            if (args.test_branch is not None):
                print('# BEGIN SUBSECTION: checkout custom branch')
                info('Attempting to create a well known branch name for all the default branches')
                job.run((vcs_cmd + ['custom', '.', '--git', '--args', 'checkout', '-b', '__ci_default']))
                info("Attempting to switch all repositories to the '{0}' branch".format(args.test_branch))
                vcs_custom_cmd = (vcs_cmd + ['custom', '.', '--args', 'checkout', '-b', args.test_branch, '--track', ('origin/' + args.test_branch)])
                ret = job.run(vcs_custom_cmd, exit_on_error=False)
                info("'{0}' returned exit code '{1}'", fargs=(' '.join(vcs_custom_cmd), ret))
                print()
                info("Attempting to merge all repositories to the '__ci_default' branch")
                vcs_custom_cmd = (vcs_cmd + ['custom', '.', '--git', '--args', 'merge', '__ci_default'])
                ret = job.run(vcs_custom_cmd)
                info("'{0}' returned exit code '{1}'", fargs=(' '.join(vcs_custom_cmd), ret))
                print()
                print('# END SUBSECTION')
            print('# BEGIN SUBSECTION: repository hashes')
            job.run((vcs_cmd + ['log', '-l1', ('"%s"' % args.sourcespace)]), shell=True)
            print('# END SUBSECTION')
            print('# BEGIN SUBSECTION: vcs export --exact')
            job.run((vcs_cmd + ['export', '--exact', ('"%s"' % args.sourcespace)]), shell=True, exit_on_error=False)
            print('# END SUBSECTION')
        if ('rmw_connext_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['rmw_connext_cpp', 'rosidl_typesupport_connext_c', 'rosidl_typesupport_connext_cpp']
        if ('rmw_connext_dynamic_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['rmw_connext_dynamic_cpp']
        if (('rmw_connext_cpp' in args.ignore_rmw) and ('rmw_connext_dynamic_cpp' in args.ignore_rmw)):
            blacklisted_package_names += ['connext_cmake_module', 'rmw_connext_shared_cpp']
        if ('rmw_connextdds' in args.ignore_rmw):
            blacklisted_package_names += ['rti_connext_dds_cmake_module', 'rmw_connextdds_common', 'rmw_connextdds', 'rmw_connextddsmicro']
        if ('rmw_cyclonedds_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['cyclonedds', 'cyclonedds_cmake_module', 'rmw_cyclonedds_cpp']
        if ('rmw_fastrtps_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['rmw_fastrtps_cpp']
        if (('rmw_fastrtps_cpp' in args.ignore_rmw) and ('rmw_connextdds' in args.ignore_rmw)):
            blacklisted_package_names += ['rosidl_typesupport_fastrtps_c', 'rosidl_typesupport_fastrtps_cpp']
        if ('rmw_fastrtps_dynamic_cpp' in args.ignore_rmw):
            blacklisted_package_names += ['rmw_fastrtps_dynamic_cpp']
        if (('rmw_fastrtps_cpp' in args.ignore_rmw) and ('rmw_fastrtps_dynamic_cpp' in args.ignore_rmw) and ('rmw_connextdds' in args.ignore_rmw)):
            blacklisted_package_names += ['fastrtps', 'fastrtps_cmake_module']
        if (('rmw_fastrtps_cpp' in args.ignore_rmw) and ('rmw_fastrtps_dynamic_cpp' in args.ignore_rmw)):
            blacklisted_package_names += ['rmw_fastrtps_shared_cpp']
        job.setup_env()
        if blacklisted_package_names:
            print('# BEGIN SUBSECTION: ignored packages')
            print('Trying to ignore the following packages:')
            [print(('- ' + name)) for name in blacklisted_package_names]
            output = subprocess.check_output([colcon_script, 'list', '--base-paths', args.sourcespace])
            for line in output.decode().splitlines():
                (package_name, package_path, _) = line.split('\t', 2)
                if (package_name in blacklisted_package_names):
                    marker_file = os.path.join(package_path, 'COLCON_IGNORE')
                    print(('Create marker file: ' + marker_file))
                    with open(marker_file, 'w'):
                        pass
            print('# END SUBSECTION')
        rc = build_function(args, job)
    job.post()
    return rc