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

[#3742] Cascading writes #4908

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion doc/help/kdb-editor.md
Expand Up @@ -25,12 +25,14 @@ The user should specify the format that the current configuration or keys are in
- 11:
could not export configuration.
- 12:
could not start editor.
No namespace specified.
- 13:
could not import configuration because of conflicts
- 14:
could not import configuration because of error during kdbSet()
(Most likely a validation error)
- 15:
could not start editor.

## OPTIONS

Expand Down
2 changes: 1 addition & 1 deletion doc/help/kdb-find.md
Expand Up @@ -56,7 +56,7 @@ kdb find 'fizz'
#> user:/tests/find/tests/fizz/buzz
#> user:/tests/find/tostfizz

kdb rm -r /tests/find
kdb rm -r user:/tests/find
sudo kdb umount user:/tests/find
```

Expand Down
2 changes: 1 addition & 1 deletion doc/help/kdb-ls.md
Expand Up @@ -90,7 +90,7 @@ kdb ls /tests/examples/kdb-ls/ -v
#> user:/tests/examples/kdb-ls/tost
#> user:/tests/examples/kdb-ls/tost/level

kdb rm -r user:/tests/examples
kdb rm -r user:/tests/examples/
sudo kdb umount user:/tests/examples
```

Expand Down
2 changes: 2 additions & 0 deletions doc/help/kdb-mv.md
Expand Up @@ -28,6 +28,8 @@ This command will return the following values as an exit status:
standard exit codes, see [kdb(1)](kdb.md)
- 11:
No key to move found.
- 12:
No namespace specified.

## OPTIONS

Expand Down
2 changes: 2 additions & 0 deletions doc/help/kdb-rm.md
Expand Up @@ -21,6 +21,8 @@ This command will return the following values as an exit status:
standard exit codes, see [kdb(1)](kdb.md)
- 11:
No key to remove found.
- 12:
No namespace specified.

## OPTIONS

Expand Down
5 changes: 4 additions & 1 deletion doc/man/man1/kdb-editor.1
Expand Up @@ -21,13 +21,16 @@ standard exit codes, see kdb(1) \fIkdb\.md\fR
could not export configuration\.
.TP
12
could not start editor\.
No namespace specified\.
.TP
13
could not import configuration because of conflicts
.TP
14
could not import configuration because of error during kdbSet() (Most likely a validation error)
.TP
15
could not start editor\.
.SH "OPTIONS"
.TP
\fB\-H\fR, \fB\-\-help\fR
Expand Down
4 changes: 2 additions & 2 deletions doc/man/man1/kdb-find.1
@@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1.pre3
.TH "KDB\-FIND" "1" "November 2020" ""
.TH "KDB\-FIND" "1" "April 2023" ""
.SH "NAME"
\fBkdb\-find\fR \- Find keys in the key database
.SH "SYNOPSIS"
Expand Down Expand Up @@ -59,7 +59,7 @@ kdb find 'fizz'
#> user:/tests/find/tests/fizz/buzz
#> user:/tests/find/tostfizz

kdb rm \-r /tests/find
kdb rm \-r user:/tests/find
sudo kdb umount user:/tests/find
.fi
.SH "SEE ALSO"
Expand Down
4 changes: 2 additions & 2 deletions doc/man/man1/kdb-ls.1
@@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1.pre3
.TH "KDB\-LS" "1" "November 2020" ""
.TH "KDB\-LS" "1" "April 2023" ""
.SH "NAME"
\fBkdb\-ls\fR \- List keys in the key database
.SH "SYNOPSIS"
Expand Down Expand Up @@ -93,7 +93,7 @@ kdb ls /tests/examples/kdb\-ls/ \-v
#> user:/tests/examples/kdb\-ls/tost
#> user:/tests/examples/kdb\-ls/tost/level

kdb rm \-r user:/tests/examples
kdb rm \-r user:/tests/examples/
sudo kdb umount user:/tests/examples
.fi
.SH "SEE ALSO"
Expand Down
5 changes: 4 additions & 1 deletion doc/man/man1/kdb-mv.1
@@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1.pre3
.TH "KDB\-MV" "1" "November 2020" ""
.TH "KDB\-MV" "1" "April 2023" ""
.SH "NAME"
\fBkdb\-mv\fR \- Move keys within the key database
.SH "SYNOPSIS"
Expand All @@ -22,6 +22,9 @@ standard exit codes, see kdb(1) \fIkdb\.md\fR
.TP
11
No key to move found\.
.TP
12
No namespace specified\.
.SH "OPTIONS"
.TP
\fB\-H\fR, \fB\-\-help\fR
Expand Down
5 changes: 4 additions & 1 deletion doc/man/man1/kdb-rm.1
@@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1.pre3
.TH "KDB\-RM" "1" "November 2020" ""
.TH "KDB\-RM" "1" "April 2023" ""
.SH "NAME"
\fBkdb\-rm\fR \- Remove key(s) from the key database
.SH "SYNOPSIS"
Expand All @@ -20,6 +20,9 @@ standard exit codes, see kdb(1) \fIkdb\.md\fR
.TP
11
No key to remove found\.
.TP
12
No namespace specified\.
.SH "OPTIONS"
.TP
\fB\-H\fR, \fB\-\-help\fR
Expand Down
1 change: 1 addition & 0 deletions doc/news/_preparation_next_release.md
Expand Up @@ -214,6 +214,7 @@ The text below summarizes updates to the [C (and C++)-based libraries](https://w
- Add `elektraCopyError` function to copy error from one key to another _(Maximilian Irlinger @atmaxinger)_
- Add `elektraCopyWarnings` function to copy warnings from one key to another _(Maximilian Irlinger @atmaxinger)_
- Add `elektraCopyErrorAndWarnings` function to copy error and warnings from one key to another _(Maximilian Irlinger @atmaxinger)_
- Disable cascading writes and update tests, docs and tutorials _(Hannes Laimer @hannes99)_
- <<TODO>>

### <<Library>>
Expand Down
7 changes: 4 additions & 3 deletions doc/tutorials/cascading.md
Expand Up @@ -191,11 +191,12 @@ As last part in this tutorial we remove the modifications to the database we mad

```sh
kdb rm -r user:/tests/tutorial/
sudo kdb rm -r system:/tests/tutorial
sudo kdb rm -r system:/tests/overrides
kdb rm -r dir:/tests/tutorial/
sudo kdb rm -r system:/tests/tutorial/
sudo kdb rm -r system:/tests/overrides/
kdb import system:/tests/overrides dump < $(kdb get user:/tests/overrides)
rm $(kdb get user:/tests/overrides)
kdb rm user:/tests/overrides
kdb rm -r user:/tests/overrides/

sudo kdb rm -r spec:/tests/tutorial/

Expand Down
2 changes: 2 additions & 0 deletions doc/tutorials/cmerge.md
Expand Up @@ -207,6 +207,8 @@ kdb cmerge -f user:/tests/arrays/changed user:/tests/arrays/original user:/tests

kdb get user:/tests/arrays/result/#0
#> previous

kdb rm -r user:/tests/
```

## Scripts
Expand Down
2 changes: 2 additions & 0 deletions doc/tutorials/merge.md
Expand Up @@ -273,6 +273,8 @@ kdb get user:/tests/result/key4

kdb get user:/tests/result/key5
#> 5

kdb rm -r user:/tests/
```

Here the state of theirs is simply copied to the `resultpath`.
Expand Down
5 changes: 5 additions & 0 deletions doc/tutorials/namespaces.md
Expand Up @@ -187,3 +187,8 @@ kdb get "/sw/elektra/kdb/#0/debug/verbose"
```

Now `kdb get -p debug /some/key` is not verbose anymore for this user.

```sh
# Cleanup`
kdb rm -r user:/tests/
```
17 changes: 11 additions & 6 deletions doc/tutorials/validation.md
Expand Up @@ -259,7 +259,7 @@ kdb file dir:/tests/tutorial
If you want to go without validation, you can work around that by setting the keys with the `-f` (`--force`) option:

```sh
kdb set -f system:/tests/tutorial/links/elektra "invalid url"
sudo kdb set -f system:/tests/tutorial/links/elektra "invalid url"
#> Create a new key system:/tests/tutorial/links/elektra with string "invalid url"
```

Expand Down Expand Up @@ -288,7 +288,7 @@ Before we look further let us undo the modifications to the key database.

```sh
kdb rm -r spec:/tests/tutorial
kdb rm -r system:/tests/tutorial
sudo kdb rm -r system:/tests/tutorial
kdb rm -rf user:/tests/tutorial
kdb umount spec:/tests/tutorial
kdb umount /tests/tutorial
Expand All @@ -298,8 +298,8 @@ kdb import spec:/ dump < $(kdb get system:/tests/specbackup)
kdb import user:/ dump < $(kdb get system:/tests/userbackup)
rm $(kdb get system:/tests/specbackup)
rm $(kdb get system:/tests/userbackup)
kdb rm system:/tests/specbackup
kdb rm system:/tests/userbackup
sudo kdb rm system:/tests/specbackup
sudo kdb rm system:/tests/userbackup
```

## Validate Existing Keys
Expand All @@ -315,8 +315,12 @@ sudo kdb mount range.ecf /tests/range range dump
# set value
kdb set user:/tests/range/value 5

# set value
kdb get user:/tests/range/value
#> 5

# add range check to all keys under /tests/range/
kdb meta-set spec:/tests/range/_ check/range "1-10"
sudo kdb meta-set spec:/tests/range/_ check/range "1-10"

# check if validate passes
kdb validate /tests/range
Expand All @@ -329,7 +333,8 @@ kdb validate /tests/range
# RET:11

# clean up
kdb rm -r /tests/range/
sudo kdb umount /tests/range
kdb rm -rf user:/tests/
sudo kdb rm -rf spec:/tests/

```
2 changes: 1 addition & 1 deletion src/bindings/gsettings/README.md
Expand Up @@ -108,7 +108,7 @@ export current settings and delete them so they will not be hidden

```sh
kdb export /sw dump > tmp
kdb rm -r /sw
kdb rm -r user:/sw
```

mount sw at you preferred location
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/conditionals/README.md
Expand Up @@ -142,7 +142,8 @@ kdb set system:/tests/conditionals/sub/key true
kdb export system:/tests/conditionals ni

# cleanup
kdb rm -r /tests/conditionals
kdb rm -r user:/tests/conditionals
kdb rm -r system:/tests/conditionals
sudo kdb umount /tests/conditionals/sub
sudo kdb umount /tests/conditionals

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/csvstorage/README.md
Expand Up @@ -149,7 +149,7 @@ kdb ls /tests/csv
kdb get /tests/csv/tt0108052/Title
#> Schindler´s List

kdb rm -r /tests/csv
kdb rm -r user:/tests/csv
sudo kdb umount /tests/csv

```
Expand All @@ -175,7 +175,7 @@ kdb export /tests/csv csvstorage -c "delimiter=;,header=colname,columns/index=IM
#> tt0110413;1994


kdb rm -r /tests/csv
kdb rm -r user:/tests/csv
sudo kdb umount /tests/csv

```
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/email/README.md
Expand Up @@ -56,7 +56,8 @@ kdb set user:/tests/email/adr @
# RET: 5

# Undo modifications to the database
kdb rm -rf /tests/email
kdb rm -rf spec:/tests/email
kdb rm -rf user:/tests/email
kdb umount /tests/email
```

Expand Down
3 changes: 1 addition & 2 deletions src/plugins/fcrypt/README.md
Expand Up @@ -59,7 +59,6 @@ Please report the issue at https://issues.libelektra.org/
you might want to consider disabling the sync plugin by entering:

```sh
kdb set /sw/elektra/kdb/#0/current/plugins ""
kdb set system:/sw/elektra/kdb/#0/current/plugins ""
```

Expand Down Expand Up @@ -103,7 +102,7 @@ kdb mount test.ecf /t fcrypt \
If you create a key under `/t`

```sh
kdb set /t/a "hello world"
kdb set user:/t/a "hello world"
```

you will notice that you can not read the plain text of `test.ecf` because it has been encrypted by GPG.
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/hosts/README.md
Expand Up @@ -98,15 +98,15 @@ kdb get /tests/hosts/ipv6/localhost
#> ::1

# Should both fail with error C03200 and return 5
kdb set /tests/hosts/ipv4/localhost ::1
kdb set user:/tests/hosts/ipv4/localhost ::1
# RET:5
# ERROR:C03200
kdb set /tests/hosts/ipv6/localhost 127.0.0.1
kdb set user:/tests/hosts/ipv6/localhost 127.0.0.1
# RET:5
# ERROR:C03200

# cleanup
kdb rm -r /tests/hosts
kdb rm -r user:/tests/hosts
sudo kdb umount /tests/hosts
```

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/ipaddr/README.md
Expand Up @@ -54,7 +54,8 @@ kdb set system:/tests/ipaddr/address 1.2.-3.4
# RET: 5

# Undo modifications to the database
kdb rm -r /tests/ipaddr
kdb rm -r system:/tests/ipaddr
kdb rm -r spec:/tests/ipaddr
kdb umount /tests/ipaddr
```

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kconfig/README.md
Expand Up @@ -75,7 +75,7 @@ kdb get /tests/kconfig/key
#> Value

# Set the value to Example
kdb set /tests/kconfig/key Example
kdb set user:/tests/kconfig/key Example

# Verify that the value has changed in the file too
cat `kdb file user:/tests/kconfig`
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/length/README.md
Expand Up @@ -41,7 +41,8 @@ kdb set user:/tests/length/text abc
kdb get user:/tests/length/text

# Undo modifications to the database
kdb rm -rf /tests/length
kdb rm -rf spec:/tests/length
kdb rm -rf user:/tests/length
kdb umount /tests/length
```

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/path/README.md
Expand Up @@ -76,7 +76,7 @@ kdb set user:/tests/path "$HOME"
# STDOUT-REGEX: .*Set string to "/.*".*

#cleanup
sudo kdb rm -r user:/tests
sudo kdb rm -r user:/tests/
sudo kdb umount user:/tests
```

Expand All @@ -102,7 +102,7 @@ kdb set user:/tests/path `kdb get user:/tests/path/tempfile`

#cleanup
sudo rm -rf `kdb get user:/tests/path/tempfile`
sudo kdb rm -r user:/tests
sudo kdb rm -r user:/tests/
sudo kdb umount user:/tests
```

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/range/README.md
Expand Up @@ -82,7 +82,8 @@ kdb set user:/tests/range/value 7
kdb set user:/tests/range/value 2
# RET:0

kdb rm -r user:/tests/range
kdb rm -r user:/tests/range/
kdb rm -r spec:/tests/range/
sudo kdb umount /tests/range
```

Expand Down
1 change: 1 addition & 0 deletions src/plugins/shell/README.md
Expand Up @@ -48,6 +48,7 @@ cat $(kdb get system:/tests/tempfile)

# Undo modifications
rm $(kdb get system:/tests/tempfile)
kdb rm -r system:/tests/tempfile
kdb rm -r system:/tests/shell
sudo kdb umount system:/tests/shell
```