Turns out the lookaside cache is not as clean as I expected.
Specifically, it contains some files where we'd expect directories, for
example:
/srv/cache/lookaside/pkgs/GFS-kernel/@13013.1e77f453ba1c86cd7616087d0643bbd8e
/srv/cache/lookaside/pkgs/openswan/tmpLRV5Gn5556cb2fcea6ba862ce14e1debf98b6d
This commit makes the script print an error instead of crashing on an
OSError in such a case.
We are migrating from the following path scheme:
/%(srpmname)s/%(filename)s/%(hash)s/%(filename)s
To:
/%(srpmname)s/%(filename)s/%(hashtype)s/%(hash)s/%(filename)s
As a result, we need to hardlink all the files existing under the old
path to their new path.
This script does just that.
Given that it should only ever be run once anyway, it is added as a
file to the distgit role, but not set to be installed anywhere.