aboutsummaryrefslogtreecommitdiff
#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);

}
e='2023-05-07 19:29:26 +0300'>2023-05-07gnu: sniffglue: Add missing input....* gnu/packages/rust-apps.scm (sniffglue)[native-inputs]: Add perl. Efraim Flashner 2023-05-07gnu: alfis: Add missing input....* gnu/packages/rust-apps.scm (alfis)[native-inputs]: Add perl. Efraim Flashner 2023-05-07gnu: agate: Add missing input....* gnu/packages/rust-apps.scm (agate)[native-inputs]: Add perl. Efraim Flashner 2023-05-07gnu: rust-ring-0.16: Remove pregenerated files....* gnu/packages/crates-io.scm (rust-ring-0.16)[source]: Add snippet to remove pregenerated files and add fake .git directory. [native-inputs]: Add perl. [supported-systems]: New field. * gnu/packages/rust-apps.scm (tealdeer)[native-inputs]: Add perl. Efraim Flashner 2023-05-07gnu: fd: Update to 8.7.0....* gnu/packages/rust-apps.scm (fd): Update to 8.7.0. [arguments]: Add cargo-test-flags to skip a test. Don't install source. Adjust custom 'override-jemalloc phase to continue using system jemalloc. Rewrite custom 'install-extra phase for changes in source code. [cargo-inputs]: Add rust-anyhow-1, rust-argmax-0.3, rust-chrono-0.4, rust-clap-complete-4, rust-crossbeam-channel-0.5, rust-dirs-next-2, rust-faccess-0.2, rust-nix-0.26, rust-normpath-0.3, rust-nu-ansi-term-0.46, rust-once-cell-1. Remove rust-dirs-2, rust-lazy-static-1. Replace rust-clap-2 with 4, rust-jemallocator-0.3 with 0.5, rust-lscolors-0.7 with 0.13, rust-users-0.10 with 0.11. [cargo-development-inputs]: Add rust-tempfile-3, rust-test-case-2. Remove rust-tempdir-0.3. Efraim Flashner 2023-05-07gnu: tealdeer: Update to 1.6.1....* gnu/packages/rust-apps.scm (tealdeer): Update to 1.6.1. [source]: Download using git-fetch. [arguments]: Adjust 'install-completions phase to install zsh completions also. Skip 2 more tests. [cargo-inputs]: Add rust-anyhow-1, rust-clap-3, rust-yansi-0.5, rust-zip-0.6. Remove rust-ansi-term-0.12, rust-docopt-1, rust-flate-2, rust-tar-0.4, rust-xdg-2. Replace rust-env-logger-0.7 with 0.9, rust-pager-0.15 with 0.16, rust-reqwest-0.10 with 0.11. [cargo-development-inputs]: Remove rust-remove-dir-all-0.5.2. Replace rust-assert-cmd-1 with 2, rust-predicates-1 with 2. * gnu/packages/crates-io.scm (rust-remove-dir-all-0.5.2): Remove variable. Efraim Flashner 2023-05-07gnu: rust-cargo-c: Update to 0.9.16....* gnu/packages/crates-io.scm (rust-cargo-c): Update to 0.9.16. [cargo-inputs]: Add rust-cargo-util-0.2, rust-cc-1, rust-clap-4, rust-glob-0.3, rust-itertools-0.10. Remove rust-pretty-env-logger-0.4, rust-cargo-metadata-0.9. Replace rust-cbindgen-0.20 with 0.24, rust-cargo-0.60 with 0.68, rust-semver-0.10 with 1, rust-toml-0.5 with 0.6. [inputs]: Replace libgit2-1.3 with libgit2, openssl-1.1 with openssl. Efraim Flashner 2023-04-14Merge branch 'master' into core-updates....Conflicts: gnu/local.mk gnu/packages/build-tools.scm gnu/packages/certs.scm gnu/packages/check.scm gnu/packages/compression.scm gnu/packages/cups.scm gnu/packages/fontutils.scm gnu/packages/gnuzilla.scm gnu/packages/guile.scm gnu/packages/ibus.scm gnu/packages/image-processing.scm gnu/packages/linux.scm gnu/packages/music.scm gnu/packages/nss.scm gnu/packages/pdf.scm gnu/packages/python-xyz.scm gnu/packages/qt.scm gnu/packages/ruby.scm gnu/packages/shells.scm gnu/packages/tex.scm gnu/packages/video.scm gnu/packages/vulkan.scm gnu/packages/web.scm gnu/packages/webkit.scm gnu/packages/wm.scm Maxim Cournoyer 2023-04-12gnu: Remove abandoned spotify-tui package....* gnu/packages/rust-apps.scm (spotify-tui): Remove variable. See <https://github.com/Rigellute/spotify-tui/pull/1076>. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> jgart 2023-03-31gnu: Replace all uses of atk by at-spi2-core....* gnu/packages/animation.scm (gnash) * gnu/packages/chromium.scm (ungoogled-chromium) * gnu/packages/crates-gtk.scm (rust-atk-sys-0.14, rust-atk-sys-0.10, rust-atk-0.14, rust-gtk-0.14) * gnu/packages/gimp.scm (gimp) * gnu/packages/gnome.scm (evince, glade3, clutter, totem, rhythmbox, mutter, ghex): * gnu/packages/graphviz.scm (xdot) * gnu/packages/gtk.scm (gtk+-2, gtk+, guile-gnome, atkmm) * gnu/packages/mate.scm (mate-applets, atril, mate-control-center, mate-calc, mate-utils, eom, pluma) * gnu/packages/messaging.scm (dino) * gnu/packages/qt.scm (qtwebengine-5) * gnu/packages/rust-apps.scm (alfis) * gnu/packages/vim.scm (vim-full) * gnu/packages/vnc.scm (remmina) * gnu/packages/web.scm (castor): Replace atk by at-spi2-core. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Josselin Poiret 2023-02-08gnu: rust-cargo: Update to 0.60.0....* gnu/packages/crates-io.scm (rust-cargo-0.60): Update to 0.60.0. [cargo-inputs]: Add rust-cargo-util-0.1. Replace rust-env-logger-0.8 with rust-env-logger-0.9. Replace rust-opener-0.4 with rust-opener-0.5. Add rust-os-info-3. Replace rust-rustfix-0.5 with rust-rustfix-0.6. Add rust-socket2-0.4. Remove duplicate rust-tar-0.4. * gnu/packages/rust-apps.scm (rust-cargo-c): Update to 0.9.8+cargo-0.60. [cargo-inputs]: Replace rust-cbindgen-0.19 with rust-cbindgen-0.20. Replace rust-cargo-0.53 with rust-cargo-0.60. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Co-authored-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Paul Alesius 2023-02-08gnu: Add rust-cbindgen-0.20....* gnu/packages/rust-apps.scm (rust-cbindgen-0.20): New variable. Maxim Cournoyer 2023-01-08gnu: tectonic: Update to 0.12.0....* gnu/packages/rust-apps.scm (tectonic): Update to 0.12.0. * gnu/packages/crates-io.scm (rust-tectonic-bridge-graphite2): Update to 0.2.1. [arguments]: Do not skip build. [native-inputs]: Add PKG-CONFIG. [inputs]: Add GRAPHITE2. (rust-tectonic-bundles): Update to 0.3. [arguments]: Do not skip build. <#:cargo-inputs>: Update RUST-TECTONIC-IO-BASE to 0.4. [native-inputs]: Add PKG-CONFIG. [inputs]: Add OPENSSL and ZLIB. (rust-tectonic-docmodel): Update to 0.2.0. [arguments]: Do not skip build. (rust-tectonic-engine-xetex): Update to 0.4.1. [arguments]: Do not skip build. <#:cargo-inputs>: Update RUST-TECTONIC-PDF-IO to 0.4 and RUST-TECTONIC-XETEX-LAYOUT to 0.2. [native-inputs]: Add PKG-CONFIG. [inputs]: Add FONTCONFIG, FREETYPE, GRAPHITE2, ICU4C and ZLIB. (rust-tectonic-engine-xdvipdfmx): Update to 0.4.0. [arguments]: Do not skip build. <#:cargo-inputs>: Remove RUST-CBINDGEN, update RUST-TECTONIC-BRIDGE-CORE to 0.3 and RUST-TECTONIC-PDF-IO to 0.4. [native-inputs]: Add PKG-CONFIG. [inputs]: Add LIBPNG and ZLIB. (rust-tectonic-pdf-io): Update to 0.4. [arguments]: Do not skip build. <#:cargo-inputs>: Update RUST-TECTONIC-BRIDGE-CORE to 0.3. (rust-tectonic-xetex-layout): Update to 0.2.1. [arguments]: Do not skip build. <#:cargo-inputs>: Update RUST-TECTONIC-BRIDGE-CORE to 0.3. [native-inputs]: Add PKG-CONFIG. [inputs]: Add FONTCONFIG, FREETYPE, GRAPHITE2, ICU4C and ZLIB. Nicolas Goaziou 2022-12-09gnu: Add htmlq....* gnu/packages/rust-apps.scm (htmlq): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Greg Hogan 2022-11-30