aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-02-27 14:38:01 +0100
committerBjörn Gustavsson <[email protected]>2017-04-12 14:23:54 +0200
commit74cf5ae0d850cf38fab24edf2c3f26b860b080ed (patch)
treecbd135baef00cd0f633e3e90b470b232e18db30e /lib/tools
parent19e9249d960a5b15b4e222efdcb96efbe122853e (diff)
downloadotp-74cf5ae0d850cf38fab24edf2c3f26b860b080ed.tar.gz
otp-74cf5ae0d850cf38fab24edf2c3f26b860b080ed.tar.bz2
otp-74cf5ae0d850cf38fab24edf2c3f26b860b080ed.zip
Don't create absolute path names in tar files
We should not assume that erl_tar will allow unpacking tar files with absolute path names for archive members.
Diffstat (limited to 'lib/tools')
-rw-r--r--lib/tools/test/xref_SUITE.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl
index f308ea1204..b8e7113595 100644
--- a/lib/tools/test/xref_SUITE.erl
+++ b/lib/tools/test/xref_SUITE.erl
@@ -89,11 +89,11 @@ init_per_suite(Conf) when is_list(Conf) ->
DataDir = ?datadir,
PrivDir = ?privdir,
CopyDir = fname(PrivDir, "datacopy"),
+ ok = file:make_dir(CopyDir),
TarFile = fname(PrivDir, "datacopy.tgz"),
- {ok, Tar} = erl_tar:open(TarFile, [write, compressed]),
- ok = erl_tar:add(Tar, DataDir, CopyDir, [compressed]),
- ok = erl_tar:close(Tar),
- ok = erl_tar:extract(TarFile, [compressed]),
+ ok = file:set_cwd(DataDir),
+ ok = erl_tar:create(TarFile, ["."], [compressed]),
+ ok = erl_tar:extract(TarFile, [compressed, {cwd,CopyDir}]),
ok = file:delete(TarFile),
[{copy_dir, CopyDir}|Conf].