summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/lexer.l2
-rw-r--r--src/libexpr/local.mk2
-rw-r--r--src/libstore/binary-cache-store.cc3
-rw-r--r--src/libstore/build/derivation-goal.cc8
-rw-r--r--src/libstore/build/worker.cc5
-rw-r--r--src/libstore/daemon.cc8
-rw-r--r--src/libstore/filetransfer.cc18
-rw-r--r--src/libstore/filetransfer.hh2
-rw-r--r--src/libstore/globals.hh4
-rw-r--r--src/libstore/local-store.cc2
-rw-r--r--src/libstore/nar-accessor.cc4
-rw-r--r--src/libstore/references.cc50
-rw-r--r--src/libstore/references.hh4
-rw-r--r--src/libstore/remote-fs-accessor.cc2
-rw-r--r--src/libstore/remote-store.cc4
-rw-r--r--src/libstore/s3-binary-cache-store.cc6
-rw-r--r--src/libstore/store-api.cc4
-rw-r--r--src/libutil/archive.cc22
-rw-r--r--src/libutil/archive.hh10
-rw-r--r--src/libutil/args.cc5
-rw-r--r--src/libutil/args.hh5
-rw-r--r--src/libutil/compression.cc113
-rw-r--r--src/libutil/hash.cc18
-rw-r--r--src/libutil/hash.hh2
-rw-r--r--src/libutil/serialise.cc78
-rw-r--r--src/libutil/serialise.hh94
-rw-r--r--src/libutil/tarfile.cc2
-rw-r--r--src/libutil/util.cc34
-rw-r--r--src/libutil/util.hh7
-rw-r--r--src/nix/add-file.md28
-rw-r--r--src/nix/add-path.md29
-rw-r--r--src/nix/add-to-store.cc74
-rw-r--r--src/nix/cat.cc8
-rw-r--r--src/nix/command.cc16
-rw-r--r--src/nix/command.hh13
-rw-r--r--src/nix/diff-closures.cc6
-rw-r--r--src/nix/dump-path.cc47
-rw-r--r--src/nix/eval.cc55
-rw-r--r--src/nix/hash.cc52
-rw-r--r--src/nix/ls.cc12
-rw-r--r--src/nix/main.cc85
-rw-r--r--src/nix/make-content-addressable.cc12
-rw-r--r--src/nix/nar.cc31
-rw-r--r--src/nix/optimise-store.cc6
-rw-r--r--src/nix/ping-store.cc6
-rw-r--r--src/nix/profile.cc2
-rw-r--r--src/nix/show-derivation.cc1
-rw-r--r--src/nix/sigs.cc8
-rw-r--r--src/nix/store.cc31
-rw-r--r--src/nix/verify.cc8
50 files changed, 671 insertions, 377 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l
index 225ab3287..7298419d9 100644
--- a/src/libexpr/lexer.l
+++ b/src/libexpr/lexer.l
@@ -12,7 +12,9 @@
%{
+#ifdef __clang__
#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
+#endif
#include <boost/lexical_cast.hpp>
diff --git a/src/libexpr/local.mk b/src/libexpr/local.mk
index a5422169d..519da33f7 100644
--- a/src/libexpr/local.mk
+++ b/src/libexpr/local.mk
@@ -35,8 +35,6 @@ $(d)/lexer-tab.cc $(d)/lexer-tab.hh: $(d)/lexer.l
clean-files += $(d)/parser-tab.cc $(d)/parser-tab.hh $(d)/lexer-tab.cc $(d)/lexer-tab.hh
-dist-files += $(d)/parser-tab.cc $(d)/parser-tab.hh $(d)/lexer-tab.cc $(d)/lexer-tab.hh
-
$(eval $(call install-file-in, $(d)/nix-expr.pc, $(prefix)/lib/pkgconfig, 0644))
$(foreach i, $(wildcard src/libexpr/flake/*.hh), \
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc
index f6224d6a0..a918b7208 100644
--- a/src/libstore/binary-cache-store.cc
+++ b/src/libstore/binary-cache-store.cc
@@ -86,8 +86,7 @@ void BinaryCacheStore::getFile(const std::string & path, Sink & sink)
promise.set_exception(std::current_exception());
}
}});
- auto data = promise.get_future().get();
- sink((unsigned char *) data->data(), data->size());
+ sink(*promise.get_future().get());
}
std::shared_ptr<std::string> BinaryCacheStore::getFile(const std::string & path)
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index 76c49f92c..1db85bd37 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -916,10 +916,8 @@ void DerivationGoal::buildDone()
LogSink(Activity & act) : act(act) { }
- void operator() (const unsigned char * data, size_t len) override {
- for (size_t i = 0; i < len; i++) {
- auto c = data[i];
-
+ void operator() (std::string_view data) override {
+ for (auto c : data) {
if (c == '\n') {
flushLine();
} else {
@@ -3127,7 +3125,7 @@ void DerivationGoal::registerOutputs()
StringSink sink;
dumpPath(actualPath, sink);
RewritingSink rsink2(oldHashPart, std::string(newInfo0.path.hashPart()), nextSink);
- rsink2((unsigned char *) sink.s->data(), sink.s->size());
+ rsink2(*sink.s);
rsink2.flush();
});
Path tmpPath = actualPath + ".tmp";
diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc
index 1f8999a4b..6c96a93bd 100644
--- a/src/libstore/build/worker.cc
+++ b/src/libstore/build/worker.cc
@@ -223,11 +223,6 @@ void Worker::run(const Goals & _topGoals)
uint64_t downloadSize, narSize;
store.queryMissing(topPaths, willBuild, willSubstitute, unknown, downloadSize, narSize);
- if (!willBuild.empty() && 0 == settings.maxBuildJobs && getMachines().empty())
- throw Error(
- "%d derivations need to be built, but neither local builds ('--max-jobs') "
- "nor remote builds ('--builders') are enabled", willBuild.size());
-
debug("entered goal loop");
while (1) {
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc
index 60cca4fda..2224d54d5 100644
--- a/src/libstore/daemon.cc
+++ b/src/libstore/daemon.cc
@@ -153,10 +153,10 @@ struct TunnelSink : Sink
{
Sink & to;
TunnelSink(Sink & to) : to(to) { }
- virtual void operator () (const unsigned char * data, size_t len)
+ void operator () (std::string_view data)
{
to << STDERR_WRITE;
- writeString(data, len, to);
+ writeString(data, to);
}
};
@@ -165,7 +165,7 @@ struct TunnelSource : BufferedSource
Source & from;
BufferedSink & to;
TunnelSource(Source & from, BufferedSink & to) : from(from), to(to) { }
- size_t readUnbuffered(unsigned char * data, size_t len) override
+ size_t readUnbuffered(char * data, size_t len) override
{
to << STDERR_READ << len;
to.flush();
@@ -215,6 +215,8 @@ struct ClientSettings
for (auto & s : ss)
if (trusted.count(s))
subs.push_back(s);
+ else if (!hasSuffix(s, "/") && trusted.count(s + "/"))
+ subs.push_back(s + "/");
else
warn("ignoring untrusted substituter '%s'", s);
res = subs;
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc
index c2c65af05..31b4215a9 100644
--- a/src/libstore/filetransfer.cc
+++ b/src/libstore/filetransfer.cc
@@ -95,18 +95,18 @@ struct curlFileTransfer : public FileTransfer
fmt(request.data ? "uploading '%s'" : "downloading '%s'", request.uri),
{request.uri}, request.parentAct)
, callback(std::move(callback))
- , finalSink([this](const unsigned char * data, size_t len) {
+ , finalSink([this](std::string_view data) {
if (this->request.dataCallback) {
auto httpStatus = getHTTPStatus();
/* Only write data to the sink if this is a
successful response. */
if (successfulStatuses.count(httpStatus)) {
- writtenToSink += len;
- this->request.dataCallback((char *) data, len);
+ writtenToSink += data.size();
+ this->request.dataCallback(data);
}
} else
- this->result.data->append((char *) data, len);
+ this->result.data->append(data);
})
{
if (!request.expectedETag.empty())
@@ -171,8 +171,8 @@ struct curlFileTransfer : public FileTransfer
}
if (errorSink)
- (*errorSink)((unsigned char *) contents, realSize);
- (*decompressionSink)((unsigned char *) contents, realSize);
+ (*errorSink)({(char *) contents, realSize});
+ (*decompressionSink)({(char *) contents, realSize});
return realSize;
} catch (...) {
@@ -776,7 +776,7 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink)
state->request.notify_one();
});
- request.dataCallback = [_state](char * buf, size_t len) {
+ request.dataCallback = [_state](std::string_view data) {
auto state(_state->lock());
@@ -794,7 +794,7 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink)
/* Append data to the buffer and wake up the calling
thread. */
- state->data.append(buf, len);
+ state->data.append(data);
state->avail.notify_one();
};
@@ -840,7 +840,7 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink)
if it's blocked on a full buffer. We don't hold the state
lock while doing this to prevent blocking the download
thread if sink() takes a long time. */
- sink((unsigned char *) chunk.data(), chunk.size());
+ sink(chunk);
}
}
diff --git a/src/libstore/filetransfer.hh b/src/libstore/filetransfer.hh
index c89c51a21..afc7e7aa6 100644
--- a/src/libstore/filetransfer.hh
+++ b/src/libstore/filetransfer.hh
@@ -61,7 +61,7 @@ struct FileTransferRequest
bool decompress = true;
std::shared_ptr<std::string> data;
std::string mimeType;
- std::function<void(char *, size_t)> dataCallback;
+ std::function<void(std::string_view data)> dataCallback;
FileTransferRequest(const std::string & uri)
: uri(uri), parentAct(getCurActivity()) { }
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index eabd83e3f..6b4775683 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -583,7 +583,7 @@ public:
Setting<Strings> substituters{
this,
- nixStore == "/nix/store" ? Strings{"https://cache.nixos.org/"} : Strings(),
+ Strings{"https://cache.nixos.org/"},
"substituters",
R"(
A list of URLs of substituters, separated by whitespace. The default
@@ -867,7 +867,7 @@ public:
Example `~/.config/nix/nix.conf`:
```
- access-tokens = "github.com=23ac...b289 gitlab.mycompany.com=PAT:A123Bp_Cd..EfG gitlab.com=OAuth2:1jklw3jk"
+ access-tokens = github.com=23ac...b289 gitlab.mycompany.com=PAT:A123Bp_Cd..EfG gitlab.com=OAuth2:1jklw3jk
```
Example `~/code/flake.nix`:
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 93d073768..348e5d0d4 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -1143,7 +1143,7 @@ StorePath LocalStore::addToStoreFromDump(Source & source0, const string & name,
dump.resize(oldSize + want);
auto got = 0;
try {
- got = source.read((uint8_t *) dump.data() + oldSize, want);
+ got = source.read(dump.data() + oldSize, want);
} catch (EndOfFile &) {
inMemory = true;
break;
diff --git a/src/libstore/nar-accessor.cc b/src/libstore/nar-accessor.cc
index a9efdd0b6..1427a0f98 100644
--- a/src/libstore/nar-accessor.cc
+++ b/src/libstore/nar-accessor.cc
@@ -87,7 +87,7 @@ struct NarAccessor : public FSAccessor
parents.top()->start = pos;
}
- void receiveContents(unsigned char * data, size_t len) override
+ void receiveContents(std::string_view data) override
{ }
void createSymlink(const Path & path, const string & target) override
@@ -96,7 +96,7 @@ struct NarAccessor : public FSAccessor
NarMember{FSAccessor::Type::tSymlink, false, 0, 0, target});
}
- size_t read(unsigned char * data, size_t len) override
+ size_t read(char * data, size_t len) override
{
auto n = source.read(data, len);
pos += n;
diff --git a/src/libstore/references.cc b/src/libstore/references.cc
index d2096cb49..eb117b5ba 100644
--- a/src/libstore/references.cc
+++ b/src/libstore/references.cc
@@ -55,27 +55,23 @@ struct RefScanSink : Sink
RefScanSink() { }
- void operator () (const unsigned char * data, size_t len);
+ void operator () (std::string_view data) override
+ {
+ /* It's possible that a reference spans the previous and current
+ fragment, so search in the concatenation of the tail of the
+ previous fragment and the start of the current fragment. */
+ string s = tail + std::string(data, 0, refLength);
+ search((const unsigned char *) s.data(), s.size(), hashes, seen);
+
+ search((const unsigned char *) data.data(), data.size(), hashes, seen);
+
+ size_t tailLen = data.size() <= refLength ? data.size() : refLength;
+ tail = std::string(tail, tail.size() < refLength - tailLen ? 0 : tail.size() - (refLength - tailLen));
+ tail.append({data.data() + data.size() - tailLen, tailLen});
+ }
};
-void RefScanSink::operator () (const unsigned char * data, size_t len)
-{
- /* It's possible that a reference spans the previous and current
- fragment, so search in the concatenation of the tail of the
- previous fragment and the start of the current fragment. */
- string s = tail + string((const char *) data, len > refLength ? refLength : len);
- search((const unsigned char *) s.data(), s.size(), hashes, seen);
-
- search(data, len, hashes, seen);
-
- size_t tailLen = len <= refLength ? len : refLength;
- tail =
- string(tail, tail.size() < refLength - tailLen ? 0 : tail.size() - (refLength - tailLen)) +
- string((const char *) data + len - tailLen, tailLen);
-}
-
-
std::pair<PathSet, HashResult> scanForReferences(const string & path,
const PathSet & refs)
{
@@ -129,10 +125,10 @@ RewritingSink::RewritingSink(const std::string & from, const std::string & to, S
assert(from.size() == to.size());
}
-void RewritingSink::operator () (const unsigned char * data, size_t len)
+void RewritingSink::operator () (std::string_view data)
{
std::string s(prev);
- s.append((const char *) data, len);
+ s.append(data);
size_t j = 0;
while ((j = s.find(from, j)) != string::npos) {
@@ -146,14 +142,14 @@ void RewritingSink::operator () (const unsigned char * data, size_t len)
pos += consumed;
- if (consumed) nextSink((unsigned char *) s.data(), consumed);
+ if (consumed) nextSink(s.substr(0, consumed));
}
void RewritingSink::flush()
{
if (prev.empty()) return;
pos += prev.size();
- nextSink((unsigned char *) prev.data(), prev.size());
+ nextSink(prev);
prev.clear();
}
@@ -163,9 +159,9 @@ HashModuloSink::HashModuloSink(HashType ht, const std::string & modulus)
{
}
-void HashModuloSink::operator () (const unsigned char * data, size_t len)
+void HashModuloSink::operator () (std::string_view data)
{
- rewritingSink(data, len);
+ rewritingSink(data);
}
HashResult HashModuloSink::finish()
@@ -176,10 +172,8 @@ HashResult HashModuloSink::finish()
NAR with self-references and a NAR with some of the
self-references already zeroed out do not produce a hash
collision. FIXME: proof. */
- for (auto & pos : rewritingSink.matches) {
- auto s = fmt("|%d", pos);
- hashSink((unsigned char *) s.data(), s.size());
- }
+ for (auto & pos : rewritingSink.matches)
+ hashSink(fmt("|%d", pos));
auto h = hashSink.finish();
return {h.first, rewritingSink.pos};
diff --git a/src/libstore/references.hh b/src/libstore/references.hh
index c2efd095c..4f12e6b21 100644
--- a/src/libstore/references.hh
+++ b/src/libstore/references.hh
@@ -19,7 +19,7 @@ struct RewritingSink : Sink
RewritingSink(const std::string & from, const std::string & to, Sink & nextSink);
- void operator () (const unsigned char * data, size_t len) override;
+ void operator () (std::string_view data) override;
void flush();
};
@@ -31,7 +31,7 @@ struct HashModuloSink : AbstractHashSink
HashModuloSink(HashType ht, const std::string & modulus);
- void operator () (const unsigned char * data, size_t len) override;
+ void operator () (std::string_view data) override;
HashResult finish() override;
};
diff --git a/src/libstore/remote-fs-accessor.cc b/src/libstore/remote-fs-accessor.cc
index 2d02a181b..63bde92de 100644
--- a/src/libstore/remote-fs-accessor.cc
+++ b/src/libstore/remote-fs-accessor.cc
@@ -75,7 +75,7 @@ std::pair<ref<FSAccessor>, Path> RemoteFSAccessor::fetch(const Path & path_)
throw SysError("seeking in '%s'", cacheFile);
std::string buf(length, 0);
- readFull(fd.get(), (unsigned char *) buf.data(), length);
+ readFull(fd.get(), buf.data(), length);
return buf;
});
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 48af9f0c4..be29f8e6f 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -856,8 +856,8 @@ std::exception_ptr RemoteStore::Connection::processStderr(Sink * sink, Source *
else if (msg == STDERR_READ) {
if (!source) throw Error("no source");
size_t len = readNum<size_t>(from);
- auto buf = std::make_unique<unsigned char[]>(len);
- writeString(buf.get(), source->read(buf.get(), len), to);
+ auto buf = std::make_unique<char[]>(len);
+ writeString({(const char *) buf.get(), source->read(buf.get(), len)}, to);
to.flush();
}
diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc
index 552c4aac7..27253fc12 100644
--- a/src/libstore/s3-binary-cache-store.cc
+++ b/src/libstore/s3-binary-cache-store.cc
@@ -57,6 +57,10 @@ class AwsLogger : public Aws::Utils::Logging::FormattedLogSystem
{
debug("AWS: %s", chomp(statement));
}
+
+#if !(AWS_VERSION_MAJOR <= 1 && AWS_VERSION_MINOR <= 7 && AWS_VERSION_PATCH <= 115)
+ void Flush() override {}
+#endif
};
static void initAWS()
@@ -398,7 +402,7 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore, virtual S3BinaryCache
printTalkative("downloaded 's3://%s/%s' (%d bytes) in %d ms",
bucketName, path, res.data->size(), res.durationMs);
- sink((unsigned char *) res.data->data(), res.data->size());
+ sink(*res.data);
} else
throw NoSuchBinaryCacheFile("file '%s' does not exist in binary cache '%s'", path, getUri());
}
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 3b2be05cb..27be66cac 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -772,8 +772,8 @@ void copyStorePath(ref<Store> srcStore, ref<Store> dstStore,
}
auto source = sinkToSource([&](Sink & sink) {
- LambdaSink progressSink([&](const unsigned char * data, size_t len) {
- total += len;
+ LambdaSink progressSink([&](std::string_view data) {
+ total += data.size();
act.progress(total, info->narSize);
});
TeeSink tee { sink, progressSink };
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc
index 03534abc4..ed0eb2fb5 100644
--- a/src/libutil/archive.cc
+++ b/src/libutil/archive.cc
@@ -50,14 +50,14 @@ static void dumpContents(const Path & path, size_t size,
AutoCloseFD fd = open(path.c_str(), O_RDONLY | O_CLOEXEC);
if (!fd) throw SysError("opening file '%1%'", path);
- std::vector<unsigned char> buf(65536);
+ std::vector<char> buf(65536);
size_t left = size;
while (left > 0) {
auto n = std::min(left, buf.size());
readFull(fd.get(), buf.data(), n);
left -= n;
- sink(buf.data(), n);
+ sink({buf.data(), n});
}
writePadding(size, sink);
@@ -155,14 +155,14 @@ static void parseContents(ParseSink & sink, Source & source, const Path & path)
sink.preallocateContents(size);
uint64_t left = size;
- std::vector<unsigned char> buf(65536);
+ std::vector<char> buf(65536);
while (left) {
checkInterrupt();
auto n = buf.size();
if ((uint64_t)n > left) n = left;
source(buf.data(), n);
- sink.receiveContents(buf.data(), n);
+ sink.receiveContents({buf.data(), n});
left -= n;
}
@@ -300,21 +300,21 @@ struct RestoreSink : ParseSink
Path dstPath;
AutoCloseFD fd;
- void createDirectory(const Path & path)
+ void createDirectory(const Path & path) override
{
Path p = dstPath + path;
if (mkdir(p.c_str(), 0777) == -1)
throw SysError("creating directory '%1%'", p);
};
- void createRegularFile(const Path & path)
+ void createRegularFile(const Path & path) override
{
Path p = dstPath + path;
fd = open(p.c_str(), O_CREAT | O_EXCL | O_WRONLY | O_CLOEXEC, 0666);
if (!fd) throw SysError("creating file '%1%'", p);
}
- void isExecutable()
+ void isExecutable() override
{
struct stat st;
if (fstat(fd.get(), &st) == -1)
@@ -323,7 +323,7 @@ struct RestoreSink : ParseSink
throw SysError("fchmod");
}
- void preallocateContents(uint64_t len)
+ void preallocateContents(uint64_t len) override
{
if (!archiveSettings.preallocateContents)
return;
@@ -341,12 +341,12 @@ struct RestoreSink : ParseSink
#endif
}
- void receiveContents(unsigned char * data, size_t len)
+ void receiveContents(std::string_view data) override
{
- writeFull(fd.get(), data, len);
+ writeFull(fd.get(), data);
}
- void createSymlink(const Path & path, const string & target)
+ void createSymlink(const Path & path, const string & target) override
{
Path p = dstPath + path;
nix::createSymlink(target, p);
diff --git a/src/libutil/archive.hh b/src/libutil/archive.hh
index 5665732d2..9e9e11b1a 100644
--- a/src/libutil/archive.hh
+++ b/src/libutil/archive.hh
@@ -58,7 +58,7 @@ struct ParseSink
virtual void createRegularFile(const Path & path) { };
virtual void isExecutable() { };
virtual void preallocateContents(uint64_t size) { };
- virtual void receiveContents(unsigned char * data, size_t len) { };
+ virtual void receiveContents(std::string_view data) { };
virtual void createSymlink(const Path & path, const string & target) { };
};
@@ -72,17 +72,17 @@ struct RetrieveRegularNARSink : ParseSink
RetrieveRegularNARSink(Sink & sink) : sink(sink) { }
- void createDirectory(const Path & path)
+ void createDirectory(const Path & path) override
{
regular = false;
}
- void receiveContents(unsigned char * data, size_t len)
+ void receiveContents(std::string_view data) override
{
- sink(data, len);
+ sink(data);
}
- void createSymlink(const Path & path, const string & target)
+ void createSymlink(const Path & path, const string & target) override
{
regular = false;
}
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index 8bd9c8aeb..61f9503ec 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -86,6 +86,7 @@ void Args::parseCmdline(const Strings & _cmdline)
throw UsageError("unrecognised flag '%1%'", arg);
}
else {
+ pos = rewriteArgs(cmdline, pos);
pendingArgs.push_back(*pos++);
if (processArgs(pendingArgs, false))
pendingArgs.clear();
@@ -390,10 +391,6 @@ MultiCommand::MultiCommand(const Commands & commands)
.optional = true,
.handler = {[=](std::string s) {
assert(!command);
- if (auto alias = get(deprecatedAliases, s)) {
- warn("'%s' is a deprecated alias for '%s'", s, *alias);
- s = *alias;
- }
if (auto prefix = needsCompletion(s)) {
for (auto & [name, command] : commands)
if (hasPrefix(name, *prefix))
diff --git a/src/libutil/args.hh b/src/libutil/args.hh
index 26f1bc11b..8069fd70f 100644
--- a/src/libutil/args.hh
+++ b/src/libutil/args.hh
@@ -115,6 +115,9 @@ protected:
virtual bool processArgs(const Strings & args, bool finish);
+ virtual Strings::iterator rewriteArgs(Strings & args, Strings::iterator pos)
+ { return pos; }
+
std::set<std::string> hiddenCategories;
public:
@@ -257,8 +260,6 @@ public:
std::map<Command::Category, std::string> categories;
- std::map<std::string, std::string> deprecatedAliases;
-
// Selected command, if any.
std::optional<std::pair<std::string, ref<Command>>> command;
diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc
index a117ddc72..986ba2976 100644
--- a/src/libutil/compression.cc
+++ b/src/libutil/compression.cc
@@ -22,18 +22,17 @@ struct ChunkedCompressionSink : CompressionSink
{
uint8_t outbuf[32 * 1024];
- void write(const unsigned char * data, size_t len) override
+ void write(std::string_view data) override
{
const size_t CHUNK_SIZE = sizeof(outbuf) << 2;