diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:06:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:06:50 +0000 |
commit | 68adc8536f8a146e7f7597f92e14c7ab0debaa53 (patch) | |
tree | f339c57ee65b7ade0794e0b501f0d1813b5dd282 /debian/patches | |
parent | Adding upstream version 6.17.2. (diff) | |
download | ansible-lint-68adc8536f8a146e7f7597f92e14c7ab0debaa53.tar.xz ansible-lint-68adc8536f8a146e7f7597f92e14c7ab0debaa53.zip |
Adding debian version 6.17.2-1.debian/6.17.2-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/remove_version_check.patch | 76 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 77 insertions, 0 deletions
diff --git a/debian/patches/remove_version_check.patch b/debian/patches/remove_version_check.patch new file mode 100644 index 0000000..8e57d96 --- /dev/null +++ b/debian/patches/remove_version_check.patch @@ -0,0 +1,76 @@ +Description: Remove version check at runtime +Author: Samuel Henrique <samueloph@debian.org> +Forwarded: not-needed +Index: ansible-lint/src/ansiblelint/config.py +=================================================================== +--- ansible-lint.orig/src/ansiblelint/config.py ++++ ansible-lint/src/ansiblelint/config.py +@@ -270,53 +270,5 @@ def get_deps_versions() -> dict[str, Ver + + + def get_version_warning() -> str: +- """Display warning if current version is outdated.""" +- # 0.1dev1 is special fallback version +- if __version__ == "0.1.dev1": # pragma: no cover +- return "" +- +- msg = "" +- data = {} +- current_version = Version(__version__) +- +- if not os.path.exists(CACHE_DIR): # pragma: no cover +- os.makedirs(CACHE_DIR) +- cache_file = f"{CACHE_DIR}/latest.json" +- refresh = True +- if os.path.exists(cache_file): +- age = time.time() - os.path.getmtime(cache_file) +- if age < 24 * 60 * 60: +- refresh = False +- with open(cache_file, encoding="utf-8") as f: +- data = json.load(f) +- +- if refresh or not data: +- release_url = ( +- "https://api.github.com/repos/ansible/ansible-lint/releases/latest" +- ) +- try: +- with urllib.request.urlopen(release_url) as url: # noqa: S310 +- data = json.load(url) +- with open(cache_file, "w", encoding="utf-8") as f: +- json.dump(data, f) +- except (URLError, HTTPError) as exc: # pragma: no cover +- _logger.debug( +- "Unable to fetch latest version from %s due to: %s", +- release_url, +- exc, +- ) +- return "" +- +- html_url = data["html_url"] +- new_version = Version(data["tag_name"][1:]) # removing v prefix from tag +- +- if current_version > new_version: +- msg = "[dim]You are using a pre-release version of ansible-lint.[/]" +- elif current_version < new_version: +- msg = f"""[warning]A new release of ansible-lint is available: [red]{current_version}[/] → [green][link={html_url}]{new_version}[/][/][/]""" +- +- pip = guess_install_method() +- if pip: +- msg += f" Upgrade by running: [info]{pip}[/]" +- +- return msg ++ """Patched on Debian to not download release information from third parties""" ++ return "" +Index: ansible-lint/test/test_main.py +=================================================================== +--- ansible-lint.orig/test/test_main.py ++++ ansible-lint/test/test_main.py +@@ -48,7 +48,7 @@ def test_call_from_outside_venv(expected + warning_found = "PATH altered to include" in proc.stderr + assert warning_found is expected_warning + +- ++@pytest.mark.skip(reason="This functionality is disabled on Debian") + @pytest.mark.parametrize( + ("ver_diff", "found", "check", "outlen"), + ( diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..836a30d --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +remove_version_check.patch |