Commit Graph

187 Commits

Author SHA1 Message Date
tastytea 4eb210710b
CI: Don't install catch for package generation. 2021-05-30 14:00:56 +02:00
tastytea 82193d529c
Fix tests.
continuous-integration/drone/push Build is passing Details
2021-05-30 13:48:11 +02:00
tastytea d7ad180721
Use iterators in search::context() and don't return extra whitespace
Should be easier to understand now.
2021-05-30 13:45:56 +02:00
tastytea ded11af5fb
Add tests for EPUB files. 2021-05-29 23:58:59 +02:00
tastytea c1613a8f52
Add test for zip::urldecode(). 2021-05-29 23:01:13 +02:00
tastytea 59ceaa7cdc
Add another test for search::headline(). 2021-05-29 23:00:40 +02:00
tastytea 790e60a055
Fix end-of-headline detection. 2021-05-29 23:00:16 +02:00
tastytea 0accd77a2c
Version bump 0.4.0. 2021-05-29 22:13:58 +02:00
tastytea 160ff20387
Revert "Fix pugixml target."
continuous-integration/drone/push Build is passing Details
pugixml 1.8.1 (the version in Ubuntu bionic) does not have that target.

This reverts commit 2a3e3f87b5.
2021-05-29 22:10:21 +02:00
tastytea 6f934470c7
Add type to drone config.
continuous-integration/drone/push Build is failing Details
2021-05-29 21:54:47 +02:00
tastytea c1d2e8fa21
Clean up .editorconfig. 2021-05-29 21:44:36 +02:00
tastytea 2a3e3f87b5
Fix pugixml target. 2021-05-29 21:37:40 +02:00
tastytea 92d1b66c76
CI: Workaround for pugixml on bionic. 2021-05-29 21:32:36 +02:00
tastytea e7756c8f87
Drop minimum pugixml version.
continuous-integration/drone/push Build is failing Details
The package in Ubuntu bionic doesn't provide a version.
2021-05-29 19:23:41 +02:00
tastytea df55ed9dba
CI: Add pugixml_DIR
continuous-integration/drone/push Build is failing Details
For some reason the package installs the CMake config file into
/usr/share/libpugixml-dev.
2021-05-29 19:06:25 +02:00
tastytea 37e868b3f2
Remove <style> and <script> snippets.
Closes: #8
2021-05-29 18:52:03 +02:00
tastytea 737d0a10b6
Update german translation.
continuous-integration/drone/push Build is failing Details
2021-05-29 18:43:14 +02:00
tastytea 2d65961688
Output XML errors. 2021-05-29 18:42:29 +02:00
tastytea ba5716c585
Skip in-epub file if it is not found, except it's the container.
We skipped the whole EPUB before.
2021-05-29 18:20:23 +02:00
tastytea 5bd1030ad8
Try opf: variants of XML tags if normal variants are not found. 2021-05-29 18:09:44 +02:00
tastytea 03b367ee98
Don't print same file path twice in error message.
zip::exception always has  the filename in the message.
2021-05-29 17:37:41 +02:00
tastytea 00e3edb9f2
Only search files in spine, in the right order.
The spine lists all content documents in their linear reading order. So we're
finally getting our results in the right order! 🎉

Since we skip the images and fonts, which usually make up the most bytes in an
EPUB file, the performance increase is immense. I measured 60-70% in a very
short test.

Closes: #1
2021-05-29 17:34:43 +02:00
tastytea c94d9de0db
Reformat error messages.
One line per error message.
2021-05-29 12:53:14 +02:00
tastytea 26678812c9
Typo in man page. 2021-05-28 22:59:54 +02:00
tastytea 4ff796a590
Make regular expressions static variables.
continuous-integration/drone/push Build is passing Details
Fewer allocations → faster program. About 17% speed increase with 89 books on up
to 3 cores. Measured using the average of 4 runs.
Before: ~15,5 seconds
 After: ~12,8 seconds

Calls to allocation functions went down from 16.652.583 to 5.059.301.
2021-05-28 19:11:32 +02:00
tastytea 4df7b36dfc
Print matches while still searching.
continuous-integration/drone/push Build is passing Details
Previously we printed the matches at the end.
2021-05-28 17:18:34 +02:00
tastytea 59759b5934
Put output stuff into own function in different file.
It got a little crowded in main(). 😊
2021-05-28 17:07:11 +02:00
tastytea 65de7f7efb
Version bump 0.3.2.
continuous-integration/drone/push Build is passing Details
2021-05-28 15:17:36 +02:00
tastytea 719018a0f6
CI: Verify CMake download with checksum, don't verify TLS cert.
continuous-integration/drone/push Build is passing Details
2021-05-28 15:16:44 +02:00
tastytea 762d4b94cb
Update german translation.
continuous-integration/drone/push Build is failing Details
2021-05-28 14:00:17 +02:00
tastytea 308e2d271f
Skip rest of file if encoding of files in EPUB is broken.
Standard says UTF-8. I don't want to deal with weird Windows-encodings or
whatever this is.

Closes: #7
2021-05-28 13:57:51 +02:00
tastytea 65b46ca846
Do not allow more threads than max_threads. 2021-05-28 11:48:38 +02:00
tastytea b3f392e110
Update screenshot.
continuous-integration/drone/push Build is passing Details
2021-05-28 10:37:49 +02:00
tastytea d9025d3c60
Update Debian & Ubuntu installation.
continuous-integration/drone/push Build is passing Details
2021-05-28 09:50:18 +02:00
tastytea af30fae319
CI: Upload focal image.
continuous-integration/drone/push Build is passing Details
2021-05-27 23:07:08 +02:00
tastytea e4b2e8ad98
CI: Fix GCC version in bionic. 2021-05-27 22:53:26 +02:00
tastytea 74d1713078
Fix CI recipe for focal packages. 2021-05-27 22:38:51 +02:00
tastytea f65d927680
CI: Download CMake in Packaging-pipeline. 2021-05-27 22:28:16 +02:00
tastytea 3f58b27709
Fix config file example in man page. 2021-05-27 22:21:25 +02:00
tastytea dc4b233c3e
Fix typos in manpage.
continuous-integration/drone/push Build is passing Details
2021-05-27 21:55:51 +02:00
tastytea 40874c2d36
Update german translation. 2021-05-27 21:51:02 +02:00
tastytea 8fde3b7bd4
Version bump 0.3.1. 2021-05-27 21:50:51 +02:00
tastytea c3131e01f0
Add setting to suppress this-is-not-an-EPUB errors. 2021-05-27 21:48:35 +02:00
tastytea 84f600196c
Add error code to zip::exception. 2021-05-27 21:39:01 +02:00
tastytea b96315f8bb
Don't add extra newlines before errors. 2021-05-27 21:03:42 +02:00
tastytea 2b91a839cc
Add --raw and --context again.
Forgot to re-implement them when I overhauled the option parsing…
2021-05-27 21:01:07 +02:00
tastytea 8d5565a72c
Don't write to matches_all simultaneously from different threads.
What did I do yesterday?!? 😬

Closes: #6
2021-05-27 20:42:20 +02:00
tastytea 38bf9be948
Fix some more memory leaks. 2021-05-27 20:11:59 +02:00
tastytea b24ea9b71e
Fix memory leak. 🤦
continuous-integration/drone/push Build is passing Details
That's why I don't write C. 😄

This seems to fix issue #6 in single-threaded mode but sometimes throws “double
free or corruption (out)” in multi-threaded mode.

Bug: #6
2021-05-27 20:05:02 +02:00
tastytea ef8fdced51
Update german translation. 2021-05-27 19:09:43 +02:00