<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<font face="monospace">Okay, so I've made some progress but appear
to be stalled a bit.<br>
<br>
When instructed to install a module, the command line installmgr
doesn't seem to call InstallMgr::refreshRemoteSource() at all, and
somehow the call to do the install succeeds. Yet my example below
fails if I don't call to refresh the source.<br>
<br>
However, if I DO call refreshRemoteSource(), I will end up
downloading EVERY module, despite only specifying one:<br>
<br>
int myInstallModule(const char* modname) {<br>
sword::InstallSource is("FTP");<br>
is.source = "ftp.crosswire.org";<br>
is.directory = "/pub/sword/raw";<br>
<br>
sword::SWBuf installpath = getenv("HOME");<br>
installpath += "/.sword/";<br>
sword::InstallMgr* im = new sword::InstallMgr(installpath);<br>
im->setUserDisclaimerConfirmed(true);<br>
<br>
// XXX -- the call below appears to be required<br>
int refresh = im->refreshRemoteSource(&is);<br>
if (refresh) {<br>
printf("Refresh call failed, error: %d\n", refresh);<br>
exit(0);<br>
}<br>
<br>
// XXX -- this installs EVERY module, not just what is passed
as an argument<br>
return im->installModule(&swrd, 0, modname, &is);<br>
}<br>
<br>
Someone have an idea what I might be missing?<br>
<br>
</font>
<pre class="moz-signature" cols="72">Thanks,
- Paul M</pre>
<div class="moz-cite-prefix">On 12/8/22 16:18, Greg Hellings wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAHxvOV+1PKM6nkGm9xcT8a188+SrrK9hZVVOeUfKPL71qf=7ag@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">I believe you will need to refresh that source
before you call the install method. It's trying to look up the
config file for that module and isn't finding it. Those get
downloaded and cached by the Installmgr class when it refreshes
a source.
<div dir="auto"><br>
</div>
<div dir="auto">--Greg</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Dec 8, 2022, 14:51 P
Mosier <<a href="mailto:paladin1@sdf.org"
moz-do-not-send="true" class="moz-txt-link-freetext">paladin1@sdf.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I am trying to figure out what the appropriate steps to take
are for <br>
programmatically installing a module through FTP. Looking
through the <br>
backend codebase, it seems like there are some configuration
settings <br>
that have to be initialized in SWMgr order for
InstallMgr::installModule <br>
to work. However, tracking this down has eluded me as
InstallMgr never <br>
seems to be set up and called the same way twice.<br>
<br>
I have this as a simple example:<br>
<br>
sword::SWMgr swrd;<br>
sword::InstallSource is("FTP");<br>
is.source = "<a href="http://ftp.crosswire.org"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">ftp.crosswire.org</a>";<br>
is.directory = "/pub/sword";<br>
<br>
sword::InstallMgr im;<br>
im.installModule(&swrd, 0, "KJVA", &is);<br>
<br>
The call to installModule segfaults at this line:<br>
<br>
module = mgr.config->getSections().find(modName);<br>
<br>
I recognize it might be related to my own environment. This
is the <br>
entire content of my /etc/sword:<br>
[Install]<br>
DataPath=/usr/share/sword/<br>
<br>
Does someone have an idea for what I'm missing, or an example
to direct <br>
me to so I can get a better handle on this area of code?<br>
<br>
Thanks,<br>
- Paul M<br>
<br>
_______________________________________________<br>
sword-devel mailing list: <a
href="mailto:sword-devel@crosswire.org" target="_blank"
rel="noreferrer" moz-do-not-send="true"
class="moz-txt-link-freetext">sword-devel@crosswire.org</a><br>
<a href="http://crosswire.org/mailman/listinfo/sword-devel"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">http://crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://crosswire.org/mailman/listinfo/sword-devel">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page
</pre>
</blockquote>
<br>
</body>
</html>