From 6ad4477b79e30b9254ec134d161f0e61e399f8d2 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Tue, 1 Sep 2020 11:43:00 +0200 Subject: [PATCH] Move manifest and lock files to top-level folder (#494) * Move and rename manifest to top-level dir The manifest was ./alire/crate_name.toml. Now it is ./alire.toml (always named alire.toml) * Move and rename lockfile to top-level Now the lockfile is also side-by-side with the manifest at top-level. It also is always named `alire.lock` * Testsuite adaptation --- src/alire/alire-directories.adb | 52 ++++++++-------- src/alire/alire-lockfiles.adb | 5 +- src/alire/alire-lockfiles.ads | 4 +- src/alire/alire-paths.ads | 3 - src/alire/alire-releases.adb | 7 +-- src/alire/alire-releases.ads | 2 +- src/alire/alire-root.adb | 8 +++ src/alire/alire-roots-optional.adb | 59 +++++++++---------- src/alire/alire-roots.adb | 5 +- src/alire/alire-roots.ads | 2 + src/alire/alire-workspace.adb | 13 ++-- src/alr/alr-commands-withing.adb | 27 ++++++--- .../get/external-tool-dependency/test.py | 4 +- testsuite/tests/get/git-local/test.py | 4 +- testsuite/tests/get/unpack-in-place/test.py | 4 +- .../index/ignore-unknown-property/test.py | 4 +- testsuite/tests/misc/bad-lockfile/test.py | 2 +- testsuite/tests/misc/bad-tomlfile/test.py | 2 +- testsuite/tests/misc/local-no-origin/test.py | 2 +- .../tests/misc/local-reject-origin/test.py | 2 +- testsuite/tests/misc/sync-manual-edit/test.py | 4 +- testsuite/tests/pin/downgrade/test.py | 7 ++- testsuite/tests/pin/post-update/test.py | 7 ++- .../{alire/crate_1234.lock => alire.lock} | 0 .../{alire/crate_1234.toml => alire.toml} | 0 .../crates/crate_1234/alire/.emptydir | 0 testsuite/tests/setenv/linked-paths/test.py | 2 +- testsuite/tests/with/delete-two/test.py | 2 +- .../tests/with/dynamic-dependencies/test.py | 2 +- .../tests/workflows/init-options/test.py | 12 ++-- .../tests/workflows/init-with-pin/test.py | 2 +- 31 files changed, 131 insertions(+), 118 deletions(-) rename testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/{alire/crate_1234.lock => alire.lock} (100%) rename testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/{alire/crate_1234.toml => alire.toml} (100%) create mode 100644 testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire/.emptydir diff --git a/src/alire/alire-directories.adb b/src/alire/alire-directories.adb index 01070bc0..c9d07f4e 100644 --- a/src/alire/alire-directories.adb +++ b/src/alire/alire-directories.adb @@ -2,7 +2,8 @@ with Ada.Exceptions; with Ada.Numerics.Discrete_Random; with Ada.Unchecked_Deallocation; -with Alire.Paths; +with Alire.Properties; +with Alire.Roots; package body Alire.Directories is @@ -67,33 +68,36 @@ package body Alire.Directories is is use Ada.Directories; - function Is_Candidate_Folder return Boolean; + --------------------------- + -- Find_Candidate_Folder -- + --------------------------- - ------------------------- - -- Is_Candidate_Folder -- - ------------------------- - - function Is_Candidate_Folder return Boolean is + function Find_Candidate_Folder (Path : Any_Path) + return Any_Path + is + Possible_Root : constant Roots.Root := Roots.New_Root + (Name => +"unused", + Path => Path, + Env => Properties.No_Properties); begin - return Exists (Current / Paths.Working_Folder_Inside_Root) and then - Find_Single_File (Current / Paths.Working_Folder_Inside_Root, - Paths.Crate_File_Extension_With_Dot) /= ""; - end Is_Candidate_Folder; - - G : Guard (Enter (Starting_At)) with Unreferenced; - begin - Trace.Debug ("Starting root search at " & Current); - loop - if Is_Candidate_Folder then - return Current; + Trace.Debug ("Looking for alire metadata at: " & Path); + if + Exists (Possible_Root.Crate_File) and then + Kind (Possible_Root.Crate_File) = Ordinary_File + then + return Path; else - Set_Directory (Containing_Directory (Current)); - Trace.Debug ("Going up to " & Current); + return Find_Candidate_Folder (Containing_Directory (Path)); end if; - end loop; - exception - when Use_Error => - return ""; -- There's no containing folder (hence we're at root) + exception + when Use_Error => + Trace.Debug + ("Root directory reached without finding alire metadata"); + return ""; -- There's no containing folder (hence we're at root) + end Find_Candidate_Folder; + + begin + return Find_Candidate_Folder (Starting_At); end Detect_Root_Path; ---------------------- diff --git a/src/alire/alire-lockfiles.adb b/src/alire/alire-lockfiles.adb index f76e8d28..7c2dd3a1 100644 --- a/src/alire/alire-lockfiles.adb +++ b/src/alire/alire-lockfiles.adb @@ -2,7 +2,6 @@ with Ada.Directories; with Ada.Text_IO; with Alire.Directories; -with Alire.Paths; with Alire.TOML_Load; with TOML.File_IO; @@ -28,8 +27,8 @@ package body Alire.Lockfiles is --------------- function File_Name (Name : Crate_Name; - Root_Dir : Any_Path) return Any_Path is - (Root_Dir / Paths.Working_Folder_Inside_Root / (+Name) & ".lock"); + Root_Dir : Any_Path) return Any_Path + is (Root_Dir / "alire.lock"); --------------- -- From_TOML -- diff --git a/src/alire/alire-lockfiles.ads b/src/alire/alire-lockfiles.ads index 3694cb44..51b0e58f 100644 --- a/src/alire/alire-lockfiles.ads +++ b/src/alire/alire-lockfiles.ads @@ -24,8 +24,8 @@ package Alire.Lockfiles is function File_Name (Name : Crate_Name; Root_Dir : Any_Path) return Any_Path; - -- Return the location /path/to/crate/dir/alire/crate.lock, filename - -- included, given the root directory where the crate is deployed. + -- Return the location /path/to/crate/dir/alire.lock, filename included, + -- given the root directory where the crate is deployed. function Read (Filename : Any_Path) return Contents; -- Read contents from the given lockfile diff --git a/src/alire/alire-paths.ads b/src/alire/alire-paths.ads index 1d1619ab..a0bdd01c 100644 --- a/src/alire/alire-paths.ads +++ b/src/alire/alire-paths.ads @@ -2,9 +2,6 @@ with Alire.OS_Lib; use Alire.OS_Lib.Operators; package Alire.Paths with Preelaborate is - Crate_File_Extension_With_Dot : constant String; - -- Until we decide a name, going to use crate per Amiard's suggestion - function Working_Folder_Inside_Root return Relative_Path is ("alire"); -- Folder within a working release that will contain metadata/build files, diff --git a/src/alire/alire-releases.adb b/src/alire/alire-releases.adb index 747aedfe..d3aa4399 100644 --- a/src/alire/alire-releases.adb +++ b/src/alire/alire-releases.adb @@ -244,7 +244,7 @@ package body Alire.Releases is function New_Working_Release (Name : Crate_Name; - Origin : Origins.Origin := Origins.New_Filesystem (".."); + Origin : Origins.Origin := Origins.New_Filesystem ("."); Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty; Properties : Conditional.Properties := @@ -635,9 +635,8 @@ package body Alire.Releases is when Manifest.Local => This.Origin := Origins.New_Filesystem - (Dirs.Containing_Directory -- workspace folder - (Dirs.Containing_Directory -- alire folder - (Dirs.Full_Name (File)))); -- absolute path + (Dirs.Containing_Directory -- same folder as manifest file's + (Dirs.Full_Name (File))); -- absolute path -- We don't require an origin for a local release, as the release -- is already in place. end case; diff --git a/src/alire/alire-releases.ads b/src/alire/alire-releases.ads index a4e581da..37bb2344 100644 --- a/src/alire/alire-releases.ads +++ b/src/alire/alire-releases.ads @@ -49,7 +49,7 @@ package Alire.Releases is function New_Working_Release (Name : Crate_Name; - Origin : Origins.Origin := Origins.New_Filesystem (".."); + Origin : Origins.Origin := Origins.New_Filesystem ("."); Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty; diff --git a/src/alire/alire-root.adb b/src/alire/alire-root.adb index 713aa690..c1ef265f 100644 --- a/src/alire/alire-root.adb +++ b/src/alire/alire-root.adb @@ -17,11 +17,19 @@ package body Alire.Root is function Current return Roots.Root is (Roots.Optional.Detect_Root (Directories.Detect_Root_Path).Value); + ------------------------- + -- Platform_Properties -- + ------------------------- + Environment : Properties.Vector; function Platform_Properties return Properties.Vector is (Environment); + ----------------------------- + -- Set_Platform_Properties -- + ----------------------------- + procedure Set_Platform_Properties (Env : Properties.Vector) is begin Environment := Env; diff --git a/src/alire/alire-roots-optional.adb b/src/alire/alire-roots-optional.adb index 9d90eaad..5bc034d9 100644 --- a/src/alire/alire-roots-optional.adb +++ b/src/alire/alire-roots-optional.adb @@ -3,9 +3,10 @@ with Ada.Directories; with Alire.Directories; with Alire.Errors; with Alire.Manifest; -with Alire.Paths; with Alire.Root; +with GNAT.OS_Lib; + package body Alire.Roots.Optional is Root_Not_Detected : constant Root := @@ -21,38 +22,36 @@ package body Alire.Roots.Optional is function Detect_Root (Path : Any_Path) return Optional.Root is use Directories.Operators; + Crate_File : constant Any_Path := Path / Crate_File_Name; begin if Path /= "" then - declare - Crate_File : constant String := Directories.Find_Single_File - (Path => Path / Alire.Paths.Working_Folder_Inside_Root, - Extension => ".toml"); - begin - if Crate_File /= "" then - begin - return This : constant Root := - Outcome_Success - (Roots.New_Root - (R => Releases.From_Manifest (Crate_File, - Manifest.Local), - Path => Ada.Directories.Full_Name (Path), - Env => Alire.Root.Platform_Properties)) - do - -- Crate loaded properly, we can return a valid root here - Trace.Debug ("Valid root found at " & Path); - end return; - exception - when E : others => - return Outcome_Failure - (Errors.Get (E), - Broken, - Report => False); - end; - else - return Root_Not_Detected; - end if; - end; + if GNAT.OS_Lib.Is_Regular_File (Crate_File) then + begin + return This : constant Root := + Outcome_Success + (Roots.New_Root + (R => Releases.From_Manifest (Crate_File, + Manifest.Local), + Path => Ada.Directories.Full_Name (Path), + Env => Alire.Root.Platform_Properties)) + do + -- Crate loaded properly, we can return a valid root here + Trace.Debug ("Valid root found at " & Path); + end return; + exception + when E : others => + Trace.Debug ("Unloadable root found at " & Path); + return Outcome_Failure + (Errors.Get (E), + Broken, + Report => False); + end; + else + Trace.Debug ("No root found at " & Path); + return Root_Not_Detected; + end if; else + Trace.Debug ("No root can be detected because given path is empty"); return Root_Not_Detected; -- This happens when detection of session folders in parent folders -- has been already attempted by the caller, so it ends calling here diff --git a/src/alire/alire-roots.adb b/src/alire/alire-roots.adb index a2bd772a..91b306a5 100644 --- a/src/alire/alire-roots.adb +++ b/src/alire/alire-roots.adb @@ -5,7 +5,6 @@ with Alire.Environment; with Alire.Lockfiles; with Alire.Manifest; with Alire.OS_Lib; -with Alire.Paths; with Alire.Roots.Optional; with Alire.Workspace; @@ -250,9 +249,7 @@ package body Alire.Roots is ---------------- function Crate_File (This : Root) return Absolute_Path is - (This.Working_Folder / - This.Release.Constant_Reference.Name_Str & - Paths.Crate_File_Extension_With_Dot); + (Path (This) / Crate_File_Name); ---------------------- -- Dependencies_Dir -- diff --git a/src/alire/alire-roots.ads b/src/alire/alire-roots.ads index 67cf81b4..ce22dac6 100644 --- a/src/alire/alire-roots.ads +++ b/src/alire/alire-roots.ads @@ -8,6 +8,8 @@ with Alire.Utils; package Alire.Roots is + Crate_File_Name : constant String := "alire.toml"; + -- Type used to encapsulate the information about the working context. -- A valid alire working dir is one containing an alire/crate.toml file. diff --git a/src/alire/alire-workspace.adb b/src/alire/alire-workspace.adb index 3e39cb69..2c71e2bf 100644 --- a/src/alire/alire-workspace.adb +++ b/src/alire/alire-workspace.adb @@ -13,8 +13,6 @@ with Alire.Roots; with Alire.Solutions.Diffs; with Alire.Workspace; -with GNATCOLL.VFS; - package body Alire.Workspace is use type Conditional.Dependencies; @@ -213,6 +211,11 @@ package body Alire.Workspace is Env); begin + Ada.Directories.Create_Path (Root.Working_Folder); + + -- Generate the authoritative manifest from index information for + -- eventual use of the gotten crate as a local workspace. + Workspace.Generate_Manifest (Release.Whenever (Env), -- TODO: until dynamic export Root); @@ -237,17 +240,11 @@ package body Alire.Workspace is procedure Generate_Manifest (Release : Releases.Release; Root : Roots.Root := Alire.Root.Current) is - use GNATCOLL.VFS; - F : constant Virtual_File := Create (+Root.Crate_File, - Normalize => True); begin Trace.Debug ("Generating " & Release.Name_Str & ".toml file for " & Release.Milestone.Image & " with" & Release.Dependencies.Leaf_Count'Img & " dependencies"); - -- Ensure working folder exists (might not upon first get) - F.Get_Parent.Make_Dir; - Directories.Backup_If_Existing (Root.Crate_File); Release.To_File (Root.Crate_File, Manifest.Local); diff --git a/src/alr/alr-commands-withing.adb b/src/alr/alr-commands-withing.adb index 5fdb0045..c1ca0d0a 100644 --- a/src/alr/alr-commands-withing.adb +++ b/src/alr/alr-commands-withing.adb @@ -9,7 +9,7 @@ with Alire.Index; with Alire.Manifest; with Alire.Milestones; with Alire.Releases; -with Alire.Roots; +with Alire.Roots.Optional; with Alire.Solutions; with Alire.Solver; with Alire.Utils.User_Input; @@ -142,17 +142,26 @@ package body Alr.Commands.Withing is --------------------- procedure Detect_Softlink (Path : String) is - Root : constant Alire.Roots.Root := Alire.Roots.Load_Root (Path); + Root : constant Alire.Roots.Optional.Root := + Alire.Roots.Optional.Detect_Root (Path); begin - if Root.Is_Stored then - -- Add a dependency on ^(detected version) (i.e., safely upgradable) - Add_Softlink - (Dep_Spec => Root.Release.Name_Str - & "^" & Root.Release.Version.Image, - Path => Path); + if Root.Is_Valid then + if Root.Value.Is_Stored then + -- Add a dependency on ^(detected version) (i.e., safely + -- upgradable) + Add_Softlink + (Dep_Spec => Root.Value.Release.Name_Str + & "^" & Root.Value.Release.Version.Image, + Path => Path); + else + Reportaise_Command_Failed + ("cannot add target: " & Root.Value.Storage_Error); + end if; else Reportaise_Command_Failed - ("cannot add target: " & Root.Storage_Error); + ("cannot add target: crate metadata not found at " & Path + & " (give an explicit crate name argument to use a plain" + & " GNAT project as dependency)"); end if; end Detect_Softlink; diff --git a/testsuite/tests/get/external-tool-dependency/test.py b/testsuite/tests/get/external-tool-dependency/test.py index 922782f0..f669751d 100644 --- a/testsuite/tests/get/external-tool-dependency/test.py +++ b/testsuite/tests/get/external-tool-dependency/test.py @@ -28,11 +28,11 @@ for elt in dir_content: # Check folder contents compare(dir_content, ['main_1.0.0_filesystem/alire', + 'main_1.0.0_filesystem/alire.lock', + 'main_1.0.0_filesystem/alire.toml', 'main_1.0.0_filesystem/alire/cache', 'main_1.0.0_filesystem/alire/cache/dependencies', make_dep_dir, - 'main_1.0.0_filesystem/alire/main.lock', - 'main_1.0.0_filesystem/alire/main.toml', 'main_1.0.0_filesystem/noop.gpr', 'main_1.0.0_filesystem/src', 'main_1.0.0_filesystem/src/noop.adb' diff --git a/testsuite/tests/get/git-local/test.py b/testsuite/tests/get/git-local/test.py index 253ce26f..ed33e70b 100644 --- a/testsuite/tests/get/git-local/test.py +++ b/testsuite/tests/get/git-local/test.py @@ -17,8 +17,8 @@ compare(list(filter contents('libfoo_1.0.0_9ddda32b'))), ['libfoo_1.0.0_9ddda32b/a', 'libfoo_1.0.0_9ddda32b/alire', - 'libfoo_1.0.0_9ddda32b/alire/libfoo.lock', - 'libfoo_1.0.0_9ddda32b/alire/libfoo.toml', + 'libfoo_1.0.0_9ddda32b/alire.lock', + 'libfoo_1.0.0_9ddda32b/alire.toml', 'libfoo_1.0.0_9ddda32b/b', 'libfoo_1.0.0_9ddda32b/b/x', 'libfoo_1.0.0_9ddda32b/b/y', diff --git a/testsuite/tests/get/unpack-in-place/test.py b/testsuite/tests/get/unpack-in-place/test.py index 75e14201..905b560c 100644 --- a/testsuite/tests/get/unpack-in-place/test.py +++ b/testsuite/tests/get/unpack-in-place/test.py @@ -10,8 +10,8 @@ from drivers.helpers import compare, contents run_alr('get', 'libhello=1.0.0-tarball') compare(contents('libhello_1.0.0_filesystem'), ['libhello_1.0.0_filesystem/alire', - 'libhello_1.0.0_filesystem/alire/libhello.lock', - 'libhello_1.0.0_filesystem/alire/libhello.toml', + 'libhello_1.0.0_filesystem/alire.lock', + 'libhello_1.0.0_filesystem/alire.toml', 'libhello_1.0.0_filesystem/libhello.gpr', 'libhello_1.0.0_filesystem/src', 'libhello_1.0.0_filesystem/src/libhello.adb', diff --git a/testsuite/tests/index/ignore-unknown-property/test.py b/testsuite/tests/index/ignore-unknown-property/test.py index 65ec2a52..e982540a 100644 --- a/testsuite/tests/index/ignore-unknown-property/test.py +++ b/testsuite/tests/index/ignore-unknown-property/test.py @@ -13,9 +13,9 @@ run_alr("init", "--bin", "xxx") chdir("xxx") # Add spurious metadata -with open("alire/xxx.toml", "r") as file: +with open("alire.toml", "r") as file: lines = file.readlines() -with open("alire/xxx.toml", "w") as file: +with open("alire.toml", "w") as file: file.write("fancy-new-feat = false\n") file.writelines(lines) diff --git a/testsuite/tests/misc/bad-lockfile/test.py b/testsuite/tests/misc/bad-lockfile/test.py index b6d1fd62..48d789fb 100644 --- a/testsuite/tests/misc/bad-lockfile/test.py +++ b/testsuite/tests/misc/bad-lockfile/test.py @@ -14,7 +14,7 @@ run_alr('init', '--bin', 'xxx') os.chdir('xxx') BADLINE = "SHOULND'T BE HERE" -FILE = "alire/xxx.lock" +FILE = "alire.lock" with open(FILE, "a") as myfile: myfile.write(BADLINE) diff --git a/testsuite/tests/misc/bad-tomlfile/test.py b/testsuite/tests/misc/bad-tomlfile/test.py index e6feb7aa..8ae2a61c 100644 --- a/testsuite/tests/misc/bad-tomlfile/test.py +++ b/testsuite/tests/misc/bad-tomlfile/test.py @@ -14,7 +14,7 @@ run_alr('init', '--bin', 'xxx') # And muck its tomlfile os.chdir('xxx') -with open("alire/xxx.toml", "a") as myfile: +with open("alire.toml", "a") as myfile: myfile.write("SHOULND'T BE HERE") # Verify that the expected error is given diff --git a/testsuite/tests/misc/local-no-origin/test.py b/testsuite/tests/misc/local-no-origin/test.py index 15466804..e712efb4 100644 --- a/testsuite/tests/misc/local-no-origin/test.py +++ b/testsuite/tests/misc/local-no-origin/test.py @@ -10,7 +10,7 @@ from os.path import join def assert_no_origin(crate): - assert "origin" not in content_of(join("alire", crate + ".toml")), \ + assert "origin" not in content_of("alire.toml"), \ "found unexpected contents in manifest of crate " + crate diff --git a/testsuite/tests/misc/local-reject-origin/test.py b/testsuite/tests/misc/local-reject-origin/test.py index a5521d01..973b8b25 100644 --- a/testsuite/tests/misc/local-reject-origin/test.py +++ b/testsuite/tests/misc/local-reject-origin/test.py @@ -10,7 +10,7 @@ from os.path import join init_local_crate("xxx") # Add manually the origin, and verify that it cannot be loaded -with open(join("alire", "xxx.toml"), "a") as file: +with open("alire.toml", "a") as file: file.write("\n[origin]\n") p = run_alr("show", complain_on_error=False) diff --git a/testsuite/tests/misc/sync-manual-edit/test.py b/testsuite/tests/misc/sync-manual-edit/test.py index 5200cb12..e3987ea5 100644 --- a/testsuite/tests/misc/sync-manual-edit/test.py +++ b/testsuite/tests/misc/sync-manual-edit/test.py @@ -21,11 +21,11 @@ for cmd in ['build', 'pin', 'run', 'show', 'with', 'setenv']: os.chdir('xxx') # "Manually" add a dependency - with open("alire/xxx.toml", "a") as file: + with open("alire.toml", "a") as file: file.write('[[depends-on]]\nlibhello="1"') # Make the lockfile "older" (otherwise timestamp is identical) - os.utime('alire/xxx.lock', (0, 0)) + os.utime('alire.lock', (0, 0)) # Run the command run_alr(cmd) diff --git a/testsuite/tests/pin/downgrade/test.py b/testsuite/tests/pin/downgrade/test.py index 2ce5ff3f..e77dcde3 100644 --- a/testsuite/tests/pin/downgrade/test.py +++ b/testsuite/tests/pin/downgrade/test.py @@ -17,12 +17,13 @@ def check_child(version, output, pinned): # Verify output assert_match('.*\n' 'Dependencies \(solution\):\n' - ' libchild=' + version + (" \(pinned\)" if pinned else "") + '.*\n', + ' libchild=' + version + + (" \(pinned\)" if pinned else "") + '.*\n', output, flags=re.S) # Verify lockfile - check_line_in('alire/xxx.lock', 'name = "libchild"') - check_line_in('alire/xxx.lock', f'version = "{version}"') + check_line_in('alire.lock', 'name = "libchild"') + check_line_in('alire.lock', f'version = "{version}"') # Verify dependency folders assert os.path.exists('alire/cache/dependencies/libchild_' + version + diff --git a/testsuite/tests/pin/post-update/test.py b/testsuite/tests/pin/post-update/test.py index 926892fa..988a310d 100644 --- a/testsuite/tests/pin/post-update/test.py +++ b/testsuite/tests/pin/post-update/test.py @@ -16,14 +16,15 @@ def check_child(version, output, pinned): # Verify output assert_match('.*\n' 'Dependencies \(solution\):\n' - ' libchild=' + version + (' \(pinned\)' if pinned else "") + '\n' + ' libchild=' + version + + (' \(pinned\)' if pinned else "") + '\n' ' libparent=1\.0\.0\n' '.*\n', output, flags=re.S) # Verify lockfile - check_line_in('alire/xxx.lock', 'name = "libchild"') - check_line_in('alire/xxx.lock', f'version = "{version}"') + check_line_in('alire.lock', 'name = "libchild"') + check_line_in('alire.lock', f'version = "{version}"') # Create a new "xxx" program project diff --git a/testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire/crate_1234.lock b/testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire.lock similarity index 100% rename from testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire/crate_1234.lock rename to testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire.lock diff --git a/testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire/crate_1234.toml b/testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire.toml similarity index 100% rename from testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire/crate_1234.toml rename to testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire.toml diff --git a/testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire/.emptydir b/testsuite/tests/setenv/linked-paths/my_index/crates/crate_1234/alire/.emptydir new file mode 100644 index 00000000..e69de29b diff --git a/testsuite/tests/setenv/linked-paths/test.py b/testsuite/tests/setenv/linked-paths/test.py index 91fef9f4..747daa04 100644 --- a/testsuite/tests/setenv/linked-paths/test.py +++ b/testsuite/tests/setenv/linked-paths/test.py @@ -15,7 +15,7 @@ from drivers.helpers import dir_separator, path_separator run_alr("init", "--bin", "xxx") os.chdir("xxx") -# Link a folder with also contains crate definitions +# Link a folder which also contains crate metadata run_alr("with", "--use=../my_index/crates/crate_1234") expected_gpr_path = [] diff --git a/testsuite/tests/with/delete-two/test.py b/testsuite/tests/with/delete-two/test.py index 871954a5..b16b5e15 100644 --- a/testsuite/tests/with/delete-two/test.py +++ b/testsuite/tests/with/delete-two/test.py @@ -9,7 +9,7 @@ from drivers.alr import run_alr from drivers.asserts import assert_eq, assert_match from drivers.helpers import content_of -manifest = "alire/xxx.toml" +manifest = "alire.toml" run_alr('init', '--bin', 'xxx') os.chdir('xxx') diff --git a/testsuite/tests/with/dynamic-dependencies/test.py b/testsuite/tests/with/dynamic-dependencies/test.py index 0c853e55..ae155be0 100644 --- a/testsuite/tests/with/dynamic-dependencies/test.py +++ b/testsuite/tests/with/dynamic-dependencies/test.py @@ -9,7 +9,7 @@ from drivers.alr import run_alr from drivers.asserts import assert_eq, assert_match from drivers.helpers import content_of -manifest = "alire/xxx.toml" +manifest = "alire.toml" run_alr('init', '--bin', 'xxx') os.chdir('xxx') diff --git a/testsuite/tests/workflows/init-options/test.py b/testsuite/tests/workflows/init-options/test.py index d0d305a9..dd455aa4 100644 --- a/testsuite/tests/workflows/init-options/test.py +++ b/testsuite/tests/workflows/init-options/test.py @@ -12,8 +12,8 @@ from drivers.helpers import compare, contents # Plain init run_alr('init', '--bin', 'xxx') compare(contents('xxx'), ['xxx/alire', - 'xxx/alire/xxx.lock', - 'xxx/alire/xxx.toml', + 'xxx/alire.lock', + 'xxx/alire.toml', 'xxx/src', 'xxx/src/xxx.adb', 'xxx/xxx.gpr']) @@ -21,16 +21,16 @@ compare(contents('xxx'), ['xxx/alire', # Init without skeleton run_alr('init', '--bin', '--no-skel', 'yyy') compare(contents('yyy'), ['yyy/alire', - 'yyy/alire/yyy.lock', - 'yyy/alire/yyy.toml']) + 'yyy/alire.lock', + 'yyy/alire.toml']) # Init in place os.mkdir('zzz') os.chdir('zzz') run_alr('init', '--bin', '--in-place', 'zzz') compare(contents('.'), ['./alire', - './alire/zzz.lock', - './alire/zzz.toml']) + './alire.lock', + './alire.toml']) print('SUCCESS') diff --git a/testsuite/tests/workflows/init-with-pin/test.py b/testsuite/tests/workflows/init-with-pin/test.py index 51e5c529..0308fc8d 100644 --- a/testsuite/tests/workflows/init-with-pin/test.py +++ b/testsuite/tests/workflows/init-with-pin/test.py @@ -14,7 +14,7 @@ run_alr('init', '--bin', 'xxx') os.chdir('xxx') # Make it depend on libhello -session_file = os.path.join('alire', 'xxx.toml') +session_file = os.path.join('alire.toml') run_alr('with', 'libhello') check_line_in(session_file, 'libhello = "*" # This line was added by `alr with`') -- 2.39.5