Commit graph

5775 commits

Author SHA1 Message Date
d2bf1751ac Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
9507db6d8e Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
ab32f21333 Fix: Binary name
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-08-26 04:24:57 +02:00
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
ea77faeae2 imagrc: Abbreviating is supported, remove old comment and update contact.list_format 2018-08-26 04:24:57 +02:00
b5c73d9c19 doc: Specify how imag-mail should look like 2018-08-26 04:24:57 +02:00
f4e0c1c5eb doc: Add more planned commands for imag-mail 2018-08-26 04:24:57 +02:00
104cbfbfa7 doc: Format for line length 2018-08-26 04:24:57 +02:00
6e56f469ae More verbose erroring in test 2018-08-26 04:24:57 +02:00
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
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
f2916aa51a
Merge pull request #1501 from matthiasbeyer/update-travis-rust
Update rust version
2018-08-02 20:52:52 +02:00
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
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
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
22d63f0946 Add functionality to create entry at a certain time 2018-07-20 01:37:36 +02:00
2a62b6dffb
Merge pull request #1496 from matthiasbeyer/libimagstore/fix-use-backend
libimagstore: fix use backend
2018-07-20 01:35:20 +02:00
aff6ff105d Remove "Header" extension for Value type 2018-07-19 20:58:27 +02:00
f6a7345b4a Simplify: Move header verification from Value extension to Entry type 2018-07-19 20:58:27 +02:00
9ad1c8d6bd Simplify: Move default header generation from Value extension to Entry type 2018-07-19 20:58:27 +02:00
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
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
9315a23754 Fix: Use backend abstraction for checking whether a path exists 2018-07-19 20:58:27 +02:00
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
e502040415
Merge pull request #1499 from matthiasbeyer/minor
Minor
2018-07-02 22:01:58 +02:00
a138dd408d
Merge pull request #1498 from matthiasbeyer/update-rustc
Update rustc in travis
2018-07-02 22:01:50 +02:00
8d86af5f15 Fix: Use unused result 2018-06-27 00:43:36 +02:00
e0156bf4ad Fix: Use unused result 2018-06-27 00:43:24 +02:00
2699e17468 Update rustc in travis 2018-06-23 21:59:36 +02:00
54c5854761 Remove unnecessary call 2018-06-23 21:56:03 +02:00
3bdd5c959b Add documentation to StoreId type 2018-06-23 21:56:03 +02:00
c86e4e7db4 Add documentation for Runtime::init_logger() 2018-06-23 21:56:02 +02:00
6ba87a58d1 Add 'Known Problems' section 2018-06-23 21:55:35 +02:00
473f962874 Update lib description 2018-06-23 21:55:35 +02:00
cb8c511985 Update lib description 2018-06-23 21:55:35 +02:00
d6a19d8645 Update lib description 2018-06-23 21:55:27 +02:00
5847987404 Remove old statement 2018-06-23 21:54:27 +02:00
869f5377f9 Update intro 2018-06-23 21:54:27 +02:00
6e45727f15 Update conventions 2018-06-23 21:54:27 +02:00
f9294eb07a doc: Update README 2018-06-23 21:54:27 +02:00
33789a0da8 Change contributing documentation
For after we leave github, the documentation on how to  contribute has
to be adjusted.
This patch does this.
2018-06-23 21:54:27 +02:00
eb682d76e8 Prettify error messages 2018-06-15 22:07:13 +02:00
c8da09f687
Merge pull request #1491 from matthiasbeyer/fix-rustc126-flatten-warning
Fix: Explicitely use Itertools::flatten()
2018-05-11 21:04:13 +02:00
c911be87ee
Merge pull request #1492 from matthiasbeyer/update-travis
Update travis
2018-05-11 21:04:08 +02:00
f912d3e7f3
Merge pull request #1489 from matthiasbeyer/imag-log/fix-duplicated-printing
Fix: Duplicated printing of entries with "show --all"
2018-05-11 21:04:02 +02:00
3b97db5c25 Fix: Duplicated printing of entries with "show --all"
The problem was that the used `Diary::diary_names()` iterator does not
call `unique()` on its output.
That decision was made because the return type would get more
complicated with that feature.

Now that rustc 1.26 with Impl Trait is out, we can refactor the return
types of these functions (so also with `Diary::diary_names()`) to
automatically do this.
2018-05-11 15:45:50 +02:00
e0678c9b18 Update travis
Use rustc 1.24, 1.25 and stable (1.26).
2018-05-11 15:45:47 +02:00
8d1022b1ac Fix: Explicitely use Itertools::flatten()
As of rustc 1.26, the `flatten()` method on iterators is preserved by
the rust standard library.
This could cause this code to hard-error some time in the future with
the `flatten()` function actually implemented by the standard library.

Hence we move to use the `Itertools::flatten()` function here
explicitely.
2018-05-11 15:45:42 +02:00
7c44bc1aa3
Merge pull request #1493 from matthiasbeyer/fix-rustc-126
Fix comment for rustc 1.26
2018-05-11 15:45:36 +02:00