Recovered search by property
This commit is contained in:
@@ -13,7 +13,7 @@ package Alire.Index.Alire is
|
||||
V ("0.1.2"),
|
||||
Desc,
|
||||
Git (Repo, "e2dee2e147ae9e4d666567b53b108cbe61bc06e8"),
|
||||
Depends_On =>
|
||||
Dependencies =>
|
||||
Within_Minor (Semantic_Versioning.V_0_1) and
|
||||
Within_Major (Simple_Logging.V_1)
|
||||
);
|
||||
@@ -25,7 +25,7 @@ package Alire.Index.Alire is
|
||||
"Release with all index syntax features",
|
||||
Origins.New_Filesystem ("/fake"),
|
||||
|
||||
Depends_On =>
|
||||
Dependencies =>
|
||||
Current ("half_life_3") and -- unconditional
|
||||
If_Platform -- conditional
|
||||
(System_Is (GNU_Linux),
|
||||
|
||||
@@ -13,7 +13,7 @@ package Alire.Index.Alr is
|
||||
V ("0.1.2"),
|
||||
Desc,
|
||||
Git (Repo, "4002536beea8aee12b455077df4dd144b409bde4"),
|
||||
Depends_On =>
|
||||
Dependencies =>
|
||||
Within_Major (Alire.V_0_1) and
|
||||
Within_Major (Simple_Logging.V_1));
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ package Alire.Index.DAK is
|
||||
V ("4.27"),
|
||||
Desc_Pre & "(base components)" & Desc_Post,
|
||||
Git (Repo, "542f02c9be86693f759fcb784a8462bc4b25f1f2"),
|
||||
Depends_On =>
|
||||
Dependencies =>
|
||||
Within_Major (Strings_Edit_V_4_27) and
|
||||
Within_Major (Tables_V_4_27),
|
||||
|
||||
@@ -118,7 +118,7 @@ package Alire.Index.DAK is
|
||||
V ("4.27"),
|
||||
Desc_Pre & "(ntp)" & Desc_Post,
|
||||
Git (Repo, "34fb305d6ef360cde5e272b51409097a5de72017"),
|
||||
Depends_On =>
|
||||
Dependencies =>
|
||||
Within_Major (Components_V_4_27),
|
||||
|
||||
Properties =>
|
||||
@@ -137,7 +137,7 @@ package Alire.Index.DAK is
|
||||
V ("4.27"),
|
||||
Desc_Pre & "(sqlite)" & Desc_Post,
|
||||
Git (Repo, "6fda0f3f7494815c87b329f7411b9a49ff97b9ba"),
|
||||
Depends_On =>
|
||||
Dependencies =>
|
||||
Within_Major (Components_V_4_27),
|
||||
|
||||
Properties =>
|
||||
@@ -158,7 +158,7 @@ package Alire.Index.DAK is
|
||||
V ("4.27"),
|
||||
Desc_Pre & "(clients/servers)" & Desc_Post,
|
||||
Git (Repo, "008935d5a89396cc0c39afb39f04bf6a89a92058"),
|
||||
Depends_On =>
|
||||
Dependencies =>
|
||||
Within_Major (Components_V_4_27) and
|
||||
Within_Major (Components_Sqlite_V_4_27),
|
||||
|
||||
@@ -210,7 +210,7 @@ package Alire.Index.DAK is
|
||||
V ("4.27"),
|
||||
Desc_Pre & "(client/servers over TLS)" & Desc_Post,
|
||||
Git (Repo, "ca72cf4150ae14ba6d40c3d2dd92c7846cb4cb5d"),
|
||||
Depends_On =>
|
||||
Dependencies =>
|
||||
Within_Major (Components_Connections_V_4_27) and
|
||||
Within_Major (LibGNUTLS.V_3_5_8),
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ package Alire.Index.Hello is
|
||||
V ("1.0.0"),
|
||||
Desc,
|
||||
Git (Repo, "8cac0afddc505794ae3e5634745ce0830129d241"),
|
||||
Depends_On => Within_Major (Libhello.V_1_0_0));
|
||||
Dependencies => Within_Major (Libhello.V_1_0_0));
|
||||
|
||||
V_1_0_1 : constant Release :=
|
||||
Register (Name,
|
||||
V ("1.0.1"),
|
||||
Desc,
|
||||
Git (Repo, "65725c20778875eef12b61a01b437120932965f3"),
|
||||
Depends_On => Within_Major (Libhello.V_1_0_0));
|
||||
Dependencies => Within_Major (Libhello.V_1_0_0));
|
||||
|
||||
V_1_0 : Release renames V_1_0_1;
|
||||
|
||||
|
||||
@@ -39,6 +39,32 @@ package body Alire.Conditional_Values is
|
||||
end if;
|
||||
end "and";
|
||||
|
||||
----------------
|
||||
-- All_Values --
|
||||
----------------
|
||||
|
||||
function All_Values (This : Conditional_Value) return Values is
|
||||
|
||||
Result : Values;
|
||||
|
||||
procedure Visit (V : Conditional_Value) is
|
||||
begin
|
||||
case V.Kind is
|
||||
when Value =>
|
||||
Result := Result & V.Value;
|
||||
when Condition =>
|
||||
V.True_Value.Iterate_Children (Visit'Access);
|
||||
V.False_Value.Iterate_Children (Visit'Access);
|
||||
when Vector =>
|
||||
raise Program_Error with "shouldn't happen";
|
||||
end case;
|
||||
end Visit;
|
||||
|
||||
begin
|
||||
This.Iterate_Children (Visit'Access);
|
||||
return Result;
|
||||
end All_Values;
|
||||
|
||||
--------------
|
||||
-- Evaluate --
|
||||
--------------
|
||||
|
||||
@@ -31,6 +31,9 @@ package Alire.Conditional_Values with Preelaborate is
|
||||
-- Visitor will be called for any immediate non-vector value
|
||||
-- Vector children will be iterated too, so a flat hierarchy will be mimicked for those
|
||||
|
||||
function All_Values (This : Conditional_Value) return Values;
|
||||
-- Returns all values herein, both true and false, at any depth
|
||||
|
||||
---------------
|
||||
-- SINGLES --
|
||||
---------------
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ package body Alire.Index is
|
||||
Description : Project_Description;
|
||||
Origin : Origins.Origin;
|
||||
-- Optional
|
||||
Depends_On : Release_Dependencies := No_Dependencies;
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Available_When : Alire.Requisites.Tree := No_Requisites)
|
||||
return Release
|
||||
@@ -56,12 +56,12 @@ package body Alire.Index is
|
||||
Description,
|
||||
Version,
|
||||
Origin,
|
||||
Depends_On,
|
||||
Dependencies,
|
||||
Properties => Properties,
|
||||
Available => Available_When)
|
||||
do
|
||||
if Catalog.Contains (Rel) then
|
||||
Log ("Attempt to register duplicate versions: " & Rel.Milestone.Image, Warning);
|
||||
Trace.Error ("Attempt to register duplicate versions: " & Rel.Milestone.Image);
|
||||
else
|
||||
Catalog.Insert (Rel);
|
||||
end if;
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ package Alire.Index is
|
||||
Description : Project_Description;
|
||||
Origin : Origins.Origin;
|
||||
-- Optional
|
||||
Depends_On : Release_Dependencies := No_Dependencies;
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Available_When : Alire.Requisites.Tree := No_Requisites)
|
||||
return Release;
|
||||
@@ -211,7 +211,7 @@ package Alire.Index is
|
||||
|
||||
function Set_Root_Project (Project : Alire.Project_Name;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Depends_On : Conditional.Dependencies := No_Dependencies)
|
||||
Dependencies : Conditional.Dependencies := No_Dependencies)
|
||||
return Release renames Root_Project.Set;
|
||||
-- This function must be called in the working project alire file.
|
||||
-- Otherwise alr does not know what's the current project, and its version and dependencies
|
||||
|
||||
+13
-13
@@ -153,19 +153,19 @@ package body Alire.Releases is
|
||||
|
||||
Search : constant String := To_Lower_Case (Str);
|
||||
begin
|
||||
-- for P of R.Properties.All_Values loop
|
||||
-- declare
|
||||
-- Text : constant String :=
|
||||
-- To_Lower_Case
|
||||
-- ((if Utils.Contains (P.Image, ":")
|
||||
-- then Utils.Tail (P.Image, ':')
|
||||
-- else P.Image));
|
||||
-- begin
|
||||
-- if Utils.Contains (Text, Search) then
|
||||
-- return True;
|
||||
-- end if;
|
||||
-- end;
|
||||
-- end loop;
|
||||
for P of R.Properties.All_Values loop
|
||||
declare
|
||||
Text : constant String :=
|
||||
To_Lower_Case
|
||||
((if Utils.Contains (P.Image, ":")
|
||||
then Utils.Tail (P.Image, ':')
|
||||
else P.Image));
|
||||
begin
|
||||
if Utils.Contains (Text, Search) then
|
||||
return True;
|
||||
end if;
|
||||
end;
|
||||
end loop;
|
||||
|
||||
return False;
|
||||
end Property_Contains;
|
||||
|
||||
@@ -20,7 +20,7 @@ package Alire.Releases with Preelaborate is
|
||||
Description : Project_Description;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
Depends_On : Conditional.Dependencies;
|
||||
Dependencies : Conditional.Dependencies;
|
||||
Properties : Conditional.Properties;
|
||||
Available : Alire.Requisites.Tree) return Release;
|
||||
|
||||
@@ -106,7 +106,7 @@ private
|
||||
Description : Project_Description;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
Depends_On : Conditional.Dependencies;
|
||||
Dependencies : Conditional.Dependencies;
|
||||
Properties : Conditional.Properties;
|
||||
Available : Alire.Requisites.Tree) return Release is
|
||||
(Name'Length, Description'Length,
|
||||
@@ -114,7 +114,7 @@ private
|
||||
Description,
|
||||
Version,
|
||||
Origin,
|
||||
Depends_On,
|
||||
Dependencies,
|
||||
Describe (Description) and Properties,
|
||||
Available);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ package body Alire.Root_Project is
|
||||
|
||||
function Set (Project : Alire.Project_Name;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Depends_On : Conditional.Dependencies := Conditional.For_Dependencies.Empty)
|
||||
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty)
|
||||
return Releases.Release
|
||||
is
|
||||
use Origins;
|
||||
@@ -44,7 +44,7 @@ package body Alire.Root_Project is
|
||||
Natural'Min (Descr'Length, Max_Description_Length)),
|
||||
Version,
|
||||
New_Filesystem (Ada.Directories.Current_Directory),
|
||||
Depends_On,
|
||||
Dependencies,
|
||||
Properties => Index.No_Properties,
|
||||
Available => Requisites.No_Requisites);
|
||||
begin
|
||||
|
||||
@@ -11,7 +11,7 @@ package Alire.Root_Project is
|
||||
|
||||
function Set (Project : Project_Name;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Depends_On : Conditional.Dependencies := Conditional.For_Dependencies.Empty)
|
||||
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty)
|
||||
return Releases.Release;
|
||||
-- This function must be called in the working project alire file.
|
||||
-- Otherwise alr does not know what's the current project, and its version and dependencies
|
||||
|
||||
Reference in New Issue
Block a user