Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove per-OS absolute path check in favor of GNAT.OS_Lib #1717

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/alire/alire.adb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ with GNATCOLL.OS.Constants;

package body Alire is

package OS renames GNAT.OS_Lib;

---------
-- "=" --
---------
Expand All @@ -37,7 +39,17 @@ package body Alire is
-- Check_Absolute_Path --
-------------------------

function Check_Absolute_Path (Path : Any_Path) return Boolean is separate;
function Check_Absolute_Path (Path : Any_Path) return Boolean
is (OS.Is_Absolute_Path (Path)
and then
-- On Windows, we must ensure the path is not only absolute but
-- also that it has a drive letter. This is not checked by the
-- GNAT.OS_Lib function.
(if OS.Directory_Separator = '\'
then
(Path'Length >= 3
and then Path (Path'First) in 'a' .. 'z' | 'A' .. 'Z'
and then Path (Path'First + 1) = ':')));

-------------
-- Err_Log --
Expand Down
7 changes: 0 additions & 7 deletions src/alire/os_freebsd/alire-check_absolute_path.adb

This file was deleted.

7 changes: 0 additions & 7 deletions src/alire/os_linux/alire-check_absolute_path.adb

This file was deleted.

7 changes: 0 additions & 7 deletions src/alire/os_macos/alire-check_absolute_path.adb

This file was deleted.

7 changes: 0 additions & 7 deletions src/alire/os_openbsd/alire-check_absolute_path.adb

This file was deleted.

10 changes: 0 additions & 10 deletions src/alire/os_windows/alire-check_absolute_path.adb

This file was deleted.

4 changes: 4 additions & 0 deletions testsuite/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

clear
python3 run.py -M1 "$@"
Loading