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>
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>
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>
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>
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>
it solves the following error when pulling the alpine image:
mkcomposefs: Parent directory missing for /bin/
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
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>