#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); } >author
path: root/etc/completion/bash
AgeCommit message (Expand)Author
2019-04-29guix package: Add 'install', 'remove', and 'upgrade' aliases....Ludovic Courtès
2018-11-06bash completion: Restore completion of available packages for 'guix build'....Ludovic Courtès
2018-07-03bash completion: Complete files names after 'guix weather -m'....Oleg Pykhalov
2018-07-03bash completion: Complete files names after 'guix build -L'....Oleg Pykhalov
2018-06-16Add guix-daemon Bash completion file....Oleg Pykhalov
2018-02-17bash completion: Complete files names after 'guix package -m'....Oleg Pykhalov
2017-08-22bash completion: Complete files names after 'guix download'....Marius Bakke
2017-02-07bash completion: Complete subcommands for the current word....Ludovic Courtès
2017-02-07bash completion: Properly complete 'guix container exec'....Ludovic Courtès
2017-02-07bash completion: Complete file names after 'guix system COMMAND'....Ludovic Courtès
2017-02-07bash completion: Complete 'guix gc' with file names....Ludovic Courtès
2016-09-07bash completion: Complete subcommands and their options....Ludovic Courtès
2016-09-07bash completion: Redirect 'guix' stderr to /dev/null....Ludovic Courtès