diff --git a/src/alire-containers.adb b/src/alire-containers.adb new file mode 100644 index 00000000..0b0333a6 --- /dev/null +++ b/src/alire-containers.adb @@ -0,0 +1,14 @@ +package body Alire.Containers is + + ------------ + -- To_Map -- + ------------ + + function To_Map (R : Releases.Release) return Release_Map is + begin + return M : Release_Map do + M.Include (R.Project, R); + end return; + end To_Map; + +end Alire.Containers; diff --git a/src/alire-containers.ads b/src/alire-containers.ads index e8bcc88d..24bbf72e 100644 --- a/src/alire-containers.ads +++ b/src/alire-containers.ads @@ -24,5 +24,7 @@ package Alire.Containers with Preelaborate is package Project_Release_Maps is new Ada.Containers.Indefinite_Ordered_Maps (Project_Name, Releases.Release, "<", Releases."="); subtype Release_Map is Project_Release_Maps.Map; + + function To_Map (R : Releases.Release) return Release_Map; end Alire.Containers; diff --git a/src/alire-index.ads b/src/alire-index.ads index df76ffe0..49b93e6c 100644 --- a/src/alire-index.ads +++ b/src/alire-index.ads @@ -16,6 +16,8 @@ package Alire.Index is subtype Solution is Containers.Version_Map; -- A dependence-valid mapping of project -> version subtype Instance is Containers.Release_Map; -- A list of releases complying with a Solution + + Empty_Instance : constant Instance := Containers.Project_Release_Maps.Empty_Map; function V (Semantic_Version : String) return Semantic_Versioning.Version renames Semantic_Versioning.New_Version; diff --git a/src/alire-repositories-local.ads b/src/alire-repositories-local.ads index cbb2baa9..c4ecdb81 100644 --- a/src/alire-repositories-local.ads +++ b/src/alire-repositories-local.ads @@ -7,6 +7,8 @@ package Alire.Repositories.Local is Repo : constant Repository; + Local_Id : constant Release_Id; + overriding function Image (Repo : Repository) return String is (raise Program_Error); @@ -18,5 +20,7 @@ private type Repository is new Repositories.Repository with null record; Repo : constant Repository := (Repositories.Repository with null record); + + Local_Id : constant Release_Id := "local"; -- not "" because that fails assertion on length end Alire.Repositories.Local;