Commit Graph

5493 Commits

Author SHA1 Message Date
Matthias Beyer 61738ac9ee Revert "Update dependency: handlebars: 0.29.0 -> 1.0"
This reverts commit a1f0872486995b80216e8a08a2176debdef3752a.

As updating handlebars needs some more involvement, we roll back to the
version we use currently and schedule the update for later.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-09-27 15:05:45 +02:00
Matthias Beyer c65e73acc8 Update dependency: kairos: 0.1 -> 0.2 2018-09-27 15:05:45 +02:00
Matthias Beyer abf6a3c384 Update dependency: handlebars: 0.29.0 -> 1.0 2018-09-27 15:05:45 +02:00
Matthias Beyer 764a019817 Update dependency: log: 0.3 -> 0.4 2018-09-27 15:05:45 +02:00
Matthias Beyer 3d12998603 Update dependency: toml-query: 0.6 -> 0.7 2018-09-27 15:05:44 +02:00
Matthias Beyer 0a7afee454 Update dependency: error-chain: 0.11 -> 0.12 2018-09-27 15:05:25 +02:00
Matthias Beyer 9bce68b1bf
Merge pull request #1494 from matthiasbeyer/libimagstore/optimize-backend-iterator
Optimize the Store::entries() interface
2018-09-27 13:03:57 +02:00
Matthias Beyer d4872f6da3 Optimize the Store::entries() interface
The previous iterator was implemented to simply fetch _all_ pathes from
the filesystem, no matter what.

With this implementation, this changes. The iterator now has
functionality to optimize the iteration, if only a subdirectory of the
store is required, for example `$STORE/foo`.

This is done via functionality where the underlying iterator gets
altered.

First of all, the interface was changed to return a `Entries` object,
which itself only covers the libimagstore-internal `PathIterator` type.
This type was changed so that the backend implementation provides an
"PathIterBuilder`, which builds the actual iterator object for the
`PathIterator` type.

The intermediate `StoreIdConstructingIterator` was merged into
`PathIterator` for simplicity.

The `Entries` type got functionality similar to the
`StoreIdIteratorWithStore` type for easier transition to the new API.
This should probably be removed at a later point, though.

As the `walkdir::WalkDir` type is not as nice as it could be, iterators
for two collections in the store could be built like this (untested):

    store
        .entries()?
        .in_collection("foo")
        .chain(store.entries()?.in_collection("bar"))

Functionality to exclude subdirectories is not possible with the current
`walkdir::WalkDir` implementation and has to be done during iteration,
with filtering (as usual).

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-09-27 12:19:18 +02:00
Matthias Beyer d59dca1a23 Add StoreIdIterator::with_store() 2018-09-27 12:19:18 +02:00
Matthias Beyer c791977aab
Merge pull request #1506 from matthiasbeyer/minor
Minor
2018-09-27 09:53:31 +02:00
Matthias Beyer ccbc2b2672
Merge pull request #1478 from matthiasbeyer/imag-diagnostics/progressbar
imag-diagnostics: Add a progressbar to the command
2018-09-27 08:48:22 +02:00
Matthias Beyer 6bf49aa6b5 Fix: 'imag-contact show' should increase output counter 2018-09-27 08:09:39 +02:00
Matthias Beyer 6a81c0afd1
Merge pull request #1507 from matthiasbeyer/update-rust
Update rust compiler versions
2018-09-27 07:53:48 +02:00
Matthias Beyer 6f768fe4ad Add a progressbar to the command
Note: characters in config have to be escaped.
2018-09-27 07:40:10 +02:00
Matthias Beyer 430186799b Remove store flush caching as it is not necessary anymore 2018-09-27 07:31:47 +02:00
Matthias Beyer 1fdb90bc97 Update rust compiler versions 2018-09-26 16:26:27 +02:00
Matthias Beyer 3a768b42de travis: Turn on email notifications
Because we do not use github for development anymore, but still for
travis, we enable notifications so we know whether our builds succeed

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
Matthias Beyer dc49b2265c Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
Matthias Beyer d2bf1751ac Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
Matthias Beyer 9507db6d8e Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
Matthias Beyer ab32f21333 Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
Matthias Beyer 2fa5b2f4bd Add script to check whether binaries are named correctly
It is a simple approach but it works: Read the name of the binary from
the Cargo.toml file and check whether the name appears in the path.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
Matthias Beyer ea77faeae2 imagrc: Abbreviating is supported, remove old comment and update contact.list_format 2018-08-26 04:24:57 +02:00
Matthias Beyer b5c73d9c19 doc: Specify how imag-mail should look like 2018-08-26 04:24:57 +02:00
Matthias Beyer f4e0c1c5eb doc: Add more planned commands for imag-mail 2018-08-26 04:24:57 +02:00
Matthias Beyer 104cbfbfa7 doc: Format for line length 2018-08-26 04:24:57 +02:00
Matthias Beyer 6e56f469ae More verbose erroring in test 2018-08-26 04:24:57 +02:00
Matthias Beyer 5b82d53fd2
Merge pull request #1502 from matthiasbeyer/libimagstore/fs-backend-no-fd-holding
Optimize backend impl to not hold open files
2018-08-26 04:16:04 +02:00
Matthias Beyer 8b508fe4c3 Optimize backend impl to not hold open files
This patch changes the filesystem-backend implementation of libimagstore
to open files on each read/write rather than holding the file handle in
memory at all times.

Whenever a lot of imag store entries are read into memory, the imag
process may ran out of file descriptors. With this patch applied, a
`Store::get()` call on an entry which is not yet in the store cache
would cause the file to be read, but the FD being dropped after that.
Likewise, a `Store::update()` (which is also called if the imag entry is
dropped) would re-open the file on the filesystem and write the contents
from the imag store cache back to the file.

With this patch, opening hundrets or thousands of imag entries should be
no problem anymore, only the available memory should be a limit then.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-11 17:50:22 +02:00
Matthias Beyer f2916aa51a
Merge pull request #1501 from matthiasbeyer/update-travis-rust
Update rust version
2018-08-02 20:52:52 +02:00
Matthias Beyer e960f7d465 Update rust version
As a dependency apparently requires rust 1.26 as minimum version, we
bump here.

Rust 1.28 is out already, so no problems with that!
2018-08-02 19:59:56 +02:00
Matthias Beyer acdc1e84bc
Merge pull request #1495 from matthiasbeyer/imag-diary/fix-missing-header
Imag diary/fix missing header
2018-07-27 20:10:59 +02:00
Matthias Beyer b896bc2657 Fix: Do not create entries with Store::retrieve()
This patch fixes a bug where entries where created with
`Store::retrieve()` rather than with the API from libimagdiary.
This caused headers to be missing.

Now, the CLI is parsed for the values passed and a NaiveDateTime object
is crafted from that, which is then passed to libimagdiary.
2018-07-20 01:37:36 +02:00
Matthias Beyer 22d63f0946 Add functionality to create entry at a certain time 2018-07-20 01:37:36 +02:00
Matthias Beyer 2a62b6dffb
Merge pull request #1496 from matthiasbeyer/libimagstore/fix-use-backend
libimagstore: fix use backend
2018-07-20 01:35:20 +02:00
Matthias Beyer aff6ff105d Remove "Header" extension for Value type 2018-07-19 20:58:27 +02:00
Matthias Beyer f6a7345b4a Simplify: Move header verification from Value extension to Entry type 2018-07-19 20:58:27 +02:00
Matthias Beyer 9ad1c8d6bd Simplify: Move default header generation from Value extension to Entry type 2018-07-19 20:58:27 +02:00
Matthias Beyer 1705ecbbff Fix: Remove (empty) Drop implementation for Store
The StoreEntry drop implementation takes care of unlocking the files.
2018-07-19 20:58:27 +02:00
Matthias Beyer b774ac0e67 Fix: Deleting an Entry could leave artifacts in cache
This patch fixes a bug we did not even hit (yet). It is: When deleting
an Entry from the store, this could potentially leave artifacts in the
cache.

Szenario: An Entry, which was loaded (via `Store::get()` for example),
gets `Store::delete()`ed twice. The first call would work as expected,
but leave the Entry in the Store cache. The second call would then fail,
as the Entry is already removed on the FS, but still in the cache. This
would fail - which is the right thing to do here - but with the wrong
error (with a FileError rather than a FileNotFound error).

This patch fixes this.

First of all, the appropriate `PathBuf` object is calculated in all
cases, as this object is needed to check whether the file is actually
there (which could be the case if the Entry is in the cache and if it is
not).

If the entry is in the cache and is borrowed: error. If not, remove the
entry from the cache. Afterwards the file is deleted on disk.

If the entry is not in the cache, but the file exists, the file is removed.
If the file does not exist: error.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-07-19 20:58:27 +02:00
Matthias Beyer 9315a23754 Fix: Use backend abstraction for checking whether a path exists 2018-07-19 20:58:27 +02:00
Matthias Beyer 851db4abe4
Merge pull request #1500 from newpavlov/master
Replaced rust-crypto with RustCrypto crates
2018-07-19 05:56:29 +02:00
newpavlov 04b3e7243d replaced rust-crypto with RustCrypto crates 2018-07-18 19:51:05 +03:00
Matthias Beyer e502040415
Merge pull request #1499 from matthiasbeyer/minor
Minor
2018-07-02 22:01:58 +02:00
Matthias Beyer a138dd408d
Merge pull request #1498 from matthiasbeyer/update-rustc
Update rustc in travis
2018-07-02 22:01:50 +02:00
Matthias Beyer 8d86af5f15 Fix: Use unused result 2018-06-27 00:43:36 +02:00
Matthias Beyer e0156bf4ad Fix: Use unused result 2018-06-27 00:43:24 +02:00
Matthias Beyer 2699e17468 Update rustc in travis 2018-06-23 21:59:36 +02:00
Matthias Beyer 54c5854761 Remove unnecessary call 2018-06-23 21:56:03 +02:00
Matthias Beyer 3bdd5c959b Add documentation to StoreId type 2018-06-23 21:56:03 +02:00