find-package (FindByPath): use CanonPath before contens_index search

I see that this can add SOME problems if e.g. /usr is relocated
to /storage/usr in the build environment.  This is because CanonPath
follows symlinks for dirname.

But I argue that it is safe for hasher, and it fixes some problems
with contents_index search which is used only in the hasher (by default).

I also argue that, even if /usr is relocated, this is not going to be a BIG
problem, because it is not going to produce unmet dependencies (well, most
of the time).  This is because 'rpm -qf' will work as expected in that screwed
build environment.
This commit is contained in:
Alexey Tourbin 2007-08-27 21:21:55 +04:00
parent 5a5bd82133
commit 650b0fc0c1

View File

@ -64,6 +64,9 @@ FindByPath()
return
fi
# XXX Cleanup pathname.
rep=$(CanonPath "$rep")
# Always try package binary index.
local idx_bin="${RPM_PKG_CONTENTS_INDEX_BIN-}" try_idx_bin=1
[ -n "$idx_bin" ] && [ -s "$idx_bin" ] && [ -r "$idx_bin" ] || try_idx_bin=