Skip to content

Commit

Permalink
Remove trailing '/' separator in extra prj paths
Browse files Browse the repository at this point in the history
This is to match the output of full path normalization by Ada.Directories.
  • Loading branch information
mosteo committed Jul 2, 2020
1 parent 5575cb9 commit 36b54ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/alire/alire-releases.adb
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,10 @@ package body Alire.Releases is
for File of Files loop
if Contains (File, "/") then
Paths.Include
(File (File'First .. Fixed.Index (File, "/", Backward)));
(File (File'First .. Fixed.Index (File, "/", Backward) - 1));
-- To match the output of root crate paths and Ada.Directories
-- full path normalization, a path separator in the last
-- position is not included.
end if;
end loop;
end return;
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/setenv/linked-paths/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Check paths are proper (base and one extra nested)
p = run_alr("setenv")
assert_match(('export GPR_PROJECT_PATH=".*/my_index/crates/crate_1234' +
path_separator() + '.*/my_index/crates/crate_1234/nested/"\n' +
path_separator() + '.*/my_index/crates/crate_1234/nested"\n' +
'export ALIRE="True"\n').replace('/', re.escape(dir_separator())),
p.out)

Expand Down

0 comments on commit 36b54ec

Please sign in to comment.