indexer: Fix link resolution and hardlink handling for rpm

Unlike tar, cpio does not have a separate entry for each directory, so
the link resolution can't assume that directory entries exist for each
path component.

I also mistakenly assumed that cpio handled hardlinks similarly to tar,
but that's clearly not the case. libarchive does help a bit, but these
differences still suck.
This commit is contained in:
Yorhel 2017-01-18 13:07:26 +01:00
parent 608f79eb93
commit 8235fb28b8
4 changed files with 79 additions and 12 deletions

View file

@ -44,6 +44,9 @@ ln man3/helloworld.3 man6/hardlink.6
ln -s ../man3/helloworld.3 man1/symlinkbefore.1
ln -s ../man3/helloworld.3 man6/symlinkafter.6
# Technically badsymlink1.1 is bad, but we can't detect this because package
# archives don't necessarily list all directories. So it will have to be
# considered valid.
ln -s notadir/../../man3/helloworld.3 man1/badsymlink1.1
ln -s man3/helloworld.3 man1/badsymlink2.1
ln -s ../man3/helloworld.3/. man1/badsymlink3.1