This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: Re[2]: new branch tagged for setup
----- Original Message -----
From: "Pavel Tsekov" <ptsekov@syntrex.com>
To: "Robert Collins" <robert.collins@syncretize.net>
> It seems to be gone :)
Yes, ermm, cough, cough. I had a bug in my new code, which I was still
tracking down here. It's fixed now, in CVS, and a new snapshot is on the
way.
> Since the code has changed quite a bit since the previous snapshot I
> had to add some code to get the contents of the dependencies - please
> just take a look to see if this is the proper code to extract the
> dependencies:
>
> vector <vector <PackageSpecification *> *> *ppp;
> if ((ppp = pkg.desired.depends ()) != 0)
pkg.desired() is never NULL. It's guaranteed to point at a valid vector.
> {
> int sz = ppp->size ();
> for (int i = 0; i < sz; i++)
> {
> for (unsigned int j = 0; j < (*ppp)[i]->size (); j++)
> {
> String sss;
> sss = (*((*ppp)[i]))[j]->packageName();
> continue;
> }
> }
> }
You might find the following code a little easier (extracted from
IniDBBuilderPackage.cc)
Note the use of iterators, and that this code dumps version information in
the specification as well.
log (LOG_BABBLE) << "Depends:"
for (vector<vector <PackageSpecification *> *>::const_iterator iAnd =
pkg.desired()->begin(); iAnd != pkg.desired()->end(); ++iAnd)
{
for (vector<PackageSpecification *>::const_iterator i=
(*iAnd)->begin();
i != (*iAnd)->end(); ++i)
log(LOG_BABBLE) << **i << " |" << endLog;
log (LOG_BABBLE) << "end of OR list," << endLog;
}
I plan on making this much more readable and then making an operator String
for vector<vector <PackageSpecification *> *> to allow easy dumping.
Rob