Closing alr #39

This commit is contained in:
Alejandro R Mosteo
2018-05-20 14:40:25 +02:00
parent e21afc9218
commit b692cc2e71
5 changed files with 49 additions and 5 deletions
+9 -4
View File
@@ -345,6 +345,13 @@ package Alire.Index is
------------
-- The root determines the starting point to look for dependencies
function New_Working_Release
(Project : Alire.Project;
Origin : Origins.Origin := Origins.New_Filesystem (".");
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty;
Properties : Conditional.Properties := Conditional.For_Properties.Empty)
return Release renames Releases.New_Working_Release;
subtype Root is Roots.Root;
function Set_Root (Project : Catalog_Entry;
@@ -352,10 +359,8 @@ package Alire.Index is
return Roots.Root is (Alire.Root.Set (Project.Project, Version));
-- All information will be taken from the indexed release
function Set_Root (Project : Alire.Project;
Dependencies : Conditional.Dependencies)
return Roots.Root renames Alire.Root.Set;
-- An unindexed working copy
function Set_Root (R : Release) return Roots.Root renames Alire.Root.Set;
-- An unindexed working copy (See New_Working_Release)
private
+12
View File
@@ -77,6 +77,18 @@ package body Alire.Releases is
-- Replacing --
---------------
function Replacing (Base : Release;
Dependencies : Conditional.Dependencies) return Release is
begin
return Replaced : Release := Base do
Replaced.Dependencies := Dependencies;
end return;
end Replacing;
---------------
-- Replacing --
---------------
function Replacing (Base : Release;
Project : Alire.Project := "";
Notes : Description_String := "") return Release
+3
View File
@@ -66,6 +66,9 @@ package Alire.Releases with Preelaborate is
Notes : Description_String := "") return Release;
-- Takes a release and replaces the given fields
function Replacing (Base : Release;
Dependencies : Conditional.Dependencies) return Release;
function Replacing (Base : Release;
Origin : Origins.Origin) return Release;
+16
View File
@@ -7,6 +7,22 @@ with GNAT.OS_Lib;
package body Alire.Utils is
-------------------------
-- Append_To_Last_Line --
-------------------------
function Append_To_Last_Line (V : String_Vector; S : String) return String_Vector is
begin
if V.Is_Empty then
return To_Vector (S);
else
return R : String_Vector := V do
R.Delete_Last;
R.Append_Line (V.Last_Element & S);
end return;
end if;
end Append_To_Last_Line;
--------------
-- Contains --
--------------
+9 -1
View File
@@ -1,3 +1,4 @@
with Ada.Containers;
with Ada.Containers.Indefinite_Ordered_Sets;
with Ada.Containers.Indefinite_Vectors;
@@ -56,8 +57,15 @@ package Alire.Utils with Preelaborate is
Empty_Vector : constant String_Vector;
procedure Append_Line (V : in out String_Vector;
S : String;
C : Ada.Containers.Count_Type := 1)
renames Append;
procedure Append_Vector (V : in out String_Vector; V2 : String_Vector)
renames Append;
renames Append;
function Append_To_Last_Line (V : String_Vector; S : String) return String_Vector;
function Count (V : String_Vector) return Natural;
-- FSM do I hate the Containers.Count_Type...