diff --git a/src/alire/alire-releases.adb b/src/alire/alire-releases.adb index 89643b358..291aa383e 100644 --- a/src/alire/alire-releases.adb +++ b/src/alire/alire-releases.adb @@ -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; diff --git a/testsuite/tests/setenv/linked-paths/test.py b/testsuite/tests/setenv/linked-paths/test.py index 9dbdc16d6..6ff67b8cf 100644 --- a/testsuite/tests/setenv/linked-paths/test.py +++ b/testsuite/tests/setenv/linked-paths/test.py @@ -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)