[sword-devel] OSIS Bible Name guidelines ?

Troy A. Griffitts scribe at crosswire.org
Tue Dec 23 13:43:18 MST 2008

Dear Eeli and Chris,

I believe you are both talking about different things.

*** Multiple Remote Installation Repositories (class InstallMgr)
If a module is installed from one Remote Repository with a name KJV, and 
from another repository a module named KJV is installed, on this second 
install InstallMgr will remove the previous version and install this 
second one.

*** Multiple Local Repositories (class SWMgr)
If SWMgr find a module with the same name at different install locations 
on the local machine (specified with AugementPath, or automatically 
augmented to the global install from $HOME/.sword) then the frontend 
developer has 2 option.  Here is the comment from the code on SWMgr:

  * Adds books from a new path to the library
  * @param path the path in which to search for books
  * @param multiMod whether or not to keep multiple copies of the same
  *        book if found in different paths
  *        default - false, uses last found version of the book
virtual void augmentModules(const char *path, bool multiMod = false);

Does this clear things up?


Eeli Kaikkonen wrote:
> Chris Little wrote:
>> I have never heard of the module renaming facility that Eeli suggests, 
>> and it is not part of the Sword library itself. When InstallMgr 
>> discovers modules with the same ID in multiple repositories, it 
>> assumes they refer to the same module (though possibly different 
>> versions of it). By this facility, we publish one version via the 
>> public repository while publishing a beta version (with an incremented 
>> version number) from the beta repository. When testers download the 
>> beta version, it overwrites the publicly released version, which can 
>> only be regained by uninstalling and re-installing from the public 
>> repository.
> What's this then? The result is seen at least in BibleTime, and BT code 
> does nothing for it. It's from SWMgr::augmentModules():
> // fix config's Section names to rename modules which are available more 
> than once
>                        // find out which sections are in both config 
> objects
>                        // inserting all configs first is not good 
> because that overwrites old keys and new modules would share the same 
> config
>                        for (SectionMap::iterator it = 
> config->Sections.begin(); it != config->Sections.end(); ++it) {
>                                if (saveConfig->Sections.find( 
> (*it).first ) != saveConfig->Sections.end()) { //if the new section is 
> already present rename it
>                                        ConfigEntMap entMap((*it).second);
>                                        SWBuf name;
>                                        int i = 1;
>                                        do { //module name already used?
> name.setFormatted("%s_%d", (*it).first.c_str(), i);
>                                                i++;
>                                        } while 
> (config->Sections.find(name) != config->Sections.end());
> config->Sections.insert(SectionMap::value_type(name, entMap) );
>                                        config->Sections.erase(it);
>                                }
>                        }
> --Eeli Kaikkonen
> _______________________________________________
> 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