aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-03-21 17:27:26 +0100
committerPeter Andersson <[email protected]>2012-03-21 17:27:26 +0100
commitef60b9f4da7156106c688c9f291db4eeecc264be (patch)
tree3e3627a587af3bec187a1bb93eaa4853cf0110c8 /lib/test_server
parent22d5fe18a285784fe724d5f1ce62578bd7ff4f1a (diff)
downloadotp-ef60b9f4da7156106c688c9f291db4eeecc264be.tar.gz
otp-ef60b9f4da7156106c688c9f291db4eeecc264be.tar.bz2
otp-ef60b9f4da7156106c688c9f291db4eeecc264be.zip
Repair is_release_available/1
OTP-9633
Diffstat (limited to 'lib/test_server')
-rw-r--r--lib/test_server/src/test_server_node.erl23
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/test_server/src/test_server_node.erl b/lib/test_server/src/test_server_node.erl
index 1fd40d1dd9..2cc4facc32 100644
--- a/lib/test_server/src/test_server_node.erl
+++ b/lib/test_server/src/test_server_node.erl
@@ -943,12 +943,23 @@ find_rel_suse_1(Rel, RootWc) ->
end.
find_rel_suse_2(Rel, RootWc) ->
- Wc = RootWc ++ "_" ++ Rel,
- case filelib:wildcard(Wc) of
- [] ->
- [];
- [R|_] ->
- [filename:join([R,"bin","erl"])]
+ RelDir = filename:dirname(RootWc),
+ Pat = filename:basename(RootWc ++ "_" ++ Rel) ++ ".*",
+ case file:list_dir(RelDir) of
+ {ok,Dirs} ->
+ case lists:filter(fun(Dir) ->
+ case re:run(Dir, Pat) of
+ nomatch -> false;
+ _ -> true
+ end
+ end, Dirs) of
+ [] ->
+ [];
+ [R|_] ->
+ [filename:join([RelDir,R,"bin","erl"])]
+ end;
+ _ ->
+ []
end.
%% suse_release() -> VersionString | none.