On Jan 27 22:14, Corinna Vinschen wrote:
> On Jan 27 22:04, Achim Gratz wrote:
> > Corinna Vinschen writes:
> > > Or today.  Can you try this patch?  Most of it is a bit of reformatting,
> > > the importnat part is the last set_action call.
> > 
> > I think I'll get this wedged in sometime tomorrow.
> 
> Thanks.  I think I have a better one, though.  The CleanOrphansOption
> in cinjunction of not having a "curr" package should immediately trigger
> the packagemeta::Uninstall_action:
> 
> Index: choose.cc
> ===================================================================
> RCS file: /cvs/cygwin-apps/setup/choose.cc,v
> retrieving revision 2.169
> diff -u -p -r2.169 choose.cc
> --- choose.cc 26 Jan 2015 21:05:45 -0000      2.169
> +++ choose.cc 27 Jan 2015 21:12:01 -0000
> @@ -252,19 +252,22 @@ ChooserPage::OnInit ()
>        bool deleted   = pkg.isManuallyDeleted();
>        bool basemisc  = (pkg.categories.find ("Base") != pkg.categories.end ()
>                    || pkg.categories.find ("Misc") != pkg.categories.end ());
> -      bool current   = pkg.curr || CleanOrphansOption;
> -      bool upgrade   =  wanted  || (!pkg.installed && basemisc) || 
> UpgradeAlsoOption || !hasManualSelections;
> +      bool upgrade   =  wanted  || (!pkg.installed && basemisc)
> +                     || UpgradeAlsoOption || !hasManualSelections;
>        bool install   =   wanted  && !deleted && !pkg.installed;
>        bool reinstall =  (wanted  || basemisc ) && deleted;
> -      bool uninstall = !(wanted  || basemisc ) && deleted;
> +      bool uninstall = (!(wanted  || basemisc ) && deleted)
> +                    || (!pkg.curr && CleanOrphansOption);
>        if (install)
> -     pkg.set_action( packagemeta::Install_action, pkg.curr );
> +     pkg.set_action (packagemeta::Install_action, pkg.curr);
>        else if (reinstall)
> -     pkg.set_action( packagemeta::Reinstall_action, pkg.curr );
> +     pkg.set_action (packagemeta::Reinstall_action, pkg.curr);
>        else if (uninstall)
> -     pkg.set_action( packagemeta::Uninstall_action, packageversion() );
> +     pkg.set_action (packagemeta::Uninstall_action, packageversion ());
>        else
> -     pkg.set_action( packagemeta::Default_action, ((upgrade && current) ? 
> pkg.trustp (true,  TRUST_UNKNOWN) : pkg.installed) );
> +     pkg.set_action (packagemeta::Default_action,
> +                     upgrade ? pkg.trustp (true,  TRUST_UNKNOWN)
> +                             : pkg.installed);
>      }
>  
>    ClearBusy ();

This test release has another puzzeling problem I have to figure out
yet.  For some reason, it's impossible to downgrade packages at all.
Worse, if you try that, it will remove the package.  That's a rather
weird side effect of my changes, which were only supposed to change
the selection method, not the underlying workings.  Oh well.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpkSqZBL81eQ.pgp
Description: PGP signature

Reply via email to