#include "store-api.hh" #include "globals.hh" #include "util.hh" #include namespace nix { GCOptions::GCOptions() { action = gcDeleteDead; ignoreLiveness = false; maxFreed = ULLONG_MAX; } bool isInStore(const Path & path) { return isInDir(path, settings.nixStore); } bool isStorePath(const Path & path) { return isInStore(path) && path.find('/', settings.nixStore.size() + 1) == Path::npos; } void assertStorePath(const Path & path) { if (!isStorePath(path)) throw Error(format("path `%1%' is not in the store") % path); } Path toStorePath(const Path & path) { if (!isInStore(path)) throw Error(format("path `%1%' is not in the store") % path); Path::size_type slash = path.find('/', settings.nixStore.size() + 1); if (slash == Path::npos) return path; else return Path(path, 0, slash); } string storePathToName(const Path & path) { assertStorePath(path); return string(path, settings.nixStore.size() + 34); } void chec
aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2023-08-20 02:00:00 +0200
committerLudovic Courtès <ludo@gnu.org>2024-08-31 10:42:46 +0200
commita97ca00a5dcf7bcce6e9ec04557d02d65d80732f (patch)
tree8d17f6a986619c97f9b68db53cdb07a3d8a87265 /gnu/packages
parent3db653a2c235207b347849200eeb3f89bb4ba513 (diff)
downloadguix-a97ca00a5dcf7bcce6e9ec04557d02d65d80732f.tar.gz
guix-a97ca00a5dcf7bcce6e9ec04557d02d65d80732f.zip
gnu: image: Reformat comments.
I wrote these to fit on their lines, so the pointless widows bug me. * gnu/build/image.scm (make-iso9660-image): M-q comments.
Diffstat (limited to 'gnu/packages')
0 files changed, 0 insertions, 0 deletions
hash, name); } /* Return a string accepted by decodeValidPathInfo() that registers the specified paths as valid. Note: it's the responsibility of the caller to provide a closure. */ string StoreAPI::makeValidityRegistration(const PathSet & paths, bool showDerivers, bool showHash) { string s = ""; foreach (PathSet::iterator, i, paths) { s += *i + "\n"; ValidPathInfo info = queryPathInfo(*i); if (showHash) { s += printHash(info.hash) + "\n"; s += (format("%1%\n") % info.narSize).str(); } Path deriver = showDerivers ? info.deriver : ""; s += deriver + "\n"; s += (format("%1%\n") % info.references.size()).str(); foreach (PathSet::iterator, j, info.references) s += *j + "\n"; } return s; } string showPaths(const PathSet & paths) { string s; foreach (PathSet::const_iterator, i, paths) { if (s.size() != 0) s += ", "; s += "`" + *i + "'"; } return s; } void exportPaths(StoreAPI & store, const Paths & paths, bool sign, Sink & sink) { foreach (Paths::const_iterator, i, paths) { writeInt(1, sink); store.exportPath(*i, sign, sink); } writeInt(0, sink); } Path readStorePath(Source & from) { Path path = readString(from); assertStorePath(path); return path; } template T readStorePaths(Source & from) { T paths = readStrings(from); foreach (typename T::iterator, i, paths) assertStorePath(*i); return paths; } template PathSet readStorePaths(Source & from); } #include "local-store.hh" #include "serialise.hh" namespace nix { std::shared_ptr store; std::shared_ptr openStore(bool reserveSpace) { return std::shared_ptr(new LocalStore(reserveSpace)); } }