Well, it appears OPD is not usable without a connection to the Internet. This is not apparent from the opd command line or GUI, e.g., the "Use these repositories EXCLUSIVELY" does not function in a useful manner as the main repository is *always* required.
The immediate problem, always trying to connect to the master OPD
repository, appears to be worked-around by commenting out
read_repository_listing();
But, that requires an additional line to init both $package_filename and
$repository_listing->{files}->{package_listing}. The actual solution in
the attached patch was to add a "--nomaster" option to opd to allow for
user-level control of Internet access and to initialize both variables
unless they are already defined.
Having done that, what about the opd GUI? This required an ugly hack to
make the "exclusive" checkbox use the new "--nomaster" option. It's
ugly 'cause the GUI is a little knotty, and the initial probe of the
master ODP site must either time-out or be cancelled before the
repositories can then be added and the "exclusive" checkbox checked.
So, I can now query an arbitrary repository w/o Internet access, but
alas, the "Download Selected Packages" button caused an immediate
termination of the downloader.
This was due to an improper oscar_package.xml file; apparently
OpderDownloadPackage.pm wasn't doing sufficient data checking and again
the need to check the master OPD repository. Once I added support for
the spiffy new "--nomaster" option and corrected my lousy XML, I noticed
a silly typo in OpderDownloadPackage.pm, which is also fixed in the
patch.
Finally, with the attached patch, the opd GUI is now able function
without Internet access. It's a hack, but it works.
Sadly, none of this enables a proper file URI to work, e.g.,
file:///var/www/html/OPD/oscar_packages.xml
that is, I don't even get a listing of available files. Note, this URI
correctly works in Mozilla or curl. I also tried (incorrect) prefixes
like "file://" and "file:////" (the latter still works in Mozilla) --
they too failed in the downloader GUI.
So, the attached patch allows opd and the opd GUI to function in a more
useful manner, where organizations can set up their own web-based
servers without need for an Internet connection. The attached patch
does *not* make the GUI more robust -- it still fails in the face of
incorrect XML.
--
David N. Lombard
My comments represent my opinions, not those of Intel Corporation.
oscar-opd-3.0.patch
Description: oscar-opd-3.0.patch
