5
0
mirror of git://git.proxmox.com/git/pxar.git synced 2024-12-22 21:33:50 +03:00
Commit Graph

17 Commits

Author SHA1 Message Date
Christian Ebner
3ee98e1072 decoder/accessor: allow for split input stream variant
When a pxar archive was encoded using the split stream output
variant, access to the payload of regular files has to be redirected
to the corresponding dedicated input.

Allow to pass the split input variant to the decoder and accessor
instances to handle the split streams accordingly and decode split
stream archives.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-06-05 09:24:22 +02:00
Christian Ebner
48431e5e38 encoder: move to stack based state tracking
In preparation for the proxmox-backup-client look-ahead caching,
where a passing around of different encoder instances with internal
references is not feasible.

Instead of creating a new encoder instance for each directory level
and keeping references to the parent state, use an internal stack.
Adds additional helper functions to solve borrow issues, when both
the state and writers have to be accessed by a mutable reference.

This is a breaking change in the pxar library API.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-05-23 14:39:11 +02:00
Wolfgang Bumiller
85f5a177ef test socket/fifo entry kinds in accessor
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-27 15:18:20 +02:00
Wolfgang Bumiller
71194b54e4 ditch anyhow crate in examples/tests
mostly to shutup our current buildbot tests

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-05-17 11:46:53 +02:00
Wolfgang Bumiller
180186c567 explicitly pad StatxTimestamp with zeros
otherwise we can have random data in there

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-12 10:34:55 +01:00
Wolfgang Bumiller
318462ea3d fix decode_entry on special files
When using the random accessor to access FIFOs or sockets,
the ranged reader limits the data to only that entry, and
the `decode_entry` will never see a `PAYLOAD` or
`GOODBYE_TABLE` item to finish the entry.
Instead, it'll reach EOF and we need to handle this.
The accessor now tells the decoder to expect EOF as a valid
condition for ending the entry.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-15 11:34:15 +01:00
Wolfgang Bumiller
2ea8aff22d rename Entry to Stat, add Metadata::builder_from_stat
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-25 12:25:07 +02:00
Wolfgang Bumiller
3a7b42d0ef add entry v1 compatiblity test
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-07-29 07:39:58 +02:00
Wolfgang Bumiller
c81b2e4e21 add some random access tests with hardlinks
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-26 14:12:57 +02:00
Wolfgang Bumiller
807a4fd6ba tests: add some ACLs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-26 13:05:22 +02:00
Wolfgang Bumiller
1feb04d7b8 tests: cleanup warnings
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-26 11:20:45 +02:00
Wolfgang Bumiller
650070b0e6 tests: add fifos and sockets
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-26 11:12:00 +02:00
Wolfgang Bumiller
bb74cbfa21 document test helpers a bit
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-26 10:08:45 +02:00
Wolfgang Bumiller
ea8ff6368b remove custom PartialEq impl
Hardlink targets are now compared, but only the parts we
also actually decode, not the chosen names in
`Entry.link_key`.

This way we can just `==` compare entries as long as the
files we use for hardlinking use their canonical path as
key.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-26 09:57:35 +02:00
Wolfgang Bumiller
1829ef0dd0 some initial sequential encoder/decoder testing
Tests basic files, hardlinks, symlinks. No special metadata
yet.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-26 09:54:00 +02:00
Wolfgang Bumiller
8fe6038295 formatting fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-25 13:56:48 +02:00
Wolfgang Bumiller
139932923c start tests directory
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-25 13:51:22 +02:00