Skip to content

Commit

Permalink
Bump CLIC dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Dec 15, 2023
1 parent b128821 commit df1c436
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/alire/alire-publish.adb
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ with Alire.TOML_Index;
with Alire.TOML_Keys;
with Alire.TOML_Load;
with Alire.User_Pins.Maps;
with Alire.Utils.Tools;
with Alire.Utils.TTY;
with Alire.Utils.User_Input.Query_Config;
with Alire.VCSs.Git;
with Alire.VFS;

with CLIC.User_Input;

with GNATCOLL.OS.Constants;

with Semantic_Versioning;

with TOML.File_IO;
Expand Down Expand Up @@ -672,8 +671,9 @@ package body Alire.Publish is
& String'("--exclude=./alire")
-- Exclude top-level alire folder, before applying prefix

-- exclude .git and the like, with workaround for macOS bsd tar
& (if GNATCOLL.OS.Constants.OS in GNATCOLL.OS.MacOS
-- exclude .git and the like, with workaround for bsdtar used by
-- macOS and Windows without MSYS2
& (if Utils.Tools.Is_BSD_Tar
then Empty_Vector
& "--exclude=./.git"
& "--exclude=./.hg"
Expand Down
16 changes: 16 additions & 0 deletions src/alire/alire-utils-tools.adb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
with AAA.Strings;

with Alire.OS_Lib.Subprocess; use Alire.OS_Lib.Subprocess;
with Alire.OS_Lib;
with Alire.Platforms.Current;
Expand Down Expand Up @@ -157,4 +159,18 @@ package body Alire.Utils.Tools is
Install_From_Distrib (Tool, Fail);
end Check_Tool;

----------------
-- Is_BSD_Tar --
----------------

function Is_BSD_Tar return Boolean is
use AAA.Strings;
begin
return Contains
(To_Lower_Case
(Checked_Spawn_And_Capture
("tar", To_Vector ("--version")).Flatten),
"bsdtar");
end Is_BSD_Tar;

end Alire.Utils.Tools;
3 changes: 3 additions & 0 deletions src/alire/alire-utils-tools.ads
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ package Alire.Utils.Tools is
-- Check if a required executable tool is available in PATH.
-- If not, try to install it. If unable and Fail, abort, otherwise return

function Is_BSD_Tar return Boolean;
-- Say if the tar in PATH is the bsdtar variant, which lacks some features

end Alire.Utils.Tools;
1 change: 1 addition & 0 deletions testsuite/drivers/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import re
import difflib
import sys

from drivers.alr import run_alr
from drivers.helpers import contents, lines_of
Expand Down
5 changes: 3 additions & 2 deletions testsuite/tests/index/env-path/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

import os
import re

from drivers.alr import crate_dirname, run_alr
from drivers.asserts import assert_match
Expand All @@ -13,7 +14,7 @@

# Show uses the path with portable separators, as the conversion is done just
# for printenv output.
assert_match(f".*{os.sep}crate_test_bin",
assert_match(f".*/crate_test_bin",
run_alr("show", "crate").out)

# Similarly, if we retrieve the crate, the output to the manifest must be in
Expand All @@ -24,7 +25,7 @@

# When obtained via printenv, the path must be native
os.chdir(crate_dirname('crate'))
assert_match(f".*PATH=[^\n]*{os.sep}crate_test_bin",
assert_match(".*PATH=[^\n]*" + re.escape(f"{os.sep}crate_test_bin"),
run_alr("printenv").out)

print('SUCCESS')

0 comments on commit df1c436

Please sign in to comment.