Create Instance from single Release
This commit is contained in:
@@ -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;
|
||||||
@@ -24,5 +24,7 @@ package Alire.Containers with Preelaborate is
|
|||||||
package Project_Release_Maps is new Ada.Containers.Indefinite_Ordered_Maps
|
package Project_Release_Maps is new Ada.Containers.Indefinite_Ordered_Maps
|
||||||
(Project_Name, Releases.Release, "<", Releases."=");
|
(Project_Name, Releases.Release, "<", Releases."=");
|
||||||
subtype Release_Map is Project_Release_Maps.Map;
|
subtype Release_Map is Project_Release_Maps.Map;
|
||||||
|
|
||||||
|
function To_Map (R : Releases.Release) return Release_Map;
|
||||||
|
|
||||||
end Alire.Containers;
|
end Alire.Containers;
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ package Alire.Index is
|
|||||||
|
|
||||||
subtype Solution is Containers.Version_Map; -- A dependence-valid mapping of project -> version
|
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
|
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
|
function V (Semantic_Version : String) return Semantic_Versioning.Version
|
||||||
renames Semantic_Versioning.New_Version;
|
renames Semantic_Versioning.New_Version;
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ package Alire.Repositories.Local is
|
|||||||
|
|
||||||
Repo : constant Repository;
|
Repo : constant Repository;
|
||||||
|
|
||||||
|
Local_Id : constant Release_Id;
|
||||||
|
|
||||||
overriding function Image (Repo : Repository) return String is
|
overriding function Image (Repo : Repository) return String is
|
||||||
(raise Program_Error);
|
(raise Program_Error);
|
||||||
|
|
||||||
@@ -18,5 +20,7 @@ private
|
|||||||
type Repository is new Repositories.Repository with null record;
|
type Repository is new Repositories.Repository with null record;
|
||||||
|
|
||||||
Repo : constant Repository := (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;
|
end Alire.Repositories.Local;
|
||||||
|
|||||||
Reference in New Issue
Block a user