Comment 2 for bug 1327426

Revision history for this message
Michi Henning (michihenning) wrote :

Because we have aggregating scopes too, it seems that we really need three (not two) locations for the cache directory, so aggregating scopes have a place to drop their data files too.

How about using $XDG_DATA_HOME/unity-scopes/aggregator/<scope_id>? Would that be OK?

There is no way for us in the run time to find out whether a scope is a filesystem scope, network scope, or aggregator scope.
This raises the question of how to set the cache directory correctly for the scope to read.

Suggestion: the scope installation is responsible for creating the scope's cache directory. In the run time, I go and try and find the following:

$XDG_DATA_HOME/unity-scopes/aggregator/<scope_id>
$XDG_DATA_HOME/unity-scopes/leaf-net/<scope_id>
$XDG_DATA_HOME/unity-scopes/leaf-fs/<scope_id>

If I find that exactly one of these three is present AND has permissions 700, I conclude that I have found the correct directory and set the cache directory in the run time accordingly. Otherwise, the cache directory is considered invalid and, when the scope tries to retrieve it from the run time, I throw an exception.

Please let me know whether that's an acceptable approach.