From fc1baf7b911827134f2ae69180c9b8f999049fe1 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 24 Oct 2023 18:11:03 +0100 Subject: [PATCH] Bump UUID to regenerate all nix-alien files Since there is so many changes in nix-alien right now, this commit will bump the UUID used as a base for hashing the names, so we can ensure everyone will use the new changes. --- nix_alien/helpers.py | 2 +- tests/test_fhs_env.py | 4 ++-- tests/test_helpers.py | 18 +++++++++--------- tests/test_nix_ld.py | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/nix_alien/helpers.py b/nix_alien/helpers.py index c6fb850..c6428e7 100644 --- a/nix_alien/helpers.py +++ b/nix_alien/helpers.py @@ -7,7 +7,7 @@ from string import Template from typing import Callable, Optional -UUID_NAMESPACE = uuid.UUID("f318d4a6-dd46-47ce-995d-e95c17cadcc0") +UUID_NAMESPACE = uuid.UUID("eebf3397-2041-4370-bf33-937b33d5c959") def edit_file(file: Path) -> subprocess.CompletedProcess: diff --git a/tests/test_fhs_env.py b/tests/test_fhs_env.py index 22af373..e39f097 100644 --- a/tests/test_fhs_env.py +++ b/tests/test_fhs_env.py @@ -236,7 +236,7 @@ def test_main_with_print(monkeypatch, capsys): assert ( out == """\ -/home/nameless-shelter/.cache/nix-alien/b5ae45f6-276c-53a3-93ab-4a44f35976a4/fhs-env/default.nix +/home/nameless-shelter/.cache/nix-alien/d51a223b-43f0-56c6-b5c8-2404823026ac/fhs-env/default.nix """ ) @@ -246,6 +246,6 @@ def test_main_with_print(monkeypatch, capsys): assert ( out == """\ -/home/nameless-shelter/.cache/nix-alien/b5ae45f6-276c-53a3-93ab-4a44f35976a4/fhs-env/flake.nix +/home/nameless-shelter/.cache/nix-alien/d51a223b-43f0-56c6-b5c8-2404823026ac/fhs-env/flake.nix """ ) diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 89043a4..6726859 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -12,31 +12,31 @@ def test_edit_file(monkeypatch): def test_get_hash_for_program(monkeypatch): monkeypatch.setenv("HOME", "/home/nameless-shelter") assert helpers.get_hash_for_program("/home/nameless-shelter/abc") == UUID( - "d0efaea7-176f-56e6-99a0-ea49599a163b" + "0acc4435-07de-59bf-a1c3-a42f55aaca35" ) assert helpers.get_hash_for_program("~/abc") == UUID( - "d0efaea7-176f-56e6-99a0-ea49599a163b" + "0acc4435-07de-59bf-a1c3-a42f55aaca35" ) assert helpers.get_hash_for_program("/abc") == UUID( - "f52177f5-def5-5d9e-91fc-ef1283fc54b1" + "cf2f97e0-6eec-5407-aea0-bbecc488d451" ) assert helpers.get_hash_for_program("/./abc") == UUID( - "f52177f5-def5-5d9e-91fc-ef1283fc54b1" + "cf2f97e0-6eec-5407-aea0-bbecc488d451" ) assert helpers.get_hash_for_program("/xyz/../abc") == UUID( - "f52177f5-def5-5d9e-91fc-ef1283fc54b1" + "cf2f97e0-6eec-5407-aea0-bbecc488d451" ) def test_get_cache_path(monkeypatch): monkeypatch.setenv("HOME", "/home/nameless-shelter") assert helpers.get_cache_path("/abc") == Path( - "/home/nameless-shelter/.cache/nix-alien/f52177f5-def5-5d9e-91fc-ef1283fc54b1" + "/home/nameless-shelter/.cache/nix-alien/cf2f97e0-6eec-5407-aea0-bbecc488d451" ) monkeypatch.setenv("XDG_CACHE_HOME", "/") assert helpers.get_cache_path("/abc") == Path( - "/nix-alien/f52177f5-def5-5d9e-91fc-ef1283fc54b1" + "/nix-alien/cf2f97e0-6eec-5407-aea0-bbecc488d451" ) @@ -48,7 +48,7 @@ def test_get_dest_path(monkeypatch): directory="bar", filename="foo.nix", ) == Path( - "/home/nameless-shelter/.cache/nix-alien/f52177f5-def5-5d9e-91fc-ef1283fc54b1/bar/foo.nix" + "/home/nameless-shelter/.cache/nix-alien/cf2f97e0-6eec-5407-aea0-bbecc488d451/bar/foo.nix" ) monkeypatch.setenv("XDG_CACHE_HOME", "/") @@ -57,7 +57,7 @@ def test_get_dest_path(monkeypatch): program="/abc", directory="bar", filename="foo.nix", - ) == Path("/nix-alien/f52177f5-def5-5d9e-91fc-ef1283fc54b1/bar/foo.nix") + ) == Path("/nix-alien/cf2f97e0-6eec-5407-aea0-bbecc488d451/bar/foo.nix") assert helpers.get_dest_path( destination="/quux", diff --git a/tests/test_nix_ld.py b/tests/test_nix_ld.py index f98409d..dca0d71 100644 --- a/tests/test_nix_ld.py +++ b/tests/test_nix_ld.py @@ -241,7 +241,7 @@ def test_main_with_print(monkeypatch, capsys): assert ( out == """\ -/home/nameless-shelter/.cache/nix-alien/b5ae45f6-276c-53a3-93ab-4a44f35976a4/nix-ld/default.nix +/home/nameless-shelter/.cache/nix-alien/d51a223b-43f0-56c6-b5c8-2404823026ac/nix-ld/default.nix """ ) @@ -251,6 +251,6 @@ def test_main_with_print(monkeypatch, capsys): assert ( out == """\ -/home/nameless-shelter/.cache/nix-alien/b5ae45f6-276c-53a3-93ab-4a44f35976a4/nix-ld/flake.nix +/home/nameless-shelter/.cache/nix-alien/d51a223b-43f0-56c6-b5c8-2404823026ac/nix-ld/flake.nix """ )