[sword-devel] Determining the repository a SWModule belongs to
contact at tklein.info
contact at tklein.info
Fri Sep 27 13:58:20 MST 2019
Ok. In this case (if there are potentially multiple source repo's for
one given module) could a list be returned?
This is quite common for 1:n relationships in databases as well ...
Best regards,
Tobias
Quoting Greg Hellings <greg.hellings at gmail.com>:
> Currently the engine does not intentionally preserve any information about
> where a module comes from. This is why, for a single installer, it cannot
> handle having parallel installs of the same module from different sources
> (e.g. you can't have both CrossWire KJV and your own homegrown KJV in
> parallel without giving your own a different module name).
>
> There's nothing stopping an application from creating different local
> repos, one for each upstream, and then combining the two using its own
> logic. However, this isn't something the library currently supports. The
> fact that you can reverse engineer its source, at present, is only because
> none of the main repositories duplicates module identifiers from any other
> repositories. However there is nothing, technically speaking, that prevents
> this. Thus, module pedigree is not, necessarily, a deterministic thing.
>
> --Greg
>
> On Fri, Sep 27, 2019 at 2:28 PM <contact at tklein.info> wrote:
>
>> Hi,
>>
>> Using the SWORD API, is there an easy way to determine the
>> remote/source repository a module is coming from?
>>
>> I haven't found anything in the SWModule class or anywhere else.
>>
>> This would be my approach without any API method:
>> 1) Get the config entry "PrefixPath" using
>> SWModule::getConfigEntry("PrefixPath"). This returns something like
>> this:
>> /home/tobi/.sword/installMgr/20151110161300/
>> 2) The last part of the path above is the "id" of the source repository
>> 3) Looking up ~/.sword/installMgr/masterRepoList.conf I can find the
>> mapping between the repo id and the actual repository name from a line
>> like this one: 20151110161300=FTPSource=eBible.org|ftp.ebible.org|/sword
>>
>> Would it make sense to provide a method in the SWModule or InstallMgr
>> class to easily get this information?
>> This would be useful meta information when showing an about dialog for
>> a module and I also see other use cases.
>>
>> Best regards,
>> Tobias
>>
>>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>>
More information about the sword-devel
mailing list