mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
ed24baaec4
There is no longer an `importTarball` method. Instead, there is a `unpackTarfileToSink` function (back in libutil). The caller can use thisw with the `getParseSink` method we added in the last commit easily enough. In addition, tarball cache functionality is separated from `git-utils` and moved into `tarball-cache`. This ensures we are separating mechanism and policy.
35 lines
729 B
C++
35 lines
729 B
C++
#pragma once
|
|
///@file
|
|
|
|
#include "serialise.hh"
|
|
#include "fs-sink.hh"
|
|
#include <archive.h>
|
|
|
|
namespace nix {
|
|
|
|
struct TarArchive {
|
|
struct archive * archive;
|
|
Source * source;
|
|
std::vector<unsigned char> buffer;
|
|
|
|
void check(int err, const std::string & 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);
|
|
|
|
time_t unpackTarfileToSink(TarArchive & archive, FileSystemObjectSink & parseSink);
|
|
|
|
}
|