Create Instance from single Release

This commit is contained in:
Jano at Zelda
2018-02-02 13:44:47 +01:00
parent 1b87e79466
commit 85e172d648
4 changed files with 22 additions and 0 deletions
+14
View File
@@ -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;
+2
View File
@@ -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;
+2
View File
@@ -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;
+4
View File
@@ -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;