From 2899b0c9f54b91c637732dce75f4fac2affb11b7 Mon Sep 17 00:00:00 2001 From: Tiago Nobrega Date: Thu, 13 Apr 2023 14:36:47 -0300 Subject: [PATCH] repo: change sources prefix to "craft-" This is a leftover from the code move; the rest of the code is already using "craft-" as a prefix. As this is an internal change, no clients are expected to break. --- craft_archives/repo/apt_sources_manager.py | 4 ++-- tests/integration/repo/test_installer.py | 2 +- tests/unit/repo/test_apt_sources_manager.py | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/craft_archives/repo/apt_sources_manager.py b/craft_archives/repo/apt_sources_manager.py index 7b9e244c..e1272cf7 100644 --- a/craft_archives/repo/apt_sources_manager.py +++ b/craft_archives/repo/apt_sources_manager.py @@ -102,7 +102,7 @@ def _install_sources( """Install sources list configuration. Write config to: - /etc/apt/sources.list.d/snapcraft-.sources + /etc/apt/sources.list.d/craft-.sources :returns: True if configuration was changed. """ @@ -119,7 +119,7 @@ def _install_sources( ) if name not in ["default", "default-security"]: - name = "snapcraft-" + name + name = "craft-" + name config_path = self._sources_list_d / f"{name}.sources" if config_path.exists() and config_path.read_text() == config: diff --git a/tests/integration/repo/test_installer.py b/tests/integration/repo/test_installer.py index cefbad41..5bf02c15 100644 --- a/tests/integration/repo/test_installer.py +++ b/tests/integration/repo/test_installer.py @@ -170,7 +170,7 @@ def check_sources(etc_apt_dir: Path) -> None: # test run and the sources reference the keyring location. expected_contents = source_contents.format(key_location=keyrings_location) - source_file = sources_dir / f"snapcraft-{source_repo}.sources" + source_file = sources_dir / f"craft-{source_repo}.sources" assert source_file.is_file() assert source_file.read_text() == expected_contents diff --git a/tests/unit/repo/test_apt_sources_manager.py b/tests/unit/repo/test_apt_sources_manager.py index 7804894a..25800e79 100644 --- a/tests/unit/repo/test_apt_sources_manager.py +++ b/tests/unit/repo/test_apt_sources_manager.py @@ -88,7 +88,7 @@ def apt_sources_mgr(tmp_path): suites=["test-suite1", "test-suite2"], url="http://test.url/ubuntu", ), - "snapcraft-http_test_url_ubuntu.sources", + "craft-http_test_url_ubuntu.sources", dedent( """\ Types: deb deb-src @@ -109,7 +109,7 @@ def apt_sources_mgr(tmp_path): suites=["test-suite1", "test-suite2"], url="http://test.url/ubuntu", ), - "snapcraft-NO-FORMAT.sources", + "craft-NO-FORMAT.sources", dedent( """\ Types: deb @@ -128,7 +128,7 @@ def apt_sources_mgr(tmp_path): path="some-path", url="http://test.url/ubuntu", ), - "snapcraft-WITH-PATH.sources", + "craft-WITH-PATH.sources", dedent( """\ Types: deb @@ -145,7 +145,7 @@ def apt_sources_mgr(tmp_path): name="IMPLIED-PATH", url="http://test.url/ubuntu", ), - "snapcraft-IMPLIED-PATH.sources", + "craft-IMPLIED-PATH.sources", dedent( """\ Types: deb @@ -158,7 +158,7 @@ def apt_sources_mgr(tmp_path): ), ( PackageRepositoryAptPPA(ppa="test/ppa"), - "snapcraft-ppa-test_ppa.sources", + "craft-ppa-test_ppa.sources", dedent( """\ Types: deb @@ -172,7 +172,7 @@ def apt_sources_mgr(tmp_path): ), ( PackageRepositoryAptUCA(cloud="fake-cloud"), - "snapcraft-cloud-fake-cloud.sources", + "craft-cloud-fake-cloud.sources", dedent( """\ Types: deb