[PATCH 0/4] setup.exe
Jon TURNEY
jon.turney@dronecode.org.uk
Fri Feb 1 15:05:00 GMT 2013
On 25/01/2013 22:11, Achim Gratz wrote:
> From a246270621b2b4fbd476aa386fc217ed14f3fe10 Mon Sep 17 00:00:00 2001
> From: Achim Gratz
> Date: Fri, 25 Jan 2013 12:12:41 +0100
> Subject: [PATCH 3/4] Allow delete and reinstall from CLI, re-implement install from CLI
> - bool bCommandLineAddedPackages = db.addCommandLinePackages();
>
> - // in unattended mode, if packages were selected on the command line using the --packages
> - // or --categories options, just install those selected packages and don't upgrade all others
> - // (we always install all packages in the Base or Misc categories; packages selected on the
> - // command line are added to the Base category)
> - if ((unattended_mode == unattended) && (bCommandLineAddedPackages))
> - {
> - for (packagedb::packagecollection::iterator i = db.packages.begin ();
> - i != db.packages.end (); ++i)
> - {
> - packagemeta & pkg = *(i->second);
> - if (pkg.installed)
> - {
> - pkg.desired = pkg.installed;
> - }
> - else if (pkg.categories.find ("Base") != pkg.categories.end ()
> - || pkg.categories.find ("Misc") != pkg.categories.end ())
> - {
> - pkg.desired = pkg.trustp(TRUST_CURR);
> - pkg.desired.pick(TRUE, &pkg);
> - }
> - }
> - }
> - else
> + for (packagedb::packagecollection::iterator i = db.packages.begin ();
> + i != db.packages.end (); ++i)
> {
> - db.defaultTrust (TRUST_CURR);
> + packagemeta & pkg = *(i->second);
> + bool wanted = pkg.isManuallyWanted();
> + bool deleted = pkg.isManuallyDeleted();
> + bool current = pkg.curr || CleanOrphansOption;
> + bool upgrade = wanted || UpgradeAlsoOption || !PackageCategoryOptions;
> + bool install = wanted && !deleted && !pkg.installed;
> + bool reinstall = wanted && deleted;
> + bool uninstall = !wanted && deleted;
> + if (install)
> + pkg.set_action( packagemeta::Install_action, pkg.curr );
> + else if (reinstall)
> + pkg.set_action( packagemeta::Reinstall_action, pkg.curr );
> + else if (uninstall)
> + pkg.set_action( packagemeta::Uninstall_action, packageversion() );
> + else
> + pkg.set_action( packagemeta::Default_action, ((upgrade && current) ? pkg.curr : pkg.installed) );
> }
It looks to me that this might be removing the code which causes the Base
category to get installed by default on the first install. Have you tested
that still happens?
>
> ClearBusy ();
> diff --git a/setup/choose.h b/setup/choose.h
> index b24aefc..86e9dc6 100755
> --- a/setup/choose.h
> +++ b/setup/choose.h
> @@ -21,6 +21,7 @@
> #include "package_meta.h"
> #include "PickView.h"
>
> +extern bool PackageCategoryOptions;
I think this could have a name which better matches what it does
(areManualPackageSelections?)
Since this is a variable name, not a type name, maybe it should start with a
lower case letter?
More information about the Cygwin-apps
mailing list