Skip to content

Commit

Permalink
Remove per-OS code in favor of GNAT.OS_Lib
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Jul 10, 2024
1 parent 432ae28 commit 8f0542b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 39 deletions.
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 "$@"

0 comments on commit 8f0542b

Please sign in to comment.