Age | Commit message (Collapse) | Author | Files | Lines |
|
Few tweaks to make the code compile on MacOS. As a prerequisite to get
it running, `brew install libgit2` is needed.
Signed-off-by: Alexei Starovoitov <ast@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Change the default locations of the config file and the work directory.
Prefered config file is taken from ~/${XDG_CONFIG_HOME}/config
('.config' as fallback for XDG_CONFIG_HOME), the old default location
~/.l2mdconfig is used as fallback.
To avoid breakage of old setups, use ~/.l2md/ as default base directory
iff it exists. Otherwise, use ~/${XDG_DATA_HOME}/l2md/.
Signed-off-by: Nicolas Schier <nicolas@fjasle.eu>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Enable -Wextra and add __noreturn to fix compilability.
Signed-off-by: Nicolas Schier <nicolas@fjasle.eu>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
This allows the user to choose a different installation directory.
Signed-off-by: Xinglu Chen <public@yoctocell.xyz>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
When (config) files get corrupted and are not the expected
size we'd enter an infinite loop.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
libgit2 requires an explicit opt-in to enable proxies.
With the option set it consults gitconfig like git would.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Introduce a config option to control the fetching/syncing on a
per-repo granularity.
Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
[ Daniel: rename to sync_enabled to make it more self-documenting
and enable by default to avoid breaking existing user configs. ]
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
By default l2md will loop forever and periodically fetch and
sync. Add a config option that enables l2md to sync once and
exit, so that it could also be invoked for oneshot operation
(e.g. via crontab), instead of running as a daemon service.
Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
During repo walking, revparse expects to find objects based on the
oid:"m" specification, but public-inbox encodes some specific objects
(e.g. spam) differently, and that causes the walk to bail out. Fix by
skipping all objects that don't match the default mail specification.
Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
It's the path variable and not tmp, so use the correct one.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
If we couldn't even start walking the repo, throw a warning to
inform what went wrong. Now that we've bumped the open file limit
this issue should be mitigated, but this indicates that potentially
the repo needs a repack. Once libgit2 supports this, we can actually
do it here instead.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Bump the limit to avoid bailing out in git_revwalk_next() without
having walked any commits. This happens when the repo has a lot of
pack files where we otherwise surpass the open file limit with the
default.
Ideally doing an equivalent of ...
git repack -a -d -f --depth=250 --window=250
... out of libgit2 would be best and solve this issue, but given
GH issue [0], it's not there yet (if ever).
[0] https://github.com/libgit2/libgit2/issues/3247
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Add two more suggestions from Konstantin with regards to using the
manifest file for checking updates and epoch roll-over.
Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Seems this was missing in the README.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Add very initial/rough support for piping new mails to external MDAs.
Konstantin says:
Thanks for working on this -- I've started on a similar tool in the
past, but got distracted and never completed it. In my implementation,
it was piping messages to procmail, which allowed writing complex rules
for folders/pre-processing, etc. May I suggest that your tool also
offers a stdout that can be piped to procmail?
Used test config:
$ cat ~/.l2mdconfig
[general]
base = /tmp/test/
pipe = /usr/bin/procmail
period = 30
[repo bpf]
url = https://lore.kernel.org/bpf/0
initial_import = 10
Tested l2md -> procmail -> mutt locally which seems to work fine.
Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/workflows/20190930212410.GE14403@pure.paranoia.local/
|
|
Refactor the output handling of new mails in order to allow adding
new modes as next step.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
It's not tied in any way to the fact that we're using maildir, plus
we want to support different output modes in future, therefore move
to a more generic name.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
As not needed for != stdout and also if verbose() is disabled.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Given we may be deriving the repo-specific default paths from the
general config, add a sanity check that we have parsed the general
one before the repo specific sections, and simply just bail out if
this was not the case. Not really a point in making it more complex
right now.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
No need to hard code it once more, so just reuse what we
just defined.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Enable the config file to override the default global base path where
the git repos are cloned and reside, and dump the setting in the verbose
output, while at it. Also, add the default base path in the example
l2mdconfig file.
Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
Ignore object files and l2md binary.
Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
|
There it is. See README for more details and setup.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|