From dfe375e495e77c5a6f8b06689ff299eb786b145d Mon Sep 17 00:00:00 2001 From: Jano at Zelda Date: Wed, 31 Jan 2018 22:21:19 +0100 Subject: [PATCH] updating, upgrading, respawning working --- src/alire-index.adb | 6 +++++- src/alire-index.ads | 28 ++++++++++++++-------------- src/alire-repositories.ads | 3 ++- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/alire-index.adb b/src/alire-index.adb index 8b6056cf..6c579e3c 100644 --- a/src/alire-index.adb +++ b/src/alire-index.adb @@ -20,7 +20,11 @@ package body Alire.Index is Id, Depends_On) do - Releases.Insert (Rel); + if Releases.Contains (Rel) then + Log ("Attempt to register duplicate versions: " & Rel.Milestone_Image); + else + Releases.Insert (Rel); + end if; end return; end Register; diff --git a/src/alire-index.ads b/src/alire-index.ads index 6c621dda..df76ffe0 100644 --- a/src/alire-index.ads +++ b/src/alire-index.ads @@ -2,7 +2,6 @@ with Alire.Containers; with Alire.Depends; with Alire.Releases; with Alire.Repositories.Git; -with Alire.Repositories.Local; with Semantic_Versioning; @@ -35,10 +34,10 @@ package Alire.Index is Depends_On : Dependencies := Depends.Nothing; License : Licenses := Unknown) return Release; - function Register_Local (Project : Project_Name; - Version : Semantic_Versioning.Version; - Depends_On : Dependencies := Depends.Nothing; - License : Licenses := Unknown) return Release; +-- function Register_Local (Project : Project_Name; +-- Version : Semantic_Versioning.Version; +-- Depends_On : Dependencies := Depends.Nothing; +-- License : Licenses := Unknown) return Release; -- Shortcuts to give dependencies: @@ -79,15 +78,16 @@ private Depends_On, License)); - function Register_Local (Project : Project_Name; - Version : Semantic_Versioning.Version; - Depends_On : Dependencies := Depends.Nothing; - License : Licenses := Unknown) return Release is - (Register (Project, - Version, - Repositories.Local.Repo, "", - Depends_On, - License)); +-- function Register_Local (Project : Project_Name; +-- Version : Semantic_Versioning.Version; +-- Depends_On : Dependencies := Depends.Nothing; +-- License : Licenses := Unknown) return Release is +-- (Register (Project, +-- Version, +-- Repositories.Local.Repo, +-- "filesystem", +-- Depends_On, +-- License)); use Depends; use Semantic_Versioning; diff --git a/src/alire-repositories.ads b/src/alire-repositories.ads index 94df078e..aa2a269c 100644 --- a/src/alire-repositories.ads +++ b/src/alire-repositories.ads @@ -2,7 +2,8 @@ with Ada.Containers.Indefinite_Holders; package Alire.Repositories with Preelaborate is - subtype Release_Id is String; + subtype Release_Id is String + with Dynamic_Predicate => Release_Id'Length > 0; -- Uniquely identifies a particular release within a repository -- E.g., git/hg hashes, a zip file within a file server...