mirror of
https://github.com/NixOS/nix
synced 2025-06-28 22:01:15 +02:00
Use libarchive for all compression
This commit is contained in:
parent
b19aec7eeb
commit
8a0c00b856
7 changed files with 241 additions and 378 deletions
|
@ -1,7 +1,26 @@
|
|||
#include "serialise.hh"
|
||||
#include <archive.h>
|
||||
|
||||
namespace nix {
|
||||
|
||||
struct TarArchive {
|
||||
struct archive *archive;
|
||||
Source *source;
|
||||
std::vector<unsigned char> buffer;
|
||||
|
||||
void check(int err, const char *reason = "Failed to extract archive (%s)");
|
||||
|
||||
TarArchive(Source& source, bool raw = false);
|
||||
|
||||
TarArchive(const Path &path);
|
||||
|
||||
// disable copy constructor
|
||||
TarArchive(const TarArchive&) = delete;
|
||||
|
||||
void close();
|
||||
|
||||
~TarArchive();
|
||||
};
|
||||
void unpackTarfile(Source & source, const Path & destDir);
|
||||
|
||||
void unpackTarfile(const Path & tarFile, const Path & destDir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue