120 Commits

Author SHA1 Message Date
Wolfgang Bumiller
d1743af5d8 update docs and let the bless test use Value::bless_box
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-19 10:32:51 +02:00
Wolfgang Bumiller
81354c3960 perlmod: add Value::bless_box
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-19 10:32:51 +02:00
Wolfgang Bumiller
449d746871 perlmod-macro: improve error handling
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-15 09:52:58 +02:00
Wolfgang Bumiller
f888c202cc perlmod-macro: drop anyhow dependency
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-15 09:45:57 +02:00
Wolfgang Bumiller
d253472380 perlmod: drop derive requirement on serde
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-15 09:37:24 +02:00
Wolfgang Bumiller
55f3db4827 drop thiserror
not worth it right now

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-15 09:34:31 +02:00
Wolfgang Bumiller
2e5e60c479 drop rust-toolchain file
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-15 09:31:11 +02:00
Wolfgang Bumiller
81da219db5 bump perlmod to 0.7.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-14 15:26:02 +02:00
Wolfgang Bumiller
f3f92edcd2 prevent creating ScalarRef values manually
it is dangerous as it should only exist as a valid reference

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-14 15:24:20 +02:00
Wolfgang Bumiller
b8ef338c1c bump perlmod-macro to 0.4.0 and perlmod to 0.6.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-14 15:14:00 +02:00
Wolfgang Bumiller
b2ad024751 add README.md
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-14 15:14:00 +02:00
Wolfgang Bumiller
6ccbcbec1a add reference deserialization test data
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-14 15:13:48 +02:00
Wolfgang Bumiller
245de6dd67 add RawValue and raw value serialization
perl Values are now generally serialized as *raw* values,
for *de*serialization this can be enforced via the RawValue
type

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-14 15:01:17 +02:00
Wolfgang Bumiller
4fe09940a7 make values Clone
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-14 13:43:38 +02:00
Wolfgang Bumiller
814014b874 macro: support env vars in package attributes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-13 12:52:02 +02:00
Wolfgang Bumiller
9de065545b macro: use CARGO_PKG_NAME instead of reading Cargo.toml
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-13 11:28:16 +02:00
Wolfgang Bumiller
c9d79aaea8 bump version to 0.5.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-19 10:33:35 +02:00
Wolfgang Bumiller
0864428bd6 test: set autoflush for consistency
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-19 09:37:09 +02:00
Wolfgang Bumiller
9acdb78242 add is_defined helper glue
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-19 09:34:32 +02:00
Fabian Ebner
93eaead22a test for broken undef detection
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-19 09:02:59 +02:00
Wolfgang Bumiller
4c9f6c51d7 macro: different approach to clippy warning
currently this does in fact deduplicate code, so...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-02 11:54:33 +02:00
Wolfgang Bumiller
ab3923dc66 bump perlmod to 0.5.2-2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-02 11:42:17 +02:00
Wolfgang Bumiller
3d5b075bdc perlmod: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-02 11:39:46 +02:00
Wolfgang Bumiller
a2a884c13d macro: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-02 11:37:51 +02:00
Wolfgang Bumiller
83ac604e08 test updates
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-02 11:33:05 +02:00
Wolfgang Bumiller
3f7917309b set utf8 flag as needed when serializing strings
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-02 11:31:51 +02:00
Wolfgang Bumiller
726fa9b484 bump perlmod-macro to 0.3.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-30 09:48:00 +02:00
Wolfgang Bumiller
aa13c5c85b macro: add newlines to errors
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-30 08:14:54 +02:00
Wolfgang Bumiller
36bbf1d1a1 bump verstion to 0.5.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-23 10:59:34 +02:00
Wolfgang Bumiller
fa780264ca update test files
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-23 10:58:31 +02:00
Wolfgang Bumiller
fbf0c7a20b fix newtype struct deserialization
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-23 10:58:21 +02:00
Wolfgang Bumiller
0daaa90cf6 bump version to 0.5.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-21 12:40:56 +02:00
Wolfgang Bumiller
b5c53f3d37 improve PVLV handling
For the cases we're most intested in (substr and vivifyable
hash indexing) we can use perform "GET" magic to figure out
whether it was undef or not, and then simply recurse.
We'll have to deal with other cases as we run into them.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-10 10:14:04 +02:00
Wolfgang Bumiller
61143f5d12 experimental PVLV support
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-08 11:28:01 +02:00
Wolfgang Bumiller
ec6f42c37e bump perlmod to 0.4.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-09 15:36:52 +01:00
Fabian Ebner
f053fb84ef array: avoid underflow when array is empty and more is zero
serializing an empty array triggered this.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
[rustfmt: Wolfgang Bumiller <w.bumiller@proxmox.com>]
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-09 15:32:40 +01:00
Wolfgang Bumiller
dc04b1694f bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-23 14:27:00 +01:00
Wolfgang Bumiller
4aee0cb571 bump perlmod to 0.4.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-23 14:26:31 +01:00
Wolfgang Bumiller
db22bf8db6 allow PVMG in deserialization
they are supposed to end up being regular scalars after all,
usually

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-23 13:59:48 +01:00
Wolfgang Bumiller
1bb53e8403 bump perlmod-macro to 0.3.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-22 14:18:26 +01:00
Wolfgang Bumiller
f2fb3f9604 check in control files
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-22 14:18:26 +01:00
Wolfgang Bumiller
740eda0643 adjust path for DynaLoader
We usually have multiple packages but only a single library,
so rather than making package look in subdirectories named
after them, just look in the toplevel `auto/` directory.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-22 14:12:25 +01:00
Wolfgang Bumiller
a3361698b3 bump perlmod to 0.4.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-16 12:38:16 +01:00
Wolfgang Bumiller
5504cc2fb5 fix refcount issue in Hash::insert_by_value
The HV takes ownership of the value!

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-16 12:37:26 +01:00
Wolfgang Bumiller
53ad5e5fb6 bump perlmod to 0.4.0-1
to bump the macro dependency by a major version

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-16 10:44:54 +01:00
Wolfgang Bumiller
e95a2c0a23 add test.pl file for a usage example of perlmod-test
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-16 10:42:10 +01:00
Wolfgang Bumiller
d870bc9bb3 bump perlmod-macro to 0.3.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-16 10:41:52 +01:00
Wolfgang Bumiller
705d6989ad macro: support tuple return types in functions
These are now *list* return types in perl.
However, currently there is no support for 'wantarray' or
lists of dynamic length.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-16 10:39:37 +01:00
Wolfgang Bumiller
03644975f4 use try_from_ref in the example
to show how it's used

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-16 10:39:02 +01:00
Wolfgang Bumiller
fee0609d38 bump perlmod to 0.3.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-15 16:06:18 +01:00