diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 13:23:48 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 13:23:48 +0000 |
commit | 9d39cb1d6418c5a25fa74f09e593794a4c8fd4b6 (patch) | |
tree | cb9c4a3c46ec16fda8286aee56c13443f08efcad /tools/llvm-ar/llvm-ar.cpp | |
parent | be984d6376bf42f9e05fb660b44808cffe9711a8 (diff) | |
download | external_llvm-9d39cb1d6418c5a25fa74f09e593794a4c8fd4b6.zip external_llvm-9d39cb1d6418c5a25fa74f09e593794a4c8fd4b6.tar.gz external_llvm-9d39cb1d6418c5a25fa74f09e593794a4c8fd4b6.tar.bz2 |
Revert "Don't include directory names in archives."
This reverts commit 184420.
Investigating the bot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184421 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar/llvm-ar.cpp')
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index 941b631..36bec42 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -399,6 +399,14 @@ doExtract(std::string* ErrMsg) { if (Paths.empty() || (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) { + // Make sure the intervening directories are created + if (I->hasPath()) { + sys::Path dirs(I->getPath()); + dirs.eraseComponent(); + if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg)) + return true; + } + // Open up a file stream for writing std::ios::openmode io_mode = std::ios::out | std::ios::trunc | std::ios::binary; |