Open dralley opened 4 years ago
The code in ext (e.g. the XML parser) works around this by replacing an empty dir with '/':
if (!did)
did = repodata_str2dir(data, "/", 1);
The limitation is pretty artificial, though. It's not hard to remove it, so that's what we're going to do in the future.
This assertion: https://github.com/openSUSE/libsolv/blob/ac194e6f024420c0be72c49def6a80adc33dd4bf/src/repodata.c#L2929
Is problematic in the case of SRPMs, which frequently have files without directory. This means that
dir
is an empty string, which is converted toId
0, which fails the assertion. Therefore parsing filelist data for a repository containing SRPMs or RPMs mixed with SRPMs will hit assertion failures unless action is taken externally to skip past the SRPM filelists.See: standard RPMs have directory, SRPMs do not.
This is the Python code being used to process file
The following patch successfully works around the problem and is good enough for us, but I'm curious whether there is a better way to solve it or if this is an unintentional oversight that should be fixed upstream.
I have no idea if the methods for loading libsolv directly from repository XML are affected by this since we don't use them.