From 817e2717bc085523ab48236a24fba5bcc5e8b3cf Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Mon, 25 Jul 2022 09:35:42 +0200 Subject: [PATCH] Remove obsolescent files (#1105) --- src/alire/alire-paths.ads | 3 +- src/alr/alr-commands-test.adb | 12 ++-- src/alr/alr-commands-version.adb | 3 +- src/alr/alr-defaults.ads | 16 ------ src/alr/alr-paths.ads | 96 -------------------------------- 5 files changed, 9 insertions(+), 121 deletions(-) delete mode 100644 src/alr/alr-defaults.ads delete mode 100644 src/alr/alr-paths.ads diff --git a/src/alire/alire-paths.ads b/src/alire/alire-paths.ads index 7ea0fb481..13e70e0c6 100644 --- a/src/alire/alire-paths.ads +++ b/src/alire/alire-paths.ads @@ -11,8 +11,7 @@ package Alire.Paths with Preelaborate is Temp_Folder_Inside_Working_Folder : constant Relative_Path := "tmp"; - function Working_Folder_Inside_Root return Relative_Path - is ("alire"); + Working_Folder_Inside_Root : constant Relative_Path := "alire"; -- Folder within a working release that will contain metadata/build files, -- dependency releases, and session. diff --git a/src/alr/alr-commands-test.adb b/src/alr/alr-commands-test.adb index f6b39c58b..b11c662c2 100644 --- a/src/alr/alr-commands-test.adb +++ b/src/alr/alr-commands-test.adb @@ -10,6 +10,7 @@ with Alire.Directories; with Alire.Index; with Alire.Milestones; with Alire.OS_Lib.Subprocess; +with Alire.Paths; with Alire.Platforms.Current; with Alire.Properties.Actions.Executor; with Alire.Releases.Containers; @@ -18,7 +19,6 @@ with Alire.Solver; with Alire.Utils; with Alr.Files; -with Alr.Paths; with Alr.Testing.Collections; with Alr.Testing.Console; with Alr.Testing.JUnit; @@ -33,6 +33,7 @@ package body Alr.Commands.Test is use type Ada.Containers.Count_Type; + package Paths renames Alire.Paths; package Platform renames Alire.Platforms.Current; package Query renames Alire.Solver; @@ -322,11 +323,12 @@ package body Alr.Commands.Test is end if; Make_Dir - (Create (+R.Base_Folder) / Create (+Paths.Alr_Working_Folder)); + (Create (+R.Base_Folder) + / Create (+Paths.Working_Folder_Inside_Root)); -- Might not exist for system/failed/skipped - Output.Write (R.Base_Folder / - Paths.Alr_Working_Folder / - "alr_test_" & Timestamp & ".log"); + Output.Write (R.Base_Folder + / Paths.Working_Folder_Inside_Root + / "alr_test_" & Timestamp & ".log"); end Test_Release; begin diff --git a/src/alr/alr-commands-version.adb b/src/alr/alr-commands-version.adb index 1d1f8ece8..50e10e69e 100644 --- a/src/alr/alr-commands-version.adb +++ b/src/alr/alr-commands-version.adb @@ -8,7 +8,6 @@ with Alire.Toolchains; with Alire.Utils.Tables; with Alr.Bootstrap; -with Alr.Paths; with GNAT.Compiler_Version; with GNAT.Source_Info; @@ -51,7 +50,7 @@ package body Alr.Commands.Version is Table.Append ("").New_Row; Table.Append ("CONFIGURATION").New_Row; - Table.Append ("config folder:").Append (Paths.Alr_Config_Folder).New_Row; + Table.Append ("config folder:").Append (Alire.Config.Edit.Path).New_Row; Table.Append ("force flag:").Append (Alire.Force'Image).New_Row; Table.Append ("non-interactive flag:") .Append (CLIC.User_Input.Not_Interactive'Image).New_Row; diff --git a/src/alr/alr-defaults.ads b/src/alr/alr-defaults.ads deleted file mode 100644 index 62933adfb..000000000 --- a/src/alr/alr-defaults.ads +++ /dev/null @@ -1,16 +0,0 @@ -with Alire; - -package Alr.Defaults with Preelaborate is - - Alr_Repository : constant Alire.URL := - "https://github.com/alire-project/alire.git"; - - Index_Repository : constant Alire.URL := - "https://github.com/alire-project/alire-index.git"; - --- Semver_Repository : constant Alire.URL := --- "https://bitbucket.org/aleteolabs/semver.git"; --- Simple_Logging_Repo : constant Alire.URL := --- "https://github.com/mosteo/simple_logging.git"; - -end Alr.Defaults; diff --git a/src/alr/alr-paths.ads b/src/alr/alr-paths.ads deleted file mode 100644 index a354616d6..000000000 --- a/src/alr/alr-paths.ads +++ /dev/null @@ -1,96 +0,0 @@ -with Ada.Directories; - -with Alire; -with Alire.Config.Edit; -with Alire.Environment; - -with Alr.Defaults; -with Alr.OS_Lib; - -package Alr.Paths is - - -- NOTE: none of the functions in this spec can be used before elaboration - -- is complete. - - -- TODO: this note will be obsolete once Alire.Platform supersedes - -- Alr.Platform. - - function "/" (L, R : String) return String; - -- Equivalent to Ada.Directories.Compose - - function Parent (Folder : String) return String - renames Ada.Directories.Containing_Directory; - - -- To clarify constants/functions declared herein: - - subtype Absolute_File is String; - -- Filenames with full path - - subtype Absolute_Path is String; - - subtype Relative_File is String; - -- Filenames with relative paths - - subtype Relative_Path is String; - -- A relative path - - subtype Simple_File is String; - -- Filenames without path - - -- Paths used thorough alr - - Alr_Repo : constant Alire.URL := Defaults.Alr_Repository; - -- Repository where alr sources can be found - - function Alr_Config_Folder return Absolute_Path; - -- Root folder containing persistent configuration: indexes, templates - - function Alr_Source_Folder return Absolute_Path; - -- Folder inside Alr_Config_Folder containing a clone of the alr repo - -- This folder can be overridden via environment variable - -- Alire.Environment.Source. - - Alr_Working_Folder : constant Relative_Path; - -- Folder within a working release that will contain metadata/build files, - -- dependency releases, and session. - - Alr_Working_Cache_Folder : constant Relative_Path; - -- Folder inside the working folder with transient files (can be safely - -- deleted). - - Alr_Working_Deps_Path : constant Relative_Path; - -- Path from inside the working folder to dependency folders - - -- Functions that return Paths-derived files - - function Dependencies_Folder return Relative_Path; - -- Location in the working dir where dependencies are deployed - -private - - function "/" (L, R : String) return String - is (Ada.Directories.Compose (L, R)); - - -- Constants - - Alr_Working_Folder : constant String := "alire"; - - Alr_Working_Cache_Folder : constant Relative_Path := - Alr_Working_Folder / "cache"; - - Alr_Working_Deps_Path : constant Relative_Path := "cache" / - "dependencies"; - - -- Pseudo-constants (due to elaboration finished requirement) - -- Or because they can be set after elaboration (e.g. via config switches) - - function Alr_Config_Folder return String - is (Alire.Config.Edit.Path); - - function Alr_Source_Folder return String - is (OS_Lib.Getenv (Alire.Environment.Source, Alr_Config_Folder / "alire")); - - function Dependencies_Folder return String - is (Alr_Working_Cache_Folder / "dependencies"); - -end Alr.Paths;