Skip to content
Permalink
Browse files

Merge pull request #2735 from alexsaber/master

Resolving issue #2541
  • Loading branch information...
markus2330 committed Jun 12, 2019
2 parents b231881 + aa1031c commit d64deec006a4c45261913d79b2aace361d55cb1d
Showing with 173 additions and 158 deletions.
  1. +9 −3 doc/INSTALL.md
  2. +5 −0 doc/news/_preparation_next_release.md
  3. +2 −2 doc/tutorials/crypto.md
  4. +6 −6 doc/tutorials/validation.md
  5. 0 scripts/run_dev_env
  6. +2 −2 src/plugins/base64/README.md
  7. +9 −9 src/plugins/blockresolver/README.md
  8. +3 −3 src/plugins/blockresolver/blockresolver/compare.block
  9. +3 −3 src/plugins/blockresolver/blockresolver/test.block
  10. +7 −7 src/plugins/conditionals/README.md
  11. +3 −3 src/plugins/curlget/README.md
  12. +1 −1 src/plugins/iconv/iconv/iconv.ini
  13. +27 −26 src/plugins/ini/README.md
  14. +1 −1 src/plugins/ini/crash_test/crash001.ini
  15. +11 −8 src/plugins/ini/ini.c
  16. +4 −4 src/plugins/ini/ini/array.ini
  17. +3 −3 src/plugins/ini/ini/arrayInsertIn.ini
  18. +7 −7 src/plugins/ini/ini/arrayInsertOut.ini
  19. +1 −1 src/plugins/ini/ini/bracketQuoteOut.ini
  20. +2 −2 src/plugins/ini/ini/commentini
  21. +3 −3 src/plugins/ini/ini/complexIn.ini
  22. +5 −5 src/plugins/ini/ini/complexOut.ini
  23. +4 −4 src/plugins/ini/ini/emptyLines
  24. +2 −2 src/plugins/ini/ini/emptySectionBugTest
  25. +4 −4 src/plugins/ini/ini/emptyval
  26. +6 −6 src/plugins/ini/ini/insertTest.input.ini
  27. +8 −8 src/plugins/ini/ini/insertTest.output.ini
  28. +3 −3 src/plugins/ini/ini/multilineini
  29. +5 −5 src/plugins/ini/ini/plainini
  30. +5 −5 src/plugins/ini/ini/plaininireverse
  31. +4 −4 src/plugins/ini/ini/sectionini
  32. +5 −5 src/plugins/ini/ini/sectionmerge.input
  33. +5 −5 src/plugins/ini/ini/sectionmerge.output
  34. +2 −2 src/plugins/ini/ini/testCommentMeta.ini
  35. +2 −2 src/plugins/ini/ini/writeCommentMeta.ini
  36. +3 −3 src/plugins/mozprefs/README.md
  37. +1 −1 tests/shell/shell_recorder/tutorial_wrapper/SyntaxCheck.md
@@ -101,11 +101,17 @@ brew install elektra

. We also provide a tap containing a more elaborate formula [here](http://github.com/ElektraInitiative/homebrew-elektra).

## Generic
## Windows

Please refer to the section OS Independent below.

## OS Independent

First follow the steps in [COMPILE](COMPILE.md).

To install Elektra use:
After you completed building Elektra on your own, there are multiple options how to install it. For example, with make or cPack tools.

### make

```sh
sudo make install
@@ -126,7 +132,7 @@ or in the build directory (will not honor `DESTDIR`!):
xargs rm < install_manifest.txt
```

## CPack
### CPack

First follow the steps in [COMPILE](COMPILE.md).

@@ -388,6 +388,11 @@ removed due to:
- New plugin to validate hex formatted colors (e.g. #fff or #abcd) and normalize them to rgba (4294967295 (= 0xffffffff) and 2864434397 (= 0xaabbccdd) respectively). It also has support for named colors according to the [extended color keywords](https://www.w3.org/TR/css-color-3/#svg-color) from CSS3.
_(Philipp Gackstatter)_

### Ini

- Plugin writes to ini files without spaces around '=' anymore. Reading is still possible with and without spaces.
_(Oleksandr Shabelnyk)_

### macaddr

- Added a plugin to handle MAC addresses. `kdbGet` converts a MAC address into a decimal 64-bit integer (with the most significant 16 bits always set to 0), if the format is supported. `kdbSet` restores the converted values back to there original form. _(Thomas Bretterbauer)_
@@ -60,7 +60,7 @@ _Step 2:_ Set the password at `user/tests/password` and display the contents of
```sh
kdb set user/tests/password 1234
kdb file user/tests/password | xargs cat
#> password = 1234
#> password=1234
```

_Step 3:_ (Optional) Cleanup
@@ -231,7 +231,7 @@ The resulting INI-file contains the following data:

```ini
#@META crypto/encrypt = 1
password = @BASE64IyFjcnlwdG8wMBEAAADwPI+lqp+X2b6BIfLdRYgwxmAhVUPurqkQVAI78Pn4OYONbei4NfykMPvx9C9w91KT
password=@BASE64IyFjcnlwdG8wMBEAAADwPI+lqp+X2b6BIfLdRYgwxmAhVUPurqkQVAI78Pn4OYONbei4NfykMPvx9C9w91KT
```

You can access the password as usual with `kdb get`:
@@ -226,14 +226,14 @@ the human readable [ni format](/src/plugins/ni/README.md) by using `kdb import`)
sudo kdb mount tutorial.dump spec/tests/tutorial dump
cat << HERE | kdb import spec/tests/tutorial ni \
[] \
mountpoint = tutorial.dump \
infos/plugins = dump validation \
mountpoint=tutorial.dump \
infos/plugins=dump validation \
\
[/links/_] \
check/validation = https?://.*\..* \
check/validation/match = LINE \
check/validation/message = not a valid URL \
description = A link to some website \
check/validation=https?://.*\..* \
check/validation/match=LINE \
check/validation/message=not a valid URL \
description=A link to some website \
HERE
kdb lsmeta spec/tests/tutorial
#> infos/plugins
0 scripts/run_dev_env 100644 → 100755
No changes.
@@ -74,7 +74,7 @@ kdb get user/tests/base64/binary
# The value inside the configuration file is encoded by the Base64 plugin
kdb file user/tests/base64 | xargs cat
# STDOUT-REGEX: binary = "@BASE64[a-zA-Z0-9+/]+={0,2}"
# STDOUT-REGEX: binary="@BASE64[a-zA-Z0-9+/]+={0,2}"
# Undo modifications
kdb rm -r user/tests/base64
@@ -114,7 +114,7 @@ kdb mount config.ini user/tests/base64 ini base64 binary/meta=
# Save base64 encoded data `"value"` (`0x76616c7565`)
kdb set user/tests/base64/encoded dmFsdWUA
kdb file user/tests/base64/encoded | xargs cat | grep encoded
#> encoded = dmFsdWUA
#> encoded=dmFsdWUA
# Tell Base64 plugin to decode and encode key value
kdb setmeta user/tests/base64/encoded type binary
@@ -44,9 +44,9 @@ echo 'more text' >> $(kdb get system/tests/blockfile)
echo 'some more text' >> $(kdb get system/tests/blockfile)
echo '>>> block config start' >> $(kdb get system/tests/blockfile)
echo '[section1]' >> $(kdb get system/tests/blockfile)
echo 'key1 = val1' >> $(kdb get system/tests/blockfile)
echo 'key1=val1' >> $(kdb get system/tests/blockfile)
echo '[section2]' >> $(kdb get system/tests/blockfile)
echo 'key2 = val2' >> $(kdb get system/tests/blockfile)
echo 'key2=val2' >> $(kdb get system/tests/blockfile)
echo '>>> block config stop' >> $(kdb get system/tests/blockfile)
echo 'text again' >> $(kdb get system/tests/blockfile)
echo 'and more text' >> $(kdb get system/tests/blockfile)
@@ -61,9 +61,9 @@ cat $(kdb get system/tests/blockfile)
#> some more text
#> >>> block config start
#> [section1]
#> key1 = val1
#> key1=val1
#> [section2]
#> key2 = val2
#> key2=val2
#> >>> block config stop
#> text again
#> and more text
@@ -72,9 +72,9 @@ cat $(kdb get system/tests/blockfile)
# only the block between the tags is read!
kdb export system/tests/blockresolver ini
#> [section1]
#> key1 = val1
#> key1=val1
#> [section2]
#> key2 = val2
#> key2=val2
# add a new key to the resolved block
kdb set system/tests/blockresolver/section1/key12 val12
@@ -85,10 +85,10 @@ cat $(kdb get system/tests/blockfile)
#> some more text
#> >>> block config start
#> [section1]
#> key1 = val1
#> key12 = val12
#> key1=val1
#> key12=val12
#> [section2]
#> key2 = val2
#> key2=val2
#> >>> block config stop
#> text again
#> and more text
@@ -1,8 +1,8 @@
[section]
key = outside start
key=outside start
### block config start
[section]
key = only the inside has changed
key=only the inside has changed
### block config stop
[section]
key = outside end
key=outside end
@@ -1,8 +1,8 @@
[section]
key = outside start
key=outside start
### block config start
[section]
key = inside block
key=inside block
### block config stop
[section]
key = outside end
key=outside end
@@ -112,17 +112,17 @@ sudo kdb mount sub.ini /tests/conditionals/sub ini
sudo kdb global-mount conditionals || $(exit 0)
# create testfiles
echo 'key1 = val1' > `kdb file /tests/conditionals`
echo 'key1=val1' > `kdb file /tests/conditionals`
echo '[key1]' >> `kdb file /tests/conditionals`
echo "check/condition = (./ == 'val1') ? (../sub/key == 'true')" >> `kdb file /tests/conditionals`
echo "check/condition=(./ == 'val1') ? (../sub/key == 'true')" >> `kdb file /tests/conditionals`
echo "key = false" > `kdb file /tests/conditionals/sub`
echo "key=false" > `kdb file /tests/conditionals/sub`
# should fail and yield an error
kdb export /tests/conditionals ini
#> sub/key = false
#> sub/key=false
#> #@META check/condition = (./ == 'val1') ? (../sub/key == 'true')
#> key1 = val1
#> key1=val1
# ERROR:135
# Sorry, module conditionals issued the error 135:
# Validation failed: Validation of Key key1: (./ == 'val1') ? (../sub/key == 'true') failed. ((../sub/key == 'true') failed)
@@ -131,9 +131,9 @@ kdb set /tests/conditionals/sub/key true
# should succeed
kdb export /tests/conditionals ini
#> sub/key = true
#> sub/key=true
#> #@META check/condition = (./ == 'val1') ? (../sub/key == 'true')
#> key1 = val1
#> key1=val1
# cleanup
kdb rm -r /tests/conditionals
@@ -108,8 +108,8 @@ stat /tmp/curltest.ini
# RET:0
cat /tmp/curltest.ini
#> [section1]
#> key1 = val1
#> key2 = val2
#> key1=val1
#> key2=val2
rm /tmp/curltest.ini || $(exit 0)
sudo kdb mount -R curlget -c url/put="http://127.0.0.1:8000",user="thomas",password="pass",upload/method="POST",upload/postfield="file" "http://127.0.0.1:8000/curltest.ini" system/curl ini
kdb ls system/curl
@@ -126,7 +126,7 @@ kdb rm system/curl/section1/key2
sudo kdb umount system/curl
cat /tmp/httproot/curltest.ini
#> [section1]
#> key1 = val1
#> key1=val1
```

### Mount with HTTP GET + POST and keep local copy
@@ -1 +1 @@
a = hell�
a=hell�
@@ -11,8 +11,9 @@

## Introduction

[lock/a/lock]
This plugin allows Elektra's users to read and write INI files.
INI files consist of simple key value pairs of the form `key = value`.
INI files consist of simple key value pairs of the form `key=value`.
Additionally keys can be categorized into different sections.
Sections must be enclosed in "[]", for example "[section]".
Each section is converted into a directory key
@@ -71,8 +72,8 @@ have to start with whitespace characters.
For example consider the following ini file:

```ini
key1 = value1
key2 = value2
key1=value1
key2=value2
with continuation
lines
```
@@ -91,10 +92,10 @@ For example an ini file looking like:

```ini
[sec]
a = 1
a = 2
a = 3
a = 4
a=1
a=2
a=3
a=4
```

will be interpreted as
@@ -132,9 +133,9 @@ kdb get user/tests/ini/songs/#2
# Check the file written by the INI plugin
kdb file user/tests/ini | xargs cat
#> songs = Non-Zero Possibility
#> songs = Black Art Number One
#> songs = A Story Of Two Convicts
#> songs=Non-Zero Possibility
#> songs=Black Art Number One
#> songs=A Story Of Two Convicts
# Undo modifications
kdb rm -r user/tests/ini
@@ -152,7 +153,7 @@ By default the INI plugin does not support binary data. You can use the [Base64
sudo kdb mount --with-recommends config.ini user/tests/ini ini base64
# Add empty binary value
printf 'nothing = "@BASE64"\n' > `kdb file user/tests/ini`
printf 'nothing="@BASE64"\n' > `kdb file user/tests/ini`
# Copy binary data
kdb cp system/elektra/modules/ini/exports/get user/tests/ini/binary
# Add textual data
@@ -190,7 +191,7 @@ kdb setmeta user/tests/ini/brand rationale "Because I Love It"
kdb file user/tests/ini | xargs cat
#> #@META description = The Devil And God Are Raging Inside Me
#> #@META rationale = Because I Love It
#> brand = new
#> brand=new
# Retrieve metadata
kdb lsmeta user/tests/ini/brand | grep -v 'internal'
@@ -226,7 +227,7 @@ kdb set dir/tests/a/b ab
kdb get dir/tests/a # <-- key is suddenly here
cat empty.ini
#> [a]
#> b = ab
#> b=ab
# Undo modifications
kdb rm -r dir/tests
@@ -242,13 +243,13 @@ kdb set dir/tests/a/b ab
kdb get dir/tests/a # no key here
# RET: 11
cat empty.ini
#> a/b = ab
#> a/b=ab
kdb rm dir/tests/a/b
kdb set dir/tests/a # create section first
kdb set dir/tests/a/b ab
cat empty.ini
#> [a]
#> b = ab
#> b=ab
# Undo modifications
kdb rm -r dir/tests
@@ -272,28 +273,28 @@ sudo kdb mount test.ini /tests/ini ini
cat > `kdb file /tests/ini` <<EOF \
[Section1]\
key1 = val1\
key1=val1\
[Section3]\
key3 = val3\
key3=val3\
EOF
kdb file /tests/ini | xargs cat
#> [Section1]
#> key1 = val1
#> key1=val1
#> [Section3]
#> key3 = val3
#> key3=val3
kdb set /tests/ini/Section1/Subsection1/subkey1 subval1
kdb set /tests/ini/Section2/key2 val2
kdb file /tests/ini | xargs cat
#> [Section1]
#> key1 = val1
#> key1=val1
#> [Section1/Subsection1]
#> subkey1 = subval1
#> subkey1=subval1
#> [Section2]
#> key2 = val2
#> key2=val2
#> [Section3]
#> key3 = val3
#> key3=val3
# Undo modifications
kdb rm -r /tests/ini
@@ -308,14 +309,14 @@ The INI plugin also supports values and keys containing delimiter characters (`=
sudo kdb mount test.ini user/tests/ini ini
printf '[section1]\n' > `kdb file user/tests/ini`
printf 'hello = world\n' >> `kdb file user/tests/ini`
printf 'hello=world\n' >> `kdb file user/tests/ini`
kdb get user/tests/ini/section1/hello
#> world
kdb set user/tests/ini/section1/x=x 'a + b = b + a'
kdb set user/tests/ini/section1/x=x 'a + b=b + a'
kdb get user/tests/ini/section1/x=x
#> a + b = b + a
#> a + b=b + a
# Undo modifications
kdb rm -r user/tests/ini
@@ -1,2 +1,2 @@
"value = long
"value=long
key

0 comments on commit d64deec

Please sign in to comment.
You can’t perform that action at this time.