From d15b01235d5c1bfcf76e8ce82b2b1314a1ddcacb Mon Sep 17 00:00:00 2001 From: Daly Brown <47283601+dalybrown@users.noreply.github.com> Date: Mon, 22 Jan 2024 11:53:45 -0500 Subject: [PATCH] Move To_Portable to body and make it a regular function --- src/alire/alire-vfs.adb | 19 +++++++++++++++++-- src/alire/alire-vfs.ads | 9 --------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/alire/alire-vfs.adb b/src/alire/alire-vfs.adb index 4dd2294a4..2fb2e3b6c 100644 --- a/src/alire/alire-vfs.adb +++ b/src/alire/alire-vfs.adb @@ -11,8 +11,8 @@ package body Alire.VFS is return String is Relative : constant Any_Path := - Directories.Find_Relative_Path (Parent => From, - Child => Path); + Directories.Find_Relative_Path (Parent => From, + Child => Path); begin if Check_Absolute_Path (Relative) then return Path; @@ -21,6 +21,21 @@ package body Alire.VFS is end if; end Attempt_Portable; + ----------------- + -- To_Portable -- + ----------------- + + function To_Portable (Path : Relative_Path) return Portable_Path + is + begin + case GNATCOLL.OS.Constants.OS is + when MacOS | Unix => + return Portable_Path (Path); + when Windows => + return Portable_Path (Replace (Path, "\", "/")); + end case; + end To_Portable; + -------------- -- Read_Dir -- -------------- diff --git a/src/alire/alire-vfs.ads b/src/alire/alire-vfs.ads index 2f406f9cf..743ddd224 100644 --- a/src/alire/alire-vfs.ads +++ b/src/alire/alire-vfs.ads @@ -96,15 +96,6 @@ private and then not Check_Absolute_Path (Path)); - ----------------- - -- To_Portable -- - ----------------- - - function To_Portable (Path : Relative_Path) return Portable_Path - is (case GNATCOLL.OS.Constants.OS is - when MacOS | Unix => Portable_Path (Path), - when Windows => Portable_Path (Replace (Path, "\", "/"))); - --------------- -- To_Native -- ---------------