Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Mount tooling in C #4864

Draft
wants to merge 47 commits into
base: kdb_cli_rewrite
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c877b59
kdb-cli: add new main.c
hannes99 Sep 20, 2022
cba1c28
kdb-cli: add helper functions
hannes99 Sep 21, 2022
19203b4
kdb-cli: rewrite get command
hannes99 Sep 21, 2022
38ce374
kdb-cli: rewrite ls command
hannes99 Sep 22, 2022
701dcfe
kdb-cli: rewrite basename command
hannes99 Sep 23, 2022
e312638
kdb-cli: rewrite namespace command
hannes99 Sep 23, 2022
3a294d8
kdb-cli: rewrite dirname command
hannes99 Sep 25, 2022
9bfd674
kdb-cli: rewrite cmerge command
hannes99 Sep 26, 2022
6c21835
kdb-cli: add mountpoint command structure
hannes99 Nov 2, 2022
9b955b2
kdb-cli: add formatted and log-level dependant output
hannes99 Jan 4, 2023
42cfb51
kdb-cli: rewrite set
hannes99 Mar 1, 2023
a30cbb4
kdb-cli: add meta subcommand
hannes99 Mar 1, 2023
6af0e71
kdb-cli: rewrite meta-get
hannes99 Mar 1, 2023
646913d
kdb-cli: rewrite meta-set
hannes99 Mar 1, 2023
5d98421
kdb-cli: rewrite meta-ls
hannes99 Mar 1, 2023
173bd5c
kdb-cli: rewrite meta-show
hannes99 Mar 1, 2023
b63c2f0
kdb-cli: rewrite meta-rm
hannes99 Mar 1, 2023
f6ccb1a
kdb-cli: rewrite mv
hannes99 Mar 2, 2023
36347f8
kdb-cli: rewrite rm
hannes99 Mar 2, 2023
13a58d4
kdb-cli: rewrite cp
hannes99 Mar 2, 2023
2cdc368
kdb-cli: rewrite find
hannes99 Mar 3, 2023
c13f670
kdb-cli: add rewrite release-note
hannes99 Mar 6, 2023
369e838
kdb-cli: "mountpoint mount" external iteration
flo91 Jan 4, 2023
e7a0b82
kdb-cli: fix error (double keyDel()) in main()
flo91 Jan 4, 2023
101ef14
doc: update release notes
flo91 Jan 4, 2023
01c0a84
kdb-cli: include colors.h header to some c-files
flo91 Jan 4, 2023
960882f
Mounting: Re-implement C++-code for mounting in C
flo91 Nov 1, 2022
f1dfdd3
Mounting: Continue re-implemnting mounting-related C++-code in C
flo91 Nov 2, 2022
0cb1f8e
mounting: Add mountpoint validation to c-based lib
flo91 Jan 23, 2023
9abf8fd
mounting: Refactoring, start processing of plugins
flo91 Jan 28, 2023
48c0fd1
mounting: Process PluginSpec for adding plugins
flo91 Jan 31, 2023
2bef125
mounting: Implement lookupProvides() for plugins
flo91 Feb 5, 2023
b4a6481
mounting: Add code for adding and sorting plugins
flo91 Feb 7, 2023
dc8c7af
mounting: resolveNeeds - Get missing recommends
flo91 Feb 8, 2023
83e320d
mounting: Add lists for strings and plugin-specs
flo91 Feb 22, 2023
534a372
mounting: add checking of config, fix args
flo91 Feb 24, 2023
3f6466d
mounting: remove function to fix compile error
flo91 Mar 11, 2023
22ab72d
mounting: add functions for serialization (WIP)
flo91 Mar 13, 2023
606284f
mounting: serialization, check config, load plugin
flo91 Mar 16, 2023
76e9862
mounting: lots of adaptions, udpates, fixes
flo91 Mar 20, 2023
dfa7826
mounting: adapt code to add/sort pluginspecs
flo91 Mar 22, 2023
adc1e68
mounting: rework resolveNeeds()
flo91 Mar 26, 2023
c581360
mounting: Impl. lookupMeta(), rework serialize()
flo91 Mar 28, 2023
9c1c283
mounting: cleanup, refactoring (grouping, order)
flo91 Mar 28, 2023
9fd2b39
mounting: bugfixes, restructuring, optimizations
flo91 Apr 1, 2023
c4cd93c
mounting: bugfixes, improvements, finish mem-mgmt
flo91 Apr 3, 2023
6652e31
mouting: fix compilation errors, update exports
flo91 Apr 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions doc/news/_preparation_next_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,13 @@ This section keeps you up-to-date with the multi-language support provided by El

## Tools

### <<Tool>>
### KDB

- rewrite C++ cli to C _(@hannes99)_
- Removed `global-mount` and `global-umount` commands. _(Maximilian Irlinger @atmaxinger)_
- <<TODO>>
- <<TODO>>
- <<TODO>>
- Fixed SIGSEGV when using find without argument _(Christian Jonak-Moechel @joni1993)_
- Re-implement the kdb-tool in C (the original tool was written in C++) _(Hannes Laimer @hannes99)_ _(Florian Lindner @flo91)_

### <<Tool>>

Expand Down
1 change: 1 addition & 0 deletions src/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ install (
kdbmacros.h
kdbmerge.h
kdbgopts.h
kdbmount.h
DESTINATION include/${TARGET_INCLUDE_FOLDER}
COMPONENT libelektra-dev)

Expand Down
28 changes: 28 additions & 0 deletions src/include/kdbmount.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* Mount API for newbackend, currently re-implementation of old mounting process in C instead of C++ */

#ifndef KDB_MOUNT_H
#define KDB_MOUNT_H

#include <kdb.h>
#include <stdbool.h>

#ifdef __cplusplus
namespace ckdb
{
extern "C" {
#endif

#define DEFAULT_MOUNTPOINTS_PATH "system:/elektra/mountpoints"

/* Actual mounting functionality */
void outputMtab (KeySet * ksMountConf, bool clFirst, bool clSecond, bool clNull);
void buildBackend (KeySet * mountConf, const char * mountPoint, char * pluginsConfig, bool clForce, bool clDebug,
int mergeStrategy, char * resolverName, const char * path, const KeySet * plugins, bool withRecommends);
KeySet * getMountConfig (KDB * handle, const char * mountpointsPath);

#ifdef __cplusplus
}
}
#endif

#endif // KDB_MOUNT_H
4 changes: 2 additions & 2 deletions src/libs/elektra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if (BUILD_SHARED)
GLOB
KDB_FILES
kdb.c
mount.c
cmount.c
hooks.c
backends.c
plugin.c
Expand All @@ -82,7 +82,7 @@ if (BUILD_SHARED)

add_library (elektra-kdb SHARED ${KDB_FILES})
add_dependencies (elektra-kdb generate_version_script)
target_link_libraries (elektra-kdb elektra-core)
target_link_libraries (elektra-kdb elektra-core elektra-meta)

get_property (elektra-extension_LIBRARIES GLOBAL PROPERTY elektra-extension_LIBRARIES)

Expand Down