package_daemon inspects copied hpkg files too early
|Reported by:||jua||Owned by:||bonefish|
When an HPKG file is copied to the package dir manually, it sometimes fails to activate. This only happens when copying, and only if the HPKG is sufficiently large and not in the block cache yet (so that the copy isn't too fast).
It seems that package_daemon inspects the hpkg file already while it is still being copied, and thus rejects the incomplete file as invalid (thanks to Rene for the tip).
For testing, I have a really large (800MB) HPKG. If I copy it into the package dir after a fresh reboot, the problem always occurs. But if I first copy the HPKG to somewhere else on the boot drive and then move it into the package dir, it works fine.
In the failure case (file was copied), syslog shows the following:
KERN: package_daemon [37661302: 657] Volume::_PackagesEntryCreated("TeXLive.hpkg") KERN: package_daemon [37661763: 657] failed to init package for file "TeXLive.hpkg"
This syslog output already appears before Tracker has finished copying the file, hence the assumption of what the problem is.