[RFC] 1.7 Packaging: Obsolete packages
Corinna Vinschen
corinna-cygwin@cygwin.com
Fri Aug 22 10:11:00 GMT 2008
On Aug 22 11:24, Corinna Vinschen wrote:
> On Aug 22 01:52, Brian Dessent wrote:
> > As far as the actual freeing of memory, I think it would go something
> > like
> >
> > for (vector <packagemeta *>::iterator i = packages.begin ();
> > i != packages.end (); ++i)
> > {
> > delete *i;
> > }
> > packages.clear();
> >
> > (And likewise for sourcePackages.)
>
> If that works, it should be fairly simple. Since the installed.db is
> the first time read when pressing the "Next" button in the root dir
> dialog, it might be best to place the cleanup above in the same
> place, right before initializing the packagedb.
Too simple, apparently. I created a new static method packagedb::clear()
which I call in RootPage::OnNext():
void
packagedb::clear ()
{
for (vector <packagemeta *>::iterator i = packages.begin ();
i != packages.end (); ++i)
delete *i;
packages.clear ();
for (vector <packagemeta *>::iterator i = sourcePackages.begin ();
i != sourcePackages.end (); ++i)
{
/* If you don't clear the categories, deleting the source packages
SEGVs. Are the categories lists shared with the binary packagemeta? */
(*i)->categories.clear ();
delete *i;
}
sourcePackages.clear ();
installeddbread = 0;
}
For testing I started setup and just clicked "Next" up to the package
selection dialog. This picked up all information from a former 1.5
install and there's a list of packages to update.
Then I clicked "Back" up to the root dir dialog, changed the root dir to
a non-existing "Cygwin-1.7" and clicked "Next" again up to the package
selection. The result was that Setup now thinks it has nothing to
install/update. Nothing at all.
Something's obviously missing...
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
More information about the Cygwin-apps
mailing list