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

Report the name of an unreadable directory. #1522

Closed
Closed
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
2 changes: 1 addition & 1 deletion src/alire/alire-index_on_disk.adb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ package body Alire.Index_On_Disk is
Dir : constant Virtual_File := Create (+Path);
begin
if not Dir.Is_Directory then
Result := Outcome_Failure ("Not a readable directory");
Result := Outcome_Failure ("Not a readable directory: " & Path);
return New_Invalid_Index;
end if;

Expand Down
9 changes: 7 additions & 2 deletions testsuite/tests/index/local-index-not-found/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
from drivers.alr import prepare_indexes, run_alr
from drivers.asserts import assert_match

def comparator(param):
"""If the test value (in d) is 'no-such-directory', the value tested for
is './no-such-directory'; if not, it's left as it is."""
if param == 'no-such-directory': return './no-such-directory'
return param

for d in ('no-such-directory',
'file://no-such-directory', ):
Expand All @@ -21,9 +26,9 @@
path_excerpt = os.path.join('alr-config', 'indexes', 'bad_index',
'index.toml')
assert_match('ERROR: Cannot load metadata from .*{}:'
' Not a readable directory'
' Not a readable directory: {}'
'\n'
.format(re.escape(path_excerpt)),
.format(re.escape(path_excerpt), comparator(d)),
p.out)

print('SUCCESS')
Loading