include buildid in LOCPATH
authorJoey Hess <joeyh@joeyh.name>
Mon, 5 Oct 2020 17:53:43 +0000 (13:53 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 5 Oct 2020 18:04:49 +0000 (14:04 -0400)
commitf0ec725234463a7165a4339c8a65486a9b04ab3a
treeba953d1053c3de1b4f1ce9ca945a80fe210b7eba
parentcb487e741767c6d59f9b9e4cc7f40f9c6d92f942
include buildid in LOCPATH

This avoids the possibility that the bundle could be updated in place,
leading to LOCPATH existing but containing locales for the old version,
which needed to be tested for with code that was not race-free.

LOCPATH/buildid is still written and checked when cleaning up stale caches.
That is not actually necessary, except old versions of the standalone
bundle expect to see it, and this prevents them cleaning up the locale
cache of a new version. And still checking it prevents the new version
cleaning up the locale cache of the old version while the old version is
still in use.

Added explicit tests before creating LOCPATH and the base and buildid files.

The buildid file no longer needs to be updated every time, because it's
stable for the given LOCPATH directory.

And the base file actually did not need to be updated every time,
because the LOCPATH is derived from base, so if the bundle is moved
elsewhere, a different LOCPATH will be used.

Transitioning to this will mean that two git-annex builds that otherwise
have the same buildid -- the same git-annex md5sum -- will use different
LOCPATH values, but that's handled fine by the cache cleanup code, so at
most it will mean one extra generation of the locale files.
doc/bugs/standalone_runshell_can_race_and_fail_to_remove___96____126____47__.cache__47__git-annex__47__locales__47____96___dirs/comment_4_5c2c6003b45d78b9e0bee95f5a12c48c._comment [new file with mode: 0644]
standalone/linux/skel/runshell