Add support for SVN repositories

This commit is contained in:
Pierre-Marie de Rodat
2018-10-10 14:09:12 -04:00
parent 9ba483b9b9
commit 45498a4a93
3 changed files with 17 additions and 6 deletions
+1
View File
@@ -163,6 +163,7 @@ package Alire.Index is
function Git (URL : Alire.URL; Commit : Origins.Git_Commit) return Origins.Origin renames Origins.New_Git;
function Hg (URL : Alire.URL; Commit : Origins.Hg_Commit) return Origins.Origin renames Origins.New_Hg;
function SVN (URL : Alire.URL; Commit : String) return Origins.Origin renames Origins.New_SVN;
function Packaged_As (S : String) return Origins.Package_Names renames Origins.Packaged_As;
+14 -5
View File
@@ -30,6 +30,7 @@ package Alire.Origins with Preelaborate is
type Kinds is (Filesystem, -- Not really an origin, but a working copy of a project
Git, -- Remote git repo
Hg, -- Remote hg repo
SVN, -- Remote svn repo
Native -- Native platform package
);
@@ -41,8 +42,8 @@ package Alire.Origins with Preelaborate is
-- member data --
-------------------
function Commit (This : Origin) return String with Pre => This.Kind in Git | Hg;
function URL (This : Origin) return Alire.URL with Pre => This.Kind in Git | Hg;
function Commit (This : Origin) return String with Pre => This.Kind in Git | Hg | SVN;
function URL (This : Origin) return Alire.URL with Pre => This.Kind in Git | Hg | SVN;
function Path (This : Origin) return String with Pre => This.Kind = Filesystem;
@@ -69,6 +70,8 @@ package Alire.Origins with Preelaborate is
Commit : Hg_Commit)
return Origin;
function New_SVN (URL : Alire.URL; Commit : String) return Origin;
function New_Native (Packages : Native_Packages) return Origin;
function Image (This : Origin) return String;
@@ -122,6 +125,12 @@ private
Commit => +Commit,
others => <>);
function New_SVN (URL : Alire.URL; Commit : String) return Origin is
(SVN,
URL => +URL,
Commit => +Commit,
others => <>);
function New_Native (Packages : Native_Packages) return Origin is
(Native,
Packages => Packages,
@@ -144,9 +153,9 @@ private
function Image (This : Origin) return String is
(case This.Kind is
when Git | Hg => "commit " & S (This.Commit) & " from " & S (This.URL),
when Native => "native package from platform software manager",
when Filesystem => "path " & S (This.Path));
when Git | Hg | SVN => "commit " & S (This.Commit) & " from " & S (This.URL),
when Native => "native package from platform software manager",
when Filesystem => "path " & S (This.Path));
overriding function To_Code (This : Origin) return Utils.String_Vector is
(if This.Kind = Filesystem
+2 -1
View File
@@ -280,7 +280,8 @@ private
when Native => "native",
when Git | Hg => (if R.Origin.Commit'Length <= 8
then R.Origin.Commit
else R.Origin.Commit (R.Origin.Commit'First .. R.Origin.Commit'First + 7))));
else R.Origin.Commit (R.Origin.Commit'First .. R.Origin.Commit'First + 7)),
when SVN => R.Origin.Commit));
function On_Platform_Actions (R : Release; P : Alire.Properties.Vector) return Alire.Properties.Vector is
(R.On_Platform_Properties (P, Actions.Action'Tag));