Skip to content

Commit

Permalink
Fix alr install with canary file
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Aug 22, 2023
1 parent 567667b commit 9fac0f8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
12 changes: 9 additions & 3 deletions src/alire/alire-install.adb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ package body Alire.Install is
-- Use or regular deployment facilities, in case there are any
-- actions to perform.

Rel.Deploy (Env => Platforms.Current.Properties,
Parent_Folder => Prefix,
Was_There => Was_There);
Rel.Deploy (Env => Platforms.Current.Properties,
Parent_Folder => Prefix,
Was_There => Was_There,
Mark_Completion => False);
-- We set Mark_Completion to False because the deployment folder
-- is temporary, so we don't need to track completion if the
-- installation fails, and otherwise we will have a common file to
-- all installations (the ./alire/ canary file) that will cause a
-- clash after the first installation.

if not Rel.Project_Files (Platforms.Current.Properties,
With_Path => False).Is_Empty
Expand Down
7 changes: 5 additions & 2 deletions src/alire/alire-releases.adb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ package body Alire.Releases is
Was_There : out Boolean;
Perform_Actions : Boolean := True;
Create_Manifest : Boolean := False;
Include_Origin : Boolean := False)
Include_Origin : Boolean := False;
Mark_Completion : Boolean := True)
is
use Alire.Directories;
use all type Alire.Properties.Actions.Moments;
Expand Down Expand Up @@ -350,7 +351,9 @@ package body Alire.Releases is
end;
end if;

Completed.Mark (Complete => True);
if Mark_Completion then
Completed.Mark (Complete => True);
end if;

exception
when E : others =>
Expand Down
8 changes: 6 additions & 2 deletions src/alire/alire-releases.ads
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,15 @@ package Alire.Releases is
Was_There : out Boolean;
Perform_Actions : Boolean := True;
Create_Manifest : Boolean := False;
Include_Origin : Boolean := False);
Include_Origin : Boolean := False;
Mark_Completion : Boolean := True);
-- Deploy the sources of this release under the given Parent_Folder. If
-- Create_Manifest, any packaged manifest will be moved out of the way
-- and an authoritative manifest will be generated from index information.
-- The created manifest may optionally Include_Origin information.
-- The created manifest may optionally Include_Origin information. When
-- Mark_Completion, a trace file will be created in ./alire/copy_complete
-- so future inspections of the folder can ensure the operation wasn't
-- interrupted.

private

Expand Down

0 comments on commit 9fac0f8

Please sign in to comment.