Age | Commit message (Collapse) | Author |
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
The function has to return the number of bytes in the buffer, so return
the length of the buffer here.
Still, the contents are ignored and not written to any destination.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This reverts commit f7fadc118f2de7e84cef8c6d4103296289564f74.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
In this patch, the error output (tracing) algorithm was changed, but
should essentially print the same information.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch was scripted with
sed -i 's/use failure::Error/use anyhow::Error/' $(rg "use failure::Error" -l)
sed -i 's/use failure::Fallible as /use anyhow::/' $(rg "use failure::Fallible" -l)
sed -i 's/failure/anyhow/' $(rg "failure *=" -l)
sed -i 's/format_err!/anyhow!/' $(rg "format_err!" -l)
sed -i 's/use failure::ResultExt/use anyhow::Context/' $(rg "use failure::ResultExt" -l)
sed -i 's/err_msg/anyhow!/' $(rg "use failure::err_msg" -l)
sed -i 's/^anyhow\ *=.*$/anyhow = "1"/' $(rg "anyhow * =" -l)
sed -i 's/^anyhow_derive.*//' $(rg "anyhow_derive" -l)
sed -i 's/extern crate failure/extern crate anyhow/' $(rg "extern crate failure" -l)
sed -i 's/.*extern crate anyhow_derive.*//' $(rg "anyhow_derive" -l)
Some manual changes were added as well, so this patch was not completely
scripted, but mostly.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch removes the --ignore-ids option and adds --pipe-input / -I and
--pipe-output / -O instead.
The behaviour of -IO is the same as --ignore-ids was before, but this
change gives the user the option to enable only one of both (input or
output, or both).
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch removes the module-based logging mechanism.
This mechanism was introduced so that the configuration file is able to
define which imag module logs what. This was a fine-granular setting,
but most users won't actually touch it. It was more of a
debugging-thing for developers. I rarely used it during development and
it only introduced more headaches. It also was not updated (as in the
configuration file missed a few modules, others where not removed
despite the module did not exist anymore).
All in all, it was rather unmaintained and just "too much".
Thus, remove this thing completely. Developers know how to use grep.
This also automatically fixes bugs where `imag --debug command` did not
output any debugging log, but was expected to.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Add a function to Store to check whether a StoreId is borrowed.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch removes the leakage in the runtime application abstraction.
Also fix formatting.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This fixes a bug where a broken pipe in Runtime::report_touched()
resulted in an Err(_) raised up to main() which then reported this.
But as report_touched() should ignore a broken pipe (because the program
will exit anyways shortly after the call), we can safely ignore this
error.
This also results in `ExitCode` removed from the function signature,
which pushes us forward to the removal of custom error-handling
implementations!
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
We need this because we might want to check whether we can get the STDIN
handle from the runtime or not.
In some (rare) cases, the runtime "thinks" that STDIN is a stream of
IDs, but it is not. So the client can check whether stdin is a pipe
(thus, whether Runtime thinks that there's a stream of IDs) and easily
work around that by taking ::std::io::stdin() itself.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This reverts commit d810b63886f4006d01bca894982bbc867616f37c.
As resiter v0.4.0 does provide this extension now, we don't need it in
the codebase anymore.
|
|
This extension traits help transforming Result<Option<T>, E> to
Result<T, E> or transforming an iterator over the former type to an
iterator over the latter type.
Should be moved to resiter of course, but we need to implement this
first.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
To re-add the imag-binary CLI completion, as well as to enable
building a single imag containing all of the subcommands, this commit
introduces an ImagApplication trait to be implemented by all imag
binary crates. The binary crates will be converted to libraries, with
an additional binary target. This enables standalone and single binary
builds.
On its own, this commit doesn't do much, but rather it paves the way
to dynamically interacting with the imag uis/clis using a
library-crate interface.
Signed-off-by: Leon Schuermann <leon@is.currently.online>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
After moving an entry, the entry should _not_ be in the cache. This is
just a decision that has to be made, whether we cache the moved entry or
not. I decided to not cache because it is results in less code.
After that check, we get the entry from the backend and then we can
check whether the entry is in the cache, which is then should be.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
When moving an entry, what we did is copying the entry inside the
backend abstraction (the hashmap) from one key to another.
But as the entry itself does also encode its location, we actually have
to rewrite the entire entry. This patch fixes this.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This is a bugfix for a bug in Store::move_entry_by_id():
The old entry was not removed after the new one was created.
The bug is a bit subtle. The issue was, that the internal cache held
open a reference to the old entry (as StoreEntry object) and when that
object got drop()ed, the contents of the entry were written to disk,
which resulted in the old entry being recreated.
This patch rewrites the function to behave well. The most critical part
is that we do not check whether the old entry is borrowed with
`hsmap.get()` but rather `hsmap.remove()`. The trick here is that the
`StoreEntry` object is dropped in the moment the check is done, clearing
the cached object and flushing it to the backend (the disk).
After that, we continue doing the filesystem operation and the cache is
clean.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
|
|
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
|
|
This patch adds functions to the Entries type which can be used for
filtering by id, either with `contains()` or `starts_with()`.
This is useful for the end-user functionality where the user specifies
the ID of an entry only partially.
The implementation still iterates over all entries. This could be
improved, of course, by implementing a `find`-like function on `Store`
directly. But for now, this is good enough.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|