Skip to content

Commit

Permalink
Self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Jun 16, 2024
1 parent 60e4bf6 commit 2b5f38c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/alire/alire-directories.adb
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,16 @@ package body Alire.Directories is

end if;

-- Ensure that for some bizarre reason, the temp name does not exist
-- already.

if Adirs.Exists (+This.Name) then
Trace.Debug
("Name clash for tempfile: " & (+This.Name) & ", retrying...");
This.Initialize;
return;
end if;

Trace.Debug ("Selected name for tempfile: " & (+This.Name)
& " when at dir: " & Current);

Expand Down
6 changes: 5 additions & 1 deletion testsuite/drivers/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from shutil import rmtree
import subprocess
from drivers.alr import alr_builds_dir, run_alr
from drivers.helpers import content_of


def clear_builds_dir() -> None:
Expand Down Expand Up @@ -40,7 +41,10 @@ def find_dir(crate_name: str) -> str:
forward slashes in the returned folder path.
"""
if len(found := glob(f"{path()}/{crate_name}*/*")) != 1:
raise AssertionError(f"Unexpected number of dirs for crate {crate_name}: {found}")
raise AssertionError(f"Unexpected number of dirs for crate {crate_name}: {found}" + \
str(['\nINPUTS:\n' + content_of(os.path.join(f, "alire", "build_hash_inputs")) \
for f in found])
)
return glob(f"{path()}/{crate_name}*/*")[0].replace(os.sep, "/")


Expand Down
4 changes: 2 additions & 2 deletions testsuite/tests/printenv/out-of-root/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
# Verify root crate proper path in GPR_PROJECT_PATH
assert_match(r".*GPR_PROJECT_PATH[^\n]+"
+ re.escape(os.path.join(parent, "base"))
+ "(:|\")", p.out)
+ "(:|;|\")", p.out)

# Verify pinned crate proper path in GPR_PROJECT_PATH
assert_match(r".*GPR_PROJECT_PATH[^\n]+"
+ re.escape(os.path.join(parent, "base", "pinned"))
+ "(:|\")", p.out)
+ "(:|;|\")", p.out)

print("SUCCESS")

0 comments on commit 2b5f38c

Please sign in to comment.