* package_version.h (packageversion::sources): Support multiple files in
a single package version.
* package_version.cc (_packageversion::accessible): Ditto.
(packageversion::source): Ditto.
+2002-07-15 Robert Collins <rbtcollins@hotmail.com>
+
+ * package_version.h (packageversion::sources): Support multiple files in
+ a single package version.
+ * package_version.cc (_packageversion::accessible): Ditto.
+ (packageversion::source): Ditto.
+
2002-07-15 Robert Collins <rbtcollins@hotmail.com>
* iniparse.y: Implement support for multiple source files for a source
packagesource *
packageversion::source ()
{
- return &data->source;
+ if (!data->sources.size())
+ data->sources.push_back (packagesource());
+ return &data->sources[0];
}
bool
bool
_packageversion::accessible() const
{
- return ((::source != IDC_SOURCE_CWD) && source.sites.size()) ||
- source.Cached ();
+ bool cached = true;
+ for (vector<packagesource>::const_iterator i = sources.begin();
+ i!=sources.end(); ++i)
+ if (!i->Cached ())
+ cached = false;
+ if (cached)
+ return true;
+ if (::source == IDC_SOURCE_CWD)
+ return false;
+ unsigned int retrievable = 0;
+ for (vector<packagesource>::const_iterator i = sources.begin();
+ i!=sources.end(); ++i)
+ if (i->sites.size() || i->Cached ())
+ retrievable += 1;
+ return retrievable == sources.size();
}
bool
void uninstall ();
/* invariant: never null */
- packagesource *source(); /* where can we source the files from */
+ packagesource *source(); /* where can we source the file from */
+ /* invariant: never null */
+ vector <packagesource> *sources(); /* expose the list of files.
+ source() returns the 'default' file
+ sources() allows managing multiple files
+ in a single package
+ */
bool accessible () const;
virtual void uninstall () = 0;
- packagesource source; /* where can we source the files from */
+ vector<packagesource> sources; /* where can we source the files from */
bool accessible () const;