[sword-devel] More installmgr woes... (need for export SWORD_PATH=~/.sword )

Matthew Talbert ransom1982 at gmail.com
Thu Sep 3 11:59:15 MST 2009


>
>> One more thing. If the last step in building sword is "make config", then
>> there is no reason to set SWORD_PATH at all. (even if it isn't the last
>> step, there's no reason to, I think). SWORD will automatically look in
>> ~/.sword and whatever paths are set in /etc/sword.conf without needing
>> SWORD_PATH set.
>
> That is a nice theory, but I can't seem to make it work in practice to get
> SWORD modules installed under ~/.sword using installmgr.
>
> With SWORD_PATH unset, and /etc/sword.conf containing the default
> /usr/share/sword/ path, apparently installmgr finds that, and decides to use
> it for new module installs -- but fails to check whether it is writeable.
>  So even if you have a writeable ~/.sword/ containing mods.d/ installmgr
> (run as a normal non-root user) *still* tries to install into
> /usr/share/sword/ and therefore (silently!) fails.
>
> I really think installmgr (and probably SWORD as a whole) could and should
> do more checking of "writable-ness", as well as better error checking
> overall (so it would (a) not select a directory it cannot write to for write
> operations, and (b) if it did somehow accidentally do that, perhaps because
> no other workable choices exist in its list of places to try, then it would
> fail the actual module install attempt with a sane error message.
>

Oh, yes, you're right. Most of my response was correct as well, except
that I forgot about SWORD always picking the DataPath from sword.conf
to install to, regardless of whether it had write permissions. Note
that setting SWORD_PATH is *not* the correct way to install into
~/.sword (there isn't a correct way with installmgr, I guess).
SWORD_PATH does more things than just that, for instance, locales are
loaded from SWORD_PATH/locales.d, so if you don't have them there,
locales won't work. Perhaps setting SWORD_PATH doesn't matter so much
to installmgr, but I think it should be possible to simply specify the
directory you want to install to.

For Xiphos, we support installing into ~/.sword if DataPath isn't
writable. We do this by checking it ourselves, then creating a new
SWMgr to point to the desired install directory and containing only
the desired directory. This is not a good method, imo. First of all,
SWORD should check to see if the location is writable *before* it
tries to install (and I agree with you Jonathan, this isn't the only
place this check is needed). Secondly, it would be really nice to have
a method to install to a certain directory so we don't have to create
a special SWMgr for the purpose. Creating SWMgr's is relatively
expensive (can take several seconds depending on number of modules in
a directory) and should be avoided.

Matthew



More information about the sword-devel mailing list