Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app: more versatile initialization for path in config #775

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/west/app/project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018, 2019 Nordic Semiconductor ASA

Check notice on line 1 in src/west/app/project.py

View workflow job for this annotation

GitHub Actions / Check file src/west/app/project.py

Unformatted file

Consider running 'ruff format src/west/app/project.py' See https://github.com/zephyrproject-rtos/west/actions/runs/12395463549 for more details
# Copyright 2018, 2019 Foundries.io
#
# SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -204,13 +204,13 @@
help='''manifest repository branch or tag name
to check out first; cannot be combined with -l''')
parser.add_argument('--mf', '--manifest-file', dest='manifest_file',
help='manifest file name to use')
help='manifest file name to use, relative to "directory"')
parser.add_argument('-l', '--local', action='store_true',
help='''use "directory" as an existing local
manifest repository instead of cloning one from
MANIFEST_URL; .west is created next to "directory"
in this case, and manifest.path points at
"directory"''')
help='''use "directory" to create the workspace
from a local manifest directory, instead of cloning
one from MANIFEST_URL; .west is created next to
"directory" in this case, and manifest.path points at
the manifest file location.''')
parser.add_argument('--rename-delay', type=int,
help='''Number of seconds to wait before renaming
some temporary directories. Some filesystems like NTFS
Expand Down Expand Up @@ -273,7 +273,7 @@
manifest_filename = args.manifest_file or 'west.yml'
manifest_file = manifest_dir / manifest_filename
topdir = manifest_dir.parent
rel_manifest = manifest_dir.name
rel_manifest = manifest_file.parent.relative_to(topdir)
west_dir = topdir / WEST_DIR

if not manifest_file.is_file():
Expand All @@ -287,7 +287,7 @@
os.chdir(topdir)
self.config = Configuration(topdir=topdir)
self.config.set('manifest.path', os.fspath(rel_manifest))
self.config.set('manifest.file', manifest_filename)
self.config.set('manifest.file', manifest_file.name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't allow a nested manifest file, I think? It should be relative to the manifest path.


return topdir

Expand Down
Loading