]> cygwin.com Git - cygwin-apps/setup.git/log
cygwin-apps/setup.git
3 years agoTurn on __USE_MINGW_ANSI_STDIO everywhere
Jon Turney [Tue, 16 Mar 2021 15:55:59 +0000 (15:55 +0000)]
Turn on __USE_MINGW_ANSI_STDIO everywhere

__USE_MINGW_ANSI_STDIO is turned on by C++ STL headers, so we're getting
this define due to that in most places, except where we happen to
include stdio.h before them. archive_tar.cc happens to do that, and
wants ANSI stdio since da31ad35, so turn it on unconditionally.

It's also turned on for C++11 by MinGW headers >= 8.0.0, which Cygwin
already has, so this already works when building there, and we're going
to have to deal with any other problem that might cause elsewhere in the
source eventually anyhow.

This fixes building since da31ad35 on F33, which only has mingw-headers
7.0.0.

3 years agoUpdate displayed copyright to 2021
Jon Turney [Mon, 15 Mar 2021 17:40:51 +0000 (17:40 +0000)]
Update displayed copyright to 2021

3 years agoRevert "Remove pointless variable from do_download_site_info_thread()"
Jon Turney [Mon, 15 Mar 2021 17:38:13 +0000 (17:38 +0000)]
Revert "Remove pointless variable from do_download_site_info_thread()"

This reverts commit d15c11e7954977ee27712989b36e7102fc70639e.

This wasn't pointless, as it was causing the site list to be fetched
only once, even if we passed through that page more than once.

3 years agoMove package action strings to string table resource
Jon Turney [Sun, 6 Sep 2020 18:23:23 +0000 (19:23 +0100)]
Move package action strings to string table resource

Move package action strings to string table resource.
Switch ListView control to wide-char.

3 years agoAdd a UTF-8 string to wstring utility function.
Jon Turney [Wed, 16 Sep 2020 21:21:08 +0000 (22:21 +0100)]
Add a UTF-8 string to wstring utility function.

3 years agoRemove long-obsolete 'DISCARABLE' from resource file
Jon Turney [Sun, 6 Sep 2020 16:04:20 +0000 (17:04 +0100)]
Remove long-obsolete 'DISCARABLE' from resource file

The 'DISCARDABLE' memory attribute was only signficant on Win16.

3 years agoMove installation progress strings to string table resource
Jon Turney [Tue, 1 Sep 2020 00:43:53 +0000 (01:43 +0100)]
Move installation progress strings to string table resource

3 years agoAllow progress status to be set directly from a resource
Jon Turney [Fri, 4 Sep 2020 15:03:08 +0000 (16:03 +0100)]
Allow progress status to be set directly from a resource

Allow progress status to be set directly from a (localizable) resource.

3 years agoAdd LoadStringW to std::wstring utility function
Jon Turney [Fri, 4 Sep 2020 15:40:14 +0000 (16:40 +0100)]
Add LoadStringW to std::wstring utility function

3 years agoFix version used when not built from a git checkout
Jon Turney [Mon, 31 Aug 2020 19:34:24 +0000 (20:34 +0100)]
Fix version used when not built from a git checkout

3 years agoWarn about unknown package names
Jon Turney [Wed, 26 Aug 2020 17:24:18 +0000 (18:24 +0100)]
Warn about unknown package names

Warn about unknown package names used with '--packages' or
'--remove-packages' options.

3 years agoDowngrade logging of looking for AV service
Jon Turney [Wed, 26 Aug 2020 17:10:24 +0000 (18:10 +0100)]
Downgrade logging of looking for AV service

Downgrade to debug always emitted logging about trying to find AV
service.

3 years agoFix error with gcc 10.2 and -Werror=format
Jon Turney [Wed, 23 Sep 2020 21:43:30 +0000 (22:43 +0100)]
Fix error with gcc 10.2 and -Werror=format

archive_tar.cc: In member function ‘virtual const string archive_tar::next_file_name()’:
archive_tar.cc:161:37: error: 'I' flag used with ‘%o’ gnu_scanf format [-Werror=format=]
archive_tar.cc:161:37: error: format ‘%o’ expects argument of type ‘unsigned int*’, but argument 3 has type ‘size_t*’ {aka ‘long long unsigned int*’} [-Werror=format=]
archive_tar.cc:181:38: error: 'I' flag used with ‘%o’ gnu_scanf format [-Werror=format=]
archive_tar.cc:181:38: error: format ‘%o’ expects argument of type ‘unsigned int*’, but argument 3 has type ‘size_t*’ {aka ‘long long unsigned int*’} [-Werror=format=]

3 years agoPropagate the value of CYGWIN environment variable into scripts
Michael Wild [Thu, 27 Aug 2020 12:45:42 +0000 (14:45 +0200)]
Propagate the value of CYGWIN environment variable into scripts

Propagate the value of the CYGWIN environment variable into the
sanitized environment we use to run scripts.

Note: as it stands, this isn't always useful as the initial environment
isn't propagated when setup re-runs itself elevated.

3 years agoMigrate selected sites from http:// to https://
Jon Turney [Mon, 20 Jul 2020 14:30:44 +0000 (15:30 +0100)]
Migrate selected sites from http:// to https://

If a selected site URL saved from the last run starts with "http://",
and an identical URL except starting with "https://" is in the current
mirror list, migrate it from "http://" to "https://".

3 years agoFactor out site_list_insert in site.cc
Jon Turney [Tue, 21 Jul 2020 13:52:58 +0000 (14:52 +0100)]
Factor out site_list_insert in site.cc

Factor out site_list_insert in site.cc, and add comments to descibe what
what nutty thing this wacky code is doing, after we've expended the
mental effort to figure it out.

3 years agoRemove pointless variable from do_download_site_info_thread()
Jon Turney [Mon, 20 Jul 2020 16:35:47 +0000 (17:35 +0100)]
Remove pointless variable from do_download_site_info_thread()

4 years agoProperly record user_picked again release_2.905
Jon Turney [Sat, 27 Jun 2020 15:10:57 +0000 (16:10 +0100)]
Properly record user_picked again

Properly record user_picked again, which was broken by changes in 2.895

4 years agoReally parse build-depends: case-insensitively
Jon Turney [Fri, 5 Jun 2020 14:53:03 +0000 (15:53 +0100)]
Really parse build-depends: case-insensitively

4 years agoRefine splash page text
Jon Turney [Sun, 31 May 2020 14:41:04 +0000 (15:41 +0100)]
Refine splash page text

Make "you can run this again to add, remove or update packages" a
separate paragraph to increase the chances of it getting read.

4 years agoPosition logo relative to top when resizing splash page
Jon Turney [Sun, 31 May 2020 14:36:11 +0000 (15:36 +0100)]
Position logo relative to top when resizing splash page

4 years agoImprove how paired boolean options appear in help output
Jon Turney [Thu, 28 May 2020 14:34:08 +0000 (15:34 +0100)]
Improve how paired boolean options appear in help output

Include a prefix in the boolean option long name appearing in help
output (although we should probably pick the default, rather than first,
prefix)

4 years agoAdd dpiAware to manifest
Jon Turney [Wed, 27 May 2020 16:05:08 +0000 (17:05 +0100)]
Add dpiAware to manifest

4 years agoMake application manifest architecture generic
Jon Turney [Wed, 27 May 2020 16:04:51 +0000 (17:04 +0100)]
Make application manifest architecture generic

It was made architecture specific in 2258d2a1, but then made the same
again for both architectures in aa09dcbb.

4 years agoParse build-depends: case-insensitively
Jon Turney [Wed, 27 May 2020 15:40:26 +0000 (16:40 +0100)]
Parse build-depends: case-insensitively

4 years agoFix an allocation length error release_2.904
Jon Turney [Wed, 18 Mar 2020 22:04:47 +0000 (22:04 +0000)]
Fix an allocation length error

Allow for the terminating null.

4 years agoDisable old Cygwin setup signing key by default
Jon Turney [Tue, 17 Mar 2020 15:21:50 +0000 (15:21 +0000)]
Disable old Cygwin setup signing key by default

Add a new option '--enable-old-keys', for if you really need to install
from an old mirror for some reason.

'--disable-old-keys' is still accepted, but is the default now.

4 years agoImplement paired boolean options
Jon Turney [Tue, 17 Mar 2020 14:27:02 +0000 (14:27 +0000)]
Implement paired boolean options

Add some infrastructure for options which may appear with multiple
prefixes.

Add an implementation of paired boolean options like '--enable-foo' and
'--disable-foo', or '--bar' and '--no-bar'.

Add/fix tests

4 years agoRename Start Menu folder for 32-bit installs on WoW64
Jon Turney [Tue, 17 Mar 2020 13:54:16 +0000 (13:54 +0000)]
Rename Start Menu folder for 32-bit installs on WoW64

This is not totally straightforward: Since setup can install Cygwin with
either bitness (using the '--arch 32|64' option), we must do the right
thing if this is a 64-bit installer being used to install 32-bit Cygwin,
which will run under WoW, even if the installer isn't...

(Naming things like this makes things consistent with Cygwin-X, which
already names it's Start Menu folder 'Cygwin-X (32-bit)' on WoW64. It
also ensures that there aren't collisions between any setup created
shortcuts for 32-bit and 64-bits.)

The desktop icon is already named 'Cygwin Terminal' or 'Cygwin64
Terminal' so doesn't need attention.

Start menu links made in the 'Cygwin' folder by cygwin-doc, and possibly
other packages will also need adjusting.

4 years agoFactor out WoW detection
Jon Turney [Tue, 17 Mar 2020 13:52:55 +0000 (13:52 +0000)]
Factor out WoW detection

Factor out WoW detection as a separate function

4 years agoProduce detatched signature for setup executable using new and old keys release_2.903
Jon Turney [Sun, 1 Mar 2020 13:40:21 +0000 (13:40 +0000)]
Produce detatched signature for setup executable using new and old keys

This is slightly fraught: If we don't specify a digest preference, sha1
will be used with both keys, which we don't want.  Even if we do specify
a digest preference, sha1 is still used for DSA, and gpg won't verify
all the signatures, if they don't use the same hash algorithm (See [1]).
So specify dsa2 as well, to allow sha256 to be used in both signatures.

[1] https://dev.gnupg.org/T1462

4 years agoRun libgcrypt self-tests
Jon Turney [Fri, 28 Feb 2020 18:13:53 +0000 (18:13 +0000)]
Run libgcrypt self-tests

The libgcrypt in Fedora's mingw-libgcrypt package is patched to always
run self-tests, even if FIPS mode isn't on.

Ensure self-tests run before we turn on voluble debugging, to avoid even
more log spam.

If we're going to run the self-test, we should report if it fails :)

4 years agoUse a separate define to control debugging in gpg-packet.cc release_2.902
Jon Turney [Fri, 28 Feb 2020 14:21:44 +0000 (14:21 +0000)]
Use a separate define to control debugging in gpg-packet.cc

4 years agoFix build when CRYPTODEBUGGING is defined
Jon Turney [Fri, 28 Feb 2020 13:51:32 +0000 (13:51 +0000)]
Fix build when CRYPTODEBUGGING is defined

4 years agosetup.ini signing key rotation
Jon Turney [Fri, 21 Feb 2020 19:54:13 +0000 (19:54 +0000)]
setup.ini signing key rotation

Verify the setup.ini signature using a new key, or the old key (unless
the --disable-old-keys option is used)

New key:

sec   4096R/1A698DE9E2E56300 2020-02-27 [expires: 2022-02-26]
      Key fingerprint = 5640 5CF6 FCC8 1574 682A  5D56 1A69 8DE9 E2E5 6300
uid                          Cygwin <cygwin@cygwin.com>

Old key:

sec   1024D/A9A262FF676041BA 2008-06-13
      Key fingerprint = 1169 DF9F 2273 4F74 3AA5  9232 A9A2 62FF 6760 41BA
uid                          Cygwin <cygwin@cygwin.com>
ssb   1024g/0AF098B5A1DB7B5C 2008-06-13

Export key from gpg and generate s-expr format using:

$ gpg --export KEYID >cygwin.pub
$ ./gpg-key-to-s-expr.sh -C ./cygwin.pub >cyg-pubkey.h

4 years agoHandle multiple signature packets in .sig file
Jon Turney [Tue, 25 Feb 2020 13:49:31 +0000 (13:49 +0000)]
Handle multiple signature packets in .sig file

Rather than stopping after the first signature packet, handle multiple
signature packets appearing in a .sig file.  If any of them is a valid
signature from a known key, then the signature is good.

4 years agoProvide hash to DSA as an opaque block
Jon Turney [Mon, 24 Feb 2020 14:47:41 +0000 (14:47 +0000)]
Provide hash to DSA as an opaque block

Provide the hash to DSA as an opaque data block, rather than an MPI.
This allows libgcrypt to truncate the hash correctly when a hash alg is
specified which produces more than the 160 bits DSA accepts.

4 years agoIncrease buffer size in LogPrintf adaptors
Jon Turney [Sun, 23 Feb 2020 21:13:26 +0000 (21:13 +0000)]
Increase buffer size in LogPrintf adaptors

crypto.cc can now generate output lines bigger than the current buffer
size

4 years agoVarious improvements to debug output from crypto.cc
Jon Turney [Sat, 22 Feb 2020 20:44:35 +0000 (20:44 +0000)]
Various improvements to debug output from crypto.cc

Build an adaptor for log output from gcrypt (unfortunately complex as it
needs to gather/split lines on '\n')

Don't really need a hard breakpoint for ERRKIND, so it's the same,
irrespective of CRYPTODEBUGGING being defined.

Always debug log the pk type and hash alg in use.

Allow CRYPTODEBUGGING to be set by CPPFLAGS etc.

4 years agoTeach --pubkey option to handle RSA keys
Jon Turney [Sun, 23 Feb 2020 18:38:18 +0000 (18:38 +0000)]
Teach --pubkey option to handle RSA keys

v2:
Fix conflicting use of variable 'n'
v3:
Release RSA mpi temps 'n' and 'e'

4 years agoTeach gpg-key-to-s-expr.sh to handle RSA pubkeys
Jon Turney [Sat, 22 Feb 2020 20:05:14 +0000 (20:05 +0000)]
Teach gpg-key-to-s-expr.sh to handle RSA pubkeys

4 years agoAdd support for RSA key signatures
Jon Turney [Sun, 23 Feb 2020 23:47:37 +0000 (23:47 +0000)]
Add support for RSA key signatures

v2:
Fix leak of rsa_mpi_s

4 years agoConvert msg under CRYPTODEBUGGING to LogBabblePrintf
Jon Turney [Sat, 22 Feb 2020 20:23:46 +0000 (20:23 +0000)]
Convert msg under CRYPTODEBUGGING to LogBabblePrintf

Convert msg under CRYPTODEBUGGING to LogBabblePrintf, missed in 6f2a7375.

4 years agoRestructure how we try keys in order for signature checking
Jon Turney [Fri, 21 Feb 2020 19:07:02 +0000 (19:07 +0000)]
Restructure how we try keys in order for signature checking

Restructure how we try keys in order for signature checking, so we can
log which key signature was made by

v2:
Correctly default _owned to true

4 years agoRemove gpg-error-config-fake
Jon Turney [Fri, 21 Feb 2020 18:24:51 +0000 (18:24 +0000)]
Remove gpg-error-config-fake

Unused since 1e0f90f9

4 years agoAlso AttachConsole() when not elevating
Jon Turney [Mon, 24 Feb 2020 19:25:43 +0000 (19:25 +0000)]
Also AttachConsole() when not elevating

Arrange to call AttachConsole() when not elevating (e.g. 'setup -B').

This seems to be needed for output to stdout to work via a Windows
pseudo-console ('conpty'), as is used with cygwin >=3.0.0.

Note that setup is a GUI application. I have no idea what it means to
write to stdout without calling AttachConsole(), but that doesn't seem
to work anymore...

4 years agoFix 'make check'
Jon Turney [Mon, 3 Feb 2020 19:54:12 +0000 (19:54 +0000)]
Fix 'make check'

Add <string.h> where needed to fix compilation of libgetopt++ tests

UserSetting was removed in f26f525f, so remove that test.

UserSettings also got rewritten in that commit, so rewrite test.

Rework UserSettings constructor so it can be initialized without needing
to attempt loading from a file (which requires all the io_stream URL
providers we might try to be registered).

Run 'make check' in appveyor.

4 years agoMake inilint do something slightly useful
Jon Turney [Sun, 2 Feb 2020 23:03:57 +0000 (23:03 +0000)]
Make inilint do something slightly useful

Add IniDBBuilderLint, a do-nothing subclass of InitDBBuilder
Use CliParseFeedback for parser feedback

4 years agoPass a "Install for all users" flag into setDefaultSecurity()
Jon Turney [Mon, 3 Feb 2020 12:59:02 +0000 (12:59 +0000)]
Pass a "Install for all users" flag into setDefaultSecurity()

Pass an "Install for all users" flag into setDefaultSecurity(), rather
than evaluating it there, for better decoupling from settings & UI.

4 years agoFix building inilint
Jon Turney [Sun, 2 Feb 2020 20:50:53 +0000 (20:50 +0000)]
Fix building inilint

Fix Makefile.am for inilint
Always build inilint, so it doesn't rust again

4 years agoRestore abstract base class IniDBBuilder
Jon Turney [Sun, 2 Feb 2020 20:55:44 +0000 (20:55 +0000)]
Restore abstract base class IniDBBuilder

This effectively reverts commit 618bd457849ed44d301d27d81d3b2f262f798897.

4 years agoAdd CliParseFeedback class
Jon Turney [Thu, 6 Feb 2020 21:25:46 +0000 (21:25 +0000)]
Add CliParseFeedback class

Move the yyerror() handling from inilint into that class

4 years agoPull yyerror() handling up into IniParseFeedback
Jon Turney [Sun, 2 Feb 2020 22:14:14 +0000 (22:14 +0000)]
Pull yyerror() handling up into IniParseFeedback

Pull yyerror() handling up into IniParseFeedback
Collect the parser errors in IniParseFeedback
Make IniParseFeedback an abstract base class

4 years agoMore updates for "using namespace std;" removal
Jon Turney [Tue, 4 Feb 2020 12:29:46 +0000 (12:29 +0000)]
More updates for "using namespace std;" removal

overlooked in 155eacb6

4 years agoDon't always be silent about failing to fetch mirrors.lst release_2.901
Jon Turney [Mon, 27 Jan 2020 15:35:05 +0000 (15:35 +0000)]
Don't always be silent about failing to fetch mirrors.lst

Currently, if there is no cached mirrors list (e.g. this is the first
run), and we're behind some kind of proxy which doesn't let us through,
we'll try to fetch mirrors.lst, silently fail, and present the user with
an empty mirror list.

Instead, report failure to fetch mirror.lst if we don't have a cached
mirrored list (and a mirror isn't being explicitly specified with
'--only-site --site <someurl>').

4 years agoRemove EXCLUDE_ constants
Jon Turney [Sun, 2 Feb 2020 22:16:07 +0000 (22:16 +0000)]
Remove EXCLUDE_ constants

Should have been removed when 'EXCLUDE_PACKAGE' was removed from grammar
in c9797bed, or even when code using those constants was removed in
bb849dbd.

4 years agoRemove some lingering cvsids
Jon Turney [Mon, 3 Feb 2020 19:36:07 +0000 (19:36 +0000)]
Remove some lingering cvsids

4 years agoRemove .cvsignore
Jon Turney [Mon, 3 Feb 2020 12:54:34 +0000 (12:54 +0000)]
Remove .cvsignore

4 years agoUpdate displayed copyright to 2020
Jon Turney [Tue, 4 Feb 2020 12:13:13 +0000 (12:13 +0000)]
Update displayed copyright to 2020

4 years agoIgnore reinstall action when the package isn't installed release_2.900
Jon Turney [Thu, 2 Jan 2020 16:26:46 +0000 (16:26 +0000)]
Ignore reinstall action when the package isn't installed

'--packages X --remove-packages X' is interpreted by
applyCommandLinePackageSelection() as a request to reinstall X (and
similarly with --category X --remove-categories X).  If X isn't actually
already installed, this leads to bogus 'erase/install no-package' tasks
appearing in the task list.

4 years agoDynamically size columns in transaction list log
Jon Turney [Thu, 2 Jan 2020 15:37:12 +0000 (15:37 +0000)]
Dynamically size columns in transaction list log

4 years agoIgnore install action when no current package exists
Jon Turney [Thu, 2 Jan 2020 14:56:07 +0000 (14:56 +0000)]
Ignore install action when no current package exists

This isn't ideal as a command line to install a package which only has a
test version will do nothing.  But I think we don't want installing by
category to install packages in that category which only have a test
version. Unfortunately, both cases are currently identical by the time
we get to applyCommandLinePackageSelection().

4 years agoRevert "Fix cases where incorrect action is stored by set_action()"
Jon Turney [Thu, 2 Jan 2020 14:51:04 +0000 (14:51 +0000)]
Revert "Fix cases where incorrect action is stored by set_action()"

This reverts commit e435a212a6e85169616a67c08eab1d9a387c6cfc.

I'd forgotten that action = Install_action, desired = empty version is
how we represent 'install any version of this package'.  Converting that
to NoChange_action leaves us back mishandling obsolete packges specified
on the command line, fixing which was the whole point of this change. So
let's try to fix this a different way...

4 years agoFix cases where incorrect action is stored by set_action() release_2.899
Jon Turney [Wed, 1 Jan 2020 14:38:45 +0000 (14:38 +0000)]
Fix cases where incorrect action is stored by set_action()

set_action() with action = Install_action and desired = empty version
when curr = empty version is equivalent to action = NoChange_Action.

(This can occur if we are selecting a category for install on the
command line, and that category happens to include a package which only
has a test version, but no current version)

(For completeness, also address the case of action = Install_action,
desired = empty_version, where curr = some version is equivalent to
action = Uninstall_action)

4 years agoGenerate a pseudo-package with the Windows version release_2.898
Jon Turney [Fri, 20 Dec 2019 14:22:27 +0000 (14:22 +0000)]
Generate a pseudo-package with the Windows version

Generate a pseudo-package with the Windows version, so packages can have
a requires with a version relation upon it.

4 years agoEnsure we only set user_picked when appropriate
Jon Turney [Thu, 11 Jul 2019 19:36:42 +0000 (20:36 +0100)]
Ensure we only set user_picked when appropriate

Add an optional parameter to set_action(), to indicate the action is the
result of user action, and only set user_picked then.

Set that parameter when installing from the command line. All other user
actions come through select_action(), so also set that parameter there.

4 years agoUse stored action in packagemeta::action_caption()
Jon Turney [Tue, 9 Jul 2019 17:24:30 +0000 (18:24 +0100)]
Use stored action in packagemeta::action_caption()

Use the stored action in packagemeta::action_caption(), rather than
working backwards from desired/installed/picked.

4 years agoUse stored action in packagemeta::list_actions()
Jon Turney [Tue, 9 Jul 2019 17:10:12 +0000 (18:10 +0100)]
Use stored action in packagemeta::list_actions()

Use the stored action in packagemeta::list_actions(), rather than
working backwards from desired/installed/picked.

4 years agoAllow better handling of an obsolete package specified on command line
Jon Turney [Tue, 9 Jul 2019 15:53:57 +0000 (16:53 +0100)]
Allow better handling of an obsolete package specified on command line

Now we have the flexibilty to record a package as explicitly required to
be installed, rather than merely installed because the desired version
is different to the installed version, we can record packages selected
for installation on the command line as distinct from choosing a
specific version of that package via the picker.

Use this to allow the solver to make a better choice of what provides a
package name specified on the command line.

(Note that we need to use SOLVER_SOLVABLE_PROVIDES rather than
SOLVER_SOLVABLE_NAME to allow the solver to take packages which provide
and obsolete the named package into account.)

Only turn this behaviour on when --upgrade-also is specified.

e.g. setup -q -g -P python3-lxml currently gets you an (empty)
python3-lxml package, which is replaced by python36-lxml (which
obsoletes it) on the next setup run.  After this change, python36-lxml
is installed instead.

See also the dicusssion at
https://cygwin.com/ml/cygwin-apps/2017-10/msg00092.html et seq.

4 years agoUse stored action in setting up solver
Jon Turney [Tue, 9 Jul 2019 15:10:19 +0000 (16:10 +0100)]
Use stored action in setting up solver

Use stored action in setting up the solver, rather than working out what
the action was from _picked/installed/desired.

4 years agoUse packagemeta::set_action() to update action
Jon Turney [Tue, 9 Jul 2019 18:22:37 +0000 (19:22 +0100)]
Use packagemeta::set_action() to update action

Use packagemeta::set_action() to update the action for packagemeta
object in more (hopefully all) the places it gets changed.

(Future work: ideally we'd opaque packagemeta internals more by making
installed/curr/desired/etc. object private, rather than letting users
grovel around in those details)

4 years agoStore the requested action in packagemeta::set_action()
Jon Turney [Tue, 9 Jul 2019 14:40:04 +0000 (15:40 +0100)]
Store the requested action in packagemeta::set_action()

Store the action requested with set_action() in the packagemeta object,
rather than just encoding it in _picked/installed/desired (see
discussion in commit 4209699d)

Try to avoid meaningless states occuring, i.e. action=Install with
desired=installed is converted to action=Keep.

Future work: There's still some odd stuff left in set_action() which we
need to do some hard thinking about: action=NoChange treats Base
category packages specially, action=Install will switch to installing
the source if binary isn't accessible.

4 years agoRename 'Default' packagemeta action to 'NoChange' for clarity
Jon Turney [Fri, 12 Jul 2019 12:56:09 +0000 (13:56 +0100)]
Rename 'Default' packagemeta action to 'NoChange' for clarity

4 years agoMake packagemeta::message private
Jon Turney [Tue, 9 Jul 2019 16:54:35 +0000 (17:54 +0100)]
Make packagemeta::message private

4 years agoRemove unused packagemeta::key
Jon Turney [Tue, 9 Jul 2019 13:44:27 +0000 (14:44 +0100)]
Remove unused packagemeta::key

Contains an identical value to packagemeta::name

4 years agoRemove 'Bin?' column
Jon Turney [Fri, 12 Jul 2019 11:38:54 +0000 (12:38 +0100)]
Remove 'Bin?' column

The only use this column appears to have now is that unticking it is the
same as selecting 'uninstall'.

Future work: Make 'Src?' column more independent, rather than
interacting with the 'New' (action) column in non-obvious ways. We
should be able to choose to install source irrespective of the state of
the binary package. (That should also take into account the
'--include-source' option)

5 years agoUpdate displayed copyright to 2019 release_2.897
Jon Turney [Sun, 24 Mar 2019 20:38:25 +0000 (20:38 +0000)]
Update displayed copyright to 2019

5 years agoAdd double-click for a 'default action' to ListView release_2.896
Jon Turney [Wed, 20 Mar 2019 19:56:44 +0000 (19:56 +0000)]
Add double-click for a 'default action' to ListView

Add support for a double-click in the ListView to invoke a 'default
action'.

Because we receive both NM_CLICK and then NM_DBCLK, reduce the area of a
pop-up column which is sensitive to a click to the drop-down button
(which opens a focus-stealing pop-up menu), so the rest of the area can
receive a click (which does nothing) or a double-click (which does the
default action).

For a package, this default action is to toggle between the currently
installed version (or uninstalled, if not installed), and the highest
non-test version.

There is no keyboard acceleration for this action currently.

5 years agoDon't propagate actions down category tree into obsolete categories
Jon Turney [Wed, 20 Mar 2019 18:08:23 +0000 (18:08 +0000)]
Don't propagate actions down category tree into obsolete categories

Choosing the 'Install' action on the 'All' category shouldn't propagate
down into the '_obsolete' category, because that will just result in
dependency conflicts due to trying to install both obsolete packages and
their replacements.

5 years agoDon't show FTP 550 'file not found' errors in a MessageBox
Jon Turney [Wed, 20 Mar 2019 17:12:08 +0000 (17:12 +0000)]
Don't show FTP 550 'file not found' errors in a MessageBox

Don't show FTP 550 'file not found' errors in a MessageBox. Also log
InternetGetLastResponseInfo() when fetching a URL.

WinInet documentation seems to indicate this kind of extended error
information only exists when WinInet has an FTP error code to report.

Log this error (and the associated URL) rather than just showing a
MessageBox. Don't bother showing a MessageBox for 550, since we can
tolerate certain missing files (e.g. setup.zst), and we'll go on to
report that couldn't fetch needed files in a more generic way.

5 years agoUse 'kill -W' when killing processes
Jon Turney [Wed, 20 Mar 2019 16:23:36 +0000 (16:23 +0000)]
Use 'kill -W' when killing processes

We only have access to the Windows PID, which (since Cygwin 3.0.0) are
completely decoupled from Cygwin PIDs.

Use the new '-W' flag to indicate to kill that we are providing a
Windows PID.

(If the Cygwin install is too old to support kill -W, kill will fail,
and we'll fall back to using TerminateProcess())

5 years agoOnly dump transaction list when it's finalized release_2.895
Jon Turney [Sun, 21 Oct 2018 12:14:05 +0000 (13:14 +0100)]
Only dump transaction list when it's finalized

Dumping the transaction list after 1) trust level is set, 2) solving for
dependencies, and 3) adding source packages is a bit much.

5 years agoSimple keyboard accelerators for Listview
Jon Turney [Sat, 21 Jul 2018 21:19:51 +0000 (22:19 +0100)]
Simple keyboard accelerators for Listview

Wire-up certain actions to keyboard accelerators.

To permit selecting a subitem apparently needs us to custom-draw everything,
so for simplicity, just make the accelerators per row.

Getting the enter keypress to be delivered to the listview is tricky (the
propsheet really want to hold onto it), so for the moment we just use the
Windows menu key and space bar as accelerators.

5 years agoIndicate test packages in action menu
Jon Turney [Wed, 17 Oct 2018 13:12:26 +0000 (14:12 +0100)]
Indicate test packages in action menu

5 years agoAdd listview to tab order on chooser page
Jon Turney [Sat, 21 Jul 2018 21:19:51 +0000 (22:19 +0100)]
Add listview to tab order on chooser page

5 years agoUse selected row background colour for a checkbox column
Jon Turney [Wed, 17 Oct 2018 12:39:17 +0000 (13:39 +0100)]
Use selected row background colour for a checkbox column

5 years agoAllow for width of dropdown button in popup columns
Jon Turney [Mon, 15 Oct 2018 19:46:31 +0000 (20:46 +0100)]
Allow for width of dropdown button in popup columns

Currently, the dropdown button in the 'New' column can overlap the version,
because  'New' columns is just sized to hold the widest version.

Allow for the width of the dropdown button as well in the 'New' column width

5 years agoMerge branch 'topic/listview' release_2.894
Jon Turney [Sat, 13 Oct 2018 17:56:11 +0000 (18:56 +0100)]
Merge branch 'topic/listview'

5 years agoEnsure that an installed packageversion has an ldesc if possible
Ken Brown [Mon, 6 Aug 2018 14:05:12 +0000 (10:05 -0400)]
Ensure that an installed packageversion has an ldesc if possible

In packagedb::read(), copy the ldesc from setup.ini to the
packageversion read from installed.db.  Otherwise, an installed
package with only one version will not have an ldesc to use as a
tooltip.

v2: If the installed version is no longer available, copy the ldesc
from the current version of the package.

5 years agoAdd ldesc tooltips to sdesc column of listview
Jon Turney [Fri, 20 Jul 2018 11:52:20 +0000 (12:52 +0100)]
Add ldesc tooltips to sdesc column of listview

Listview's built-in tooltip support doesn't support subitems, so we have to
build our own

v2: Use string cache

5 years agoRestore packagemeta::LDesc()
Jon Turney [Wed, 18 Jul 2018 19:50:31 +0000 (20:50 +0100)]
Restore packagemeta::LDesc()

v2:
Update for removed 'usiing namespace std'

5 years agoAdd LDesc() accessor method to SolvableVersion
Jon Turney [Sun, 15 Jul 2018 14:41:12 +0000 (15:41 +0100)]
Add LDesc() accessor method to SolvableVersion

5 years agoUse indents in category view
Jon Turney [Tue, 17 Jul 2018 10:09:32 +0000 (11:09 +0100)]
Use indents in category view

We keep around an empty imagelist for 1x1 images, to reset the indent when
not in tree view mode

(This isn't quite right as the listview will allocate a 1-pixel space before
column 0 for those images, but this seems the best we can do as 0x0
imagelists aren't allowed...)

5 years agoUse an icon to represent expanded/collapsed state
Jon Turney [Tue, 17 Jul 2018 18:26:23 +0000 (19:26 +0100)]
Use an icon to represent expanded/collapsed state

Use a listview icon to represent expanded/collapsed state, rather than
puttting '[+]'/'[-]' in front of the category name

Just use the item icon directly to represent expanded/collapsed state,
rather than using a state icon as otherwise we have empty space where the
item icon would be, when it's size is being used for indenting.

The icons were made by tracing the previously used .bmp in Inkscape to
produce a .svg, then converting that to an icon with ImageMagick using
'convert -filter point -background transparent -define icon:auto-resize'

v2:
Drop execute mode (Achim Gratz)

5 years agoShow the count of packages in a category
Jon Turney [Mon, 16 Jul 2018 19:02:25 +0000 (20:02 +0100)]
Show the count of packages in a category

5 years agoCustom draw popup menus in ListView control
Jon Turney [Wed, 7 Dec 2016 19:52:58 +0000 (19:52 +0000)]
Custom draw popup menus in ListView control

Construct a menu containing the actions from the action list for the package
or category, and if one is selected, apply it.

This lets us remove packagemeta::set_action() which implements the strange
UX of cycling around actions without showing what the possibilities are.

This somewhat emulates a BS_SPLITBUTTON style control.  The 'popup' cell has
a visual hint that clicking on it opens a menu (a 'combox scrollbar'), and
the popup menu is located at the position of the click.

v2:
Factor out popup_menu, for future use by keyboard accelerators

5 years agoAdd methods for listing possible actions on, and applying one to, a package
Jon Turney [Thu, 8 Dec 2016 17:57:59 +0000 (17:57 +0000)]
Add methods for listing possible actions on, and applying one to, a package

The 'action id' is a value of the _actions enum, if positive, otherwise it's
absolute value is a 0-based index into the 'versions' collection to identify
a specific version to install.

v2:
Fix select_action() to consider deftrust

v3:
Fix select_action() for keep

v4:
Update for removed 'using namespace std'

5 years agoCustom draw checkboxes in ListView control
Jon Turney [Wed, 7 Dec 2016 16:17:12 +0000 (16:17 +0000)]
Custom draw checkboxes in ListView control

Future work: What does this look like when a theme is in used? Does the row
size need to be slightly adjusted to ensure it accomodates checkbox height?

v2:
erase to background colour before drawing checkbox

5 years agoUse a ListView common control rather than a hand-built grid
Jon Turney [Wed, 7 Dec 2016 14:09:35 +0000 (14:09 +0000)]
Use a ListView common control rather than a hand-built grid

Each line is implemented by an object of a subclass of ListViewLine, either
PickPackageLine, or (in catgeory view) PickCategoryLine

v2:
Defer constructing category tree until packagedb is available
Also handle an empty category tree
Remove unused bitmaps
Scoping of strings returned to LVN_GETDISPINFO
Avoid doubled 'all' category
Update some number of lines, rather than just the current one

v3:
Speed up calculating column widths, by caching the DC used
Don't bother recalculating column widths when obsolete packages are
shown/hidden, just allow for obsolete packages always (which makes hardly
any difference)
Don't bother calculating column widths separately for category view since
they are now always the same.

v4:
Store current category action in CategoryTree
Recurse category action onto packages

This slightly changes the behaviour: previously, a category action only
effected packages which matched the name search filter.  Now all packages in
contained by the category are effected.

v5:
When updating, turn off redraw before emptying listview
Make headers a parameter to init
Don't leak contents
Only resize columns once
Remove ListView OnMessage as it has nothing to do
Never use a column width less than minimum
Use LVS_SINGLESEL
Factor out string cache for re-use
Preserve focused row over ListView::setContents()

5 years agoAdd OnNotify virtual function to class Window for WM_NOTIFY notifications
Jon Turney [Fri, 16 Sep 2016 18:23:26 +0000 (19:23 +0100)]
Add OnNotify virtual function to class Window for WM_NOTIFY notifications

Add OnNotify virtual function to class Window for WM_NOTIFY notifications
Note that the result is returned via DWLP_MSGRESULT

This page took 0.072627 seconds and 5 git commands to generate.