From 64ecfa82c2f35ab1f4e6d510199d9bb8ecc87952 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 27 Nov 2018 10:13:33 +0100 Subject: [PATCH] manifest: url for remotes changed to url-base This commit uses url-base instead of url to avoid confusion for users as url in west section of manifest is full url, where url-base in manifest section will be concatenated with project name to for clone url. Signed-off-by: Torsten Rasmussen --- src/west/manifest-schema.yml | 8 ++++---- src/west/manifest.py | 2 +- tests/west/manifest/invalid_bad_default_remote.yml | 2 +- .../manifest/invalid_duplicate_project_path.yml | 2 +- .../west/manifest/invalid_ill_defined_project.yml | 2 +- tests/west/manifest/invalid_no_projects.yml | 2 +- .../manifest/invalid_reserved_name_manifest.yml | 2 +- tests/west/manifest/invalid_reserved_name_west.yml | 2 +- tests/west/manifest/invalid_too_flat.yml | 2 +- tests/west/manifest/invalid_west_section.yml | 2 +- tests/west/manifest/test_manifest.py | 14 +++++++------- tests/west/project/test_project.py | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/west/manifest-schema.yml b/src/west/manifest-schema.yml index e5f21bd..c7d4e22 100644 --- a/src/west/manifest-schema.yml +++ b/src/west/manifest-schema.yml @@ -54,9 +54,9 @@ mapping: # # remotes: # - name: zephyrproject-rtos - # url: https://github.com/zephyrproject-rtos + # url-base: https://github.com/zephyrproject-rtos # - name: developer-fork - # url: https://github.com/a-developer + # url-base: https://github.com/a-developer remotes: required: true type: seq @@ -66,7 +66,7 @@ mapping: name: required: true type: str - url: + url-base: required: true type: str @@ -78,7 +78,7 @@ mapping: # Each project is a map with the following keys: # # - name: Mandatory, the name of the git repository. The clone - # URL is formed by remote + '/' + name. The name cannot + # URL is formed by remote url-base + '/' + name. The name cannot # be one of the reserved values "west" and "manifest". # - remote: Optional, the name of the remote to pull it from. # If the remote is missing, the remote'key in the top-level diff --git a/src/west/manifest.py b/src/west/manifest.py index a59bd6a..0f8a3ed 100644 --- a/src/west/manifest.py +++ b/src/west/manifest.py @@ -183,7 +183,7 @@ class Manifest: manifest = data.get('manifest') # Map from each remote's name onto that remote's data in the manifest. - remotes = tuple(Remote(r['name'], r['url']) for r in + remotes = tuple(Remote(r['name'], r['url-base']) for r in manifest['remotes']) remotes_dict = {r.name: r for r in remotes} diff --git a/tests/west/manifest/invalid_bad_default_remote.yml b/tests/west/manifest/invalid_bad_default_remote.yml index 60e2021..070c5a0 100644 --- a/tests/west/manifest/invalid_bad_default_remote.yml +++ b/tests/west/manifest/invalid_bad_default_remote.yml @@ -4,7 +4,7 @@ manifest: remotes: - name: testremote - url: https://example.com + url-base: https://example.com projects: - name: foo diff --git a/tests/west/manifest/invalid_duplicate_project_path.yml b/tests/west/manifest/invalid_duplicate_project_path.yml index 1fbe5b6..2a4e37b 100644 --- a/tests/west/manifest/invalid_duplicate_project_path.yml +++ b/tests/west/manifest/invalid_duplicate_project_path.yml @@ -4,7 +4,7 @@ manifest: remotes: - name: testremote - url: https://example.com + url-base: https://example.com projects: - name: foo1 diff --git a/tests/west/manifest/invalid_ill_defined_project.yml b/tests/west/manifest/invalid_ill_defined_project.yml index 9476597..b735542 100644 --- a/tests/west/manifest/invalid_ill_defined_project.yml +++ b/tests/west/manifest/invalid_ill_defined_project.yml @@ -1,7 +1,7 @@ manifest: remotes: - name: testremote - url: https://example.com + url-base: https://example.com projects: - name: ill_defined_no_remote diff --git a/tests/west/manifest/invalid_no_projects.yml b/tests/west/manifest/invalid_no_projects.yml index 9cce29d..c0f7706 100644 --- a/tests/west/manifest/invalid_no_projects.yml +++ b/tests/west/manifest/invalid_no_projects.yml @@ -1,4 +1,4 @@ manifest: remotes: - name: testremote - url: https://example.com + url-base: https://example.com diff --git a/tests/west/manifest/invalid_reserved_name_manifest.yml b/tests/west/manifest/invalid_reserved_name_manifest.yml index 3bc58e1..98548d3 100644 --- a/tests/west/manifest/invalid_reserved_name_manifest.yml +++ b/tests/west/manifest/invalid_reserved_name_manifest.yml @@ -1,7 +1,7 @@ manifest: remotes: - name: testremote - url: https://example.com + url-base: https://example.com projects: - name: manifest diff --git a/tests/west/manifest/invalid_reserved_name_west.yml b/tests/west/manifest/invalid_reserved_name_west.yml index 7da8cdb..1f9e6f5 100644 --- a/tests/west/manifest/invalid_reserved_name_west.yml +++ b/tests/west/manifest/invalid_reserved_name_west.yml @@ -1,7 +1,7 @@ manifest: remotes: - name: testremote - url: https://example.com + url-base: https://example.com projects: - name: west diff --git a/tests/west/manifest/invalid_too_flat.yml b/tests/west/manifest/invalid_too_flat.yml index a3dc610..14959b9 100644 --- a/tests/west/manifest/invalid_too_flat.yml +++ b/tests/west/manifest/invalid_too_flat.yml @@ -1,7 +1,7 @@ # This invalid manifest is too flat. remotes: - name: testremote - url: https://example.com + url-base: https://example.com projects: - name: testproject remote: testremote diff --git a/tests/west/manifest/invalid_west_section.yml b/tests/west/manifest/invalid_west_section.yml index 3025daa..cb942b6 100644 --- a/tests/west/manifest/invalid_west_section.yml +++ b/tests/west/manifest/invalid_west_section.yml @@ -13,7 +13,7 @@ manifest: remotes: - name: upstream - url: https://example.com + url-base: https://example.com projects: - name: zephyr diff --git a/tests/west/manifest/test_manifest.py b/tests/west/manifest/test_manifest.py index 2fdffea..c7c5c7d 100644 --- a/tests/west/manifest/test_manifest.py +++ b/tests/west/manifest/test_manifest.py @@ -33,9 +33,9 @@ def test_no_defaults(): manifest: remotes: - name: testremote1 - url: https://example1.com + url-base: https://example1.com - name: testremote2 - url: https://example2.com + url-base: https://example2.com projects: - name: testproject1 @@ -74,9 +74,9 @@ def test_default_clone_depth(): remotes: - name: testremote1 - url: https://example1.com + url-base: https://example1.com - name: testremote2 - url: https://example2.com + url-base: https://example2.com projects: - name: testproject1 @@ -116,7 +116,7 @@ def test_path(): manifest: remotes: - name: testremote - url: https://example.com + url-base: https://example.com projects: - name: testproject remote: testremote @@ -137,7 +137,7 @@ def test_sections(): manifest: remotes: - name: testremote - url: https://example.com + url-base: https://example.com projects: - name: testproject remote: testremote @@ -155,7 +155,7 @@ def test_sections(): manifest: remotes: - name: testremote - url: https://example.com + url-base: https://example.com projects: - name: testproject remote: testremote diff --git a/tests/west/project/test_project.py b/tests/west/project/test_project.py index 4216715..1d57cd7 100644 --- a/tests/west/project/test_project.py +++ b/tests/west/project/test_project.py @@ -76,7 +76,7 @@ manifest: remotes: - name: repos - url: file://{} + url-base: file://{} projects: - name: net-tools