Check of platform dependencies

This commit is contained in:
Alejandro R Mosteo
2018-02-28 21:48:15 +01:00
parent 496a0d0646
commit 9cf501c6ad
3 changed files with 21 additions and 13 deletions
+6 -2
View File
@@ -77,7 +77,7 @@ package body Alire.Boolean_Trees is
-- Check --
-----------
function Check (T : Tree; V : Value) return Boolean is
function Check (T : Tree; V : Value; If_Empty : Boolean := True) return Boolean is
function Check (C : Trees.Cursor) return Boolean is
N : constant Node := Trees.Element (C);
@@ -95,7 +95,11 @@ package body Alire.Boolean_Trees is
end Check;
begin
return Check (Trees.First_Child (T.Root));
if T.Is_Empty then
return If_Empty;
else
return Check (Trees.First_Child (T.Root));
end if;
end Check;
---------------------
+1 -1
View File
@@ -37,7 +37,7 @@ package Alire.Boolean_Trees with Preelaborate is
-- Tree evaluation
function Check (T : Tree; V : Value) return Boolean;
function Check (T : Tree; V : Value; If_Empty : Boolean := True) return Boolean;
-- Access
+14 -10
View File
@@ -2,6 +2,14 @@ with Alire.Platforms;
package Alire.Properties.Platform with Preelaborate is
function Compiler_Is (C : Platforms.Compilers) return Vector;
function Distribution_Is (D : Platforms.Distributions) return Vector;
function System_Is (V : Platforms.Operating_Systems) return Vector;
-- The following packages declare types used elsewhere so they have to be public --
package Compilers is new Values (Platforms.Compilers,
Platforms.Compilers'IMage);
@@ -9,21 +17,17 @@ package Alire.Properties.Platform with Preelaborate is
Platforms.Distributions'Image);
package Operating_Systems is new Values (Platforms.Operating_Systems,
Platforms.Operating_Systems'Image);
-- function Current return Vector;
-- FIXME this will eventually have to go into Alr
Platforms.Operating_Systems'Image);
private
function System_Is (V : Platforms.Operating_Systems) return Vector is
(+Operating_Systems.New_Property (V));
function Compiler_Is (C : Platforms.Compilers) return Vector is
(+Compilers.New_Property (C));
-- function Current return Vector is
-- (Compiler_Is (Alire.Compilers.Compiler) and
-- System_Is (Alire.Operating_Systems.Current));
function Distribution_Is (D : Platforms.Distributions) return Vector is
(+Distributions.New_Property (D));
function System_Is (V : Platforms.Operating_Systems) return Vector is
(+Operating_Systems.New_Property (V));
end Alire.Properties.Platform;