Commit Graph

8 Commits

Author SHA1 Message Date
Giuseppe Scrivano 06a03bd48f
dump: use the sanitized path for root check
otherwise if the root is stored as "./", it ends up adding the root
node twice causing mkcomposefs to fail.

Closes: https://github.com/containers/storage/issues/1941

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-04 22:12:18 +02:00
Giuseppe Scrivano 12f34d8f6d
dump: replace unicode package with custom functions
To avoid a mismatch with the C composefs library that uses isgraph()
and isprint(), do not use the unicode package but provide the expected
definition for these functions.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-04 16:17:01 +02:00
Giuseppe Scrivano 6b1c044dc1
composefs: add parent directory if missing
it solves this error with mkcomposefs when the TOC doesn't specify the
parent directory for an entry:

Error: committing the finished image: failed to put layer using a partial pull: failed to convert json to erofs: exit status 1: mkcomposefs: Parent directory missing for /usr/share/locale/ca/LC_MESSAGES/libc.mo

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-05-28 11:52:30 +02:00
Giuseppe Scrivano 839beda40e
chunked: fix escape of space
the code was copied from the composefs C version:

	if (noescape_space)
		hex_escape = !isprint(c);
	else
		hex_escape = !isgraph(c);

but unicode.IsGraphic() seems to behave differently and includes the
space:

isgraph(' ') -> 0
unicode.IsGraphic(' ') -> true

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-04-19 21:43:10 +02:00
Giuseppe Scrivano c644d69f06
dump: ignore link counter for symlinks
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-19 18:52:23 +01:00
Giuseppe Scrivano 77191602c1
dump: use filepath to cleanup the file path
the filepath.Clean function is more robust than the previous
implementation where we ended up to not recognize "/." as the root.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-01-19 18:50:42 +01:00
Giuseppe Scrivano af91fe3c97
composefs: trim / from paths
it solves the following error when pulling the alpine image:

mkcomposefs: Parent directory missing for /bin/

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-12-11 15:06:41 +01:00
Giuseppe Scrivano d05cf57977
chunked: dump in 'composefs-info' dump format
provide a way to format the TOC in the same format that is generated
by composefs-info, this is a preparation patch for the next commit.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-16 15:44:22 +02:00