Lines Matching +full:repo +full:- +full:path

5 # SPDX-License-Identifier: Apache-2.0
11 Include file is generated for Kconfig using --kconfig-out.
12 A <name>:<path> text file is generated for use with CMake using --cmake-out.
14 Using --twister-out <filename> an argument file for twister script will
28 from pathlib import Path, PurePath
57 cmake-ext:
61 kconfig-ext:
65 sysbuild-cmake:
68 sysbuild-kconfig:
71 sysbuild-cmake-ext:
75 sysbuild-kconfig-ext:
83 - type: str
113 - type: str
118 - type: str
123 - type: str
128 - type: map
130 path:
143 license-path:
152 doc-url:
159 external-references:
163 - type: str
167 # Path to the blobs folder
179 checkfile = Path(module_path) / setting / filename
181 checkfile = Path(module_path) / setting
195 if Path(module_yml).is_file():
196 with Path(module_yml).open('r') as f:
207 meta['name-sanitized'] = re.sub('[^a-zA-Z0-9]', '_', meta['name'])
210 if Path(module_path.joinpath('zephyr/CMakeLists.txt')).is_file() and \
211 Path(module_path.joinpath('zephyr/Kconfig')).is_file():
213 'name-sanitized': re.sub('[^a-zA-Z0-9]', '_', module_path.name),
224 cmake_extern = section.get('cmake-ext', False)
229 "${ZEPHYR_" + meta['name-sanitized'].upper() + "_CMAKE_DIR}"))
237 cmake_path = os.path.join(module, cmake_setting or 'zephyr')
238 cmake_file = os.path.join(cmake_path, 'CMakeLists.txt')
239 if os.path.isfile(cmake_file):
243 Path(cmake_path).resolve().as_posix()))
255 cmake_extern = section.get('sysbuild-cmake-ext', False)
260 "${SYSBUILD_" + meta['name-sanitized'].upper() + "_CMAKE_DIR}"))
262 cmake_setting = section.get('sysbuild-cmake', None)
271 cmake_path = os.path.join(module, cmake_setting or 'zephyr')
272 cmake_file = os.path.join(cmake_path, 'CMakeLists.txt')
273 if os.path.isfile(cmake_file):
277 Path(cmake_path).resolve().as_posix()))
300 def get_blob_status(path, sha256): argument
301 if not path.is_file():
303 with path.open('rb') as f:
318 blobs_path = Path(module) / MODULE_BLOBS_PATH
321 blob['abspath'] = blobs_path / Path(blob['path'])
328 def kconfig_snippet(meta, path, kconfig_file=None, blobs=False, sysbuild=False): argument
330 name_sanitized = meta['name-sanitized']
332 snippet = [f'menu "{name} ({path.as_posix()})"',
342 snippet.insert(-1, ' select TAINT_BLOBS')
352 kconfig_extern = section.get('kconfig-ext', False)
362 kconfig_file = os.path.join(module, kconfig_setting or 'zephyr/Kconfig')
363 if os.path.isfile(kconfig_file):
364 return kconfig_snippet(meta, module_path, Path(kconfig_file),
367 name_sanitized = meta['name-sanitized']
377 kconfig_extern = section.get('sysbuild-kconfig-ext', False)
381 kconfig_setting = section.get('sysbuild-kconfig', None)
388 kconfig_file = os.path.join(module, kconfig_setting)
389 if os.path.isfile(kconfig_file):
390 return kconfig_snippet(meta, module_path, Path(kconfig_file))
392 name_sanitized = meta['name-sanitized']
407 dir = os.path.join(module, pth)
408 out += '-T\n{}\n'.format(PurePath(os.path.abspath(dir))
413 dir = os.path.join(module, pth)
414 out += '--board-root\n{}\n'.format(PurePath(os.path.abspath(dir))
421 def git_revision(path): argument
422 rc = subprocess.Popen(['git', 'rev-parse', '--is-inside-work-tree'],
425 cwd=path).wait()
427 # A git repo.
428 popen = subprocess.Popen(['git', 'rev-parse', 'HEAD'],
431 cwd=path)
433 stdout = stdout.decode('utf-8')
438 rc = subprocess.Popen(['git', 'diff-index', '--quiet', 'HEAD',
439 '--'],
442 cwd=path).wait()
444 return revision + '-dirty', True
448 def git_remote(path): argument
452 cwd=path)
454 stdout = stdout.decode('utf-8')
465 popen = subprocess.Popen(['git', 'remote', 'get-url', remote],
468 cwd=path)
470 stdout = stdout.decode('utf-8')
477 def git_tags(path, revision): argument
481 popen = subprocess.Popen(['git', '-P', 'tag', '--points-at', revision],
484 cwd=path)
486 stdout = stdout.decode('utf-8')
495 path = PurePath(project_path).as_posix()
497 revision, dirty = git_revision(path)
499 remote = git_remote(path)
500 tags = git_tags(path, revision)
502 meta_project = {'path': path,
515 projects = [ prj for prj in meta_projects_list[1:] if prj["path"] == project_path ]
526 # - zephyr: path and revision
527 # - modules: name, path, and revision
528 # - west-projects: path and revision
542 zephyr_project['revision'] += '-off'
574 manifest_project["revision"] += "-off"
588 …t("remote") or project.sha(MANIFEST_REV_BRANCH) != meta_project['revision'].removesuffix("-dirty"):
596 meta_project['revision'] += '-off'
613 # It allows to have the "-off" flag since `modules` variable` does not provide URL/remote
634 zephyr_revision += '-dirty'
636 zephyr_revision += '-extra'
638 zephyr_revision += '-off'
644 manifest_revision += '-dirty'
646 manifest_revision += '-extra'
648 manifest_revision += '-off'
686 manifest_path = manifest.path
772 parser.add_argument('--kconfig-out',
775 parser.add_argument('--twister-out',
778 parser.add_argument('--cmake-out',
779 help="""File to write with resulting <name>:<path>
781 parser.add_argument('--sysbuild-kconfig-out',
784 parser.add_argument('--sysbuild-cmake-out',
785 help="""File to write with resulting <name>:<path>
787 parser.add_argument('--meta-out',
792 parser.add_argument('--meta-state-propagate', action='store_true',
796 parser.add_argument('--settings-out',
799 parser.add_argument('-m', '--modules', nargs='+',
802 parser.add_argument('-x', '--extra-modules', nargs='+',
804 parser.add_argument('-z', '--zephyr-base',
805 help='Path to zephyr repository')
829 with open(args.kconfig_out, 'w', encoding="utf-8") as fp:
833 with open(args.cmake_out, 'w', encoding="utf-8") as fp:
837 with open(args.sysbuild_kconfig_out, 'w', encoding="utf-8") as fp:
841 with open(args.sysbuild_cmake_out, 'w', encoding="utf-8") as fp:
845 with open(args.settings_out, 'w', encoding="utf-8") as fp:
847 # WARNING. THIS FILE IS AUTO-GENERATED. DO NOT MODIFY!
859 with open(args.twister_out, 'w', encoding="utf-8") as fp:
866 with open(args.meta_out, 'w', encoding="utf-8") as fp: