#pragma once
#include "types.hh"
#include "serialise.hh"
namespace nix {
/* dumpPath creates a Nix archive of the specified path. The format
is as follows:
IF path points to a REGULAR FILE:
dump(path) = attrs(
[ ("type", "regular")
, ("contents", contents(path))
])
IF path points to a DIRECTORY:
dump(path) = attrs(
[ ("type", "directory")
, ("entries", concat(map(f, sort(entries(path)))))
])
where f(fn) = attrs(
[ ("name", fn)
, ("file", dump(path + "/" + fn))
])
where:
attrs(as) = concat(map(attr, as)) + encN(0)
attrs((a, b)) = encS(a) + encS(b)
encS(s) = encN(len(s)) + s + (padding until next 64-bit boundary)
encN(n) = 64-bit little-endian encoding of n.
contents(path) = the contents of a regular file.
sort(strings) = lexicographic sort by 8-bit value (strcmp).
entries(path) = the entries of a directory, without `.' and
`..'.
`+' denotes string concatenation. */
struct PathFilter
{
virtual ~PathFilter() { }
virtual bool operator () (const Path & path) { return true; }
};
extern PathFilter defaultPathFilter;
void dumpPath(const Path & path, Sink & sink,
PathFilter & filter = defaultPathFilter);
struct ParseSink
{
virtual void createDirectory(const Path & path) { };
virtual void createRegularFile(const Path & path) { };
virtual void isExecutable() { };
virtual void preallocateContents(unsigned long long size) { };
virtual void receiveContents(unsigned char * data, unsigned int len) { };
virtual void createSymlink(const Path & path, const string & target) { };
};
void parseDump(ParseSink & sink, Source & source);
void restorePath(const Path & path, Source & source);
}
ion value='committer'>committer
Age | Commit message (Expand) | Author |
2022-08-05 | doc: Fix Guix manual URLs in 'htmlxref.cnf'....Fixes a regression introduced in
868da34d54365023223a4ff7520043ba55ad64e8.
* doc/htmlxref.cnf (GUIX): Remove "/guix".
| Ludovic Courtès |
2022-06-16 | doc: Remove obsolete comment from htmlxref.cnf....This is follow up to <https://issues.guix.gnu.org/55290>.
* doc/htmlxref.cnf (geiser): Delete obsolete comment.
| Maxim Cournoyer |
2022-04-08 | doc: Fix cookbook URLs in htmlxref.cnf....Reported by Greg Hogan <code@greghogan.com>.
* doc/htmlxref.cnf (GUIX_ROOT): New variable.
(GUIX, GUIX_COOKBOOK): Adjust.
| Ludovic Courtès |
2021-10-04 | doc: Update htmlxref.cnf....Update and fix broken references to cuirass, git, and guix-cookbook.
* doc/htmlxref.cnf: Update from Texinfo. Factorize Guix manuals.
(cuirass, git, guix-cookbook, guix-cookbook.de, guix-cookbook.fr): New
entries.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| Sarah Morgensen |
2021-04-24 | doc: Fix cross-reference URL to translated manual....* doc/htmlxref.cnf: Fix translated manual URL.
| Julien Lepiller |
2020-01-12 | doc: Update htmlxref.cnf....* doc/htmlxref.cnf: Update from Texinfo. Add entries for "mes",
"guix.ru", and "guix.zh_CN".
| Ludovic Courtès |